Reputation: 67171
<description>Valid Status Code required (“A”, “R”, “P”, “AR”)
<br />
<list type="bullet">
<item>
<description>A = Approved</description>
</item>
<item>
<description>R = Rejected</description>
</item>
<item>
<description>P = Partial</description>
</item>
<item>
<description>AR = Archived</description>
</item>
</list>
</description>
I'm trying to get simply: Valid Status Code required (“A”, “R”, “P”, “AR”)
from the description XML node, not the child nodes.
<xsl:value-of select="description" />
Doing this returns the text from everything.
How can I ignore the child nodes?
<xsl:value-of select="description(ignore children)" /> // <- pseudo-code
Upvotes: 0
Views: 46
Reputation: 19512
Keep in mind that ANYTHING in a XML DOM is a node, not only the element nodes. The string is in a text node. The location path for child nodes of description that are text nodes is:
description/text()
Any element node would be:
description/*
And any node:
description/node()
Upvotes: 1
Reputation: 117140
Try:
<xsl:value-of select="description/text()"/>
Or, perhaps preferably:
<xsl:value-of select="normalize-space(description/text())"/>
Upvotes: 1