Connecting Tech Pros Worldwide Help | Site Map

Namespace in XPATH reference

Newbie
 
Join Date: Oct 2006
Posts: 1
#1: Oct 10 '06
Hi all!,
I'm writing an XSLT where I have attributes containing references to nodes in the same XML file using an XPATH expression.

For instance, I have an attribute with: "/Model/resourceModel/Ref[@Id='output_2']/resource/@content"

I'm using a namespace (isu:), so I write things like:

<xsl:template match="isu:Model">
<xsl:apply-templates/>
</xsl:template>

The problem is that when I try to select the element pointed by an attribute it fails. It only works If I write:

"/isu:Model/isu:resourceModel/isu:Ref[@Id='output_2']/isu:resource/@content"

But I don't know how to do that automatically. I don't know if it is possible to specify a namespace embracing a whole expression rather than just an element.

Could anybody help me please?

Thanks in advance,

Pepe
Reply