Reputation: 267
I have processing-instructions in XML.
How can I get the AQtext value in processing-instruction when we apply the
<?show AQ=2 AQtext=ACTH, GH, TSH, FSH, LH and T3?>
Upvotes: 2
Views: 1819
Reputation: 1
The pi value on 'show' AQtext will normally be in quotes, so just that part would be the following:
AQtext="ACTH, GH, TSH, FSH, LH and T3"
But that method should work to get the value, was trying to find how but appears this should work. While they may not be required that is the preferred format so more than one can be defined on a PI. Also note AQtext is not an attribute since all text is actually just that text of the PI until the end ?> tag.
Upvotes: 0
Reputation: 167446
You can use string functions like
<xsl:template match="processing-instruction('show')">
<xsl:value-of select="substring-after(., 'AQtext=')"/>
</xsl:template>
But generally there is no format for the value of a processing instruction and you need to parse out any value in your code yourself.
Upvotes: 3