58957

Question:
I have processing-instructions in XML.
How can I get the <strong>id</strong> value in processing-instruction when we apply the
<xsl:template match="Dest" >
<?abc ?abc:Dest id="e47529cb-4d17-461b-8438-e3b6d9ec1a68"??>
</xsl:template>
Answer1:The solution is:
<strong>INPUT:</strong>
<abc>
<?abc ?abc:Dest id="e47529cb-4d17-461b-8438-e3b6d9ec1a68"??>
</abc>
<strong>XSLT:</strong>
<?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>
<strong>OUTPUT:</strong>
<P-I>e47529cb-4d17-461b-8438-e3b6d9ec1a68</P-I>