xml - How to read the processing-instructions properties? -
i have processing-instructions in xml.
how can id value in processing-instruction when apply
<xsl:template match="dest" > <?abc ?abc:dest id="e47529cb-4d17-461b-8438-e3b6d9ec1a68"??> </xsl:template>
the solution is:
input:
<abc> <?abc ?abc:dest id="e47529cb-4d17-461b-8438-e3b6d9ec1a68"??> </abc>
xslt:
<?xml version='1.0' ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template match="processing-instruction('abc')"> <p-i><xsl:value-of select="substring-before(substring-after(.,'id="'),'"')"/></p-i> </xsl:template> </xsl:stylesheet>
output:
<p-i>e47529cb-4d17-461b-8438-e3b6d9ec1a68</p-i>
Comments
Post a Comment