xmlxsltvalue-of

Select value of xml document with namespace


I have the following XML snippet

<aaa>
  <bbb xmlns="http://net.some.address.com">
    <ccc>123321</ccc>
  </bbb>
</aaa>

And i want to select the value of <ccc> with XSL template, but not able to get it by using

<xsl:value-of select="/aaa/bbb/ccc"/>

Any ideas how to get the value without changing the input ?


Solution

  • Declare the namespace and use it.

    <xsl:value-of xmlns:a="http://net.some.address.com" select="/aaa/a:bbb/a:ccc"/>