I'm running an XSLT against a 3rd party XML file that has element names that contain colons.
<xccdf:TestResult xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
<xccdf:benchmark href="ine" id="abs"/><xccdf:title xml:lang="en-US">TestConten</xccdf:title>
....
....
Now in my XSL file, when i try to extract the value of an atribute or the data under an element
<xsl:value-of select="xccdf:TestResult/xccdf:benchmark/@id"/>
<xsl:value-of select="xccdf:TestResult/xccdf:title"/>
I get no value. I get empty data.
In the XSLT, i declared the namespace too.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2">
Am not sure how to extract the value of the element or attribute!! Any pointers would be appreciated.
In your linked stylesheet, you declare the namespace as xmlns:xccdfSchema="http://checklists.nist.gov/xccdf/1.1", so your XPath expressions in the stylesheet should actually be prefixed by xccdfSchema and not xccdf. – helderdarocha May 30 at 13:22
The suggestion made by @helderdarocha worked.
All i needed to do was the set the namespace and use xccdfSchema:ElementName in the XPath expressions