shridhars Posted October 17, 2006 Share Posted October 17, 2006 Hi,I am having a xml file, which i want to transform into another xml file. I have a processing instruction like <?Insert-Table ID="med-9780198530855-tableGroup-1"?>and the actual table text is placed into another element having same id, which i want to move into its original position using id of processing instruction "Insert-Table" (i.e. med-9780198530855-tableGroup-1).Can we access the ID attribute info inside processing instruction using XSLT?RegardsShridhar S Link to comment Share on other sites More sharing options...
boen_robot Posted October 17, 2006 Share Posted October 17, 2006 I think you can with an XPath expression like this: processing-instruction('Insert-Table')/@ID If that doesn't work (as I'm reading one site, I think this might be the case), you must treat the attributes as strings, like this: <xsl:template match="processing-instruction()"> <xsl:value-of select="substring-before(substring-after(., 'ID="'), '"')" /></xsl:template> Link to comment Share on other sites More sharing options...
shridhars Posted October 18, 2006 Author Share Posted October 18, 2006 Yes, BoenI already tried first one, but it doesn't work.Second option works perfectly.This forum is really helpful for all users.Thanks againShridhar S. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now