Jump to content

Recommended Posts

Posted

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 :)

Posted

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>

Posted

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.

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
×
×
  • Create New...