Jump to content

processing-instruction


shridhars
 Share

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...