xsl-list
[Top] [All Lists]

RE: XPath & generate-id

2003-03-31 15:31:03
Michael,

But When I do:

        generate-id("../../../edcSystem/EDCContract/@a10")   [ this is ,
indeed, the relative Path of this node from the call-template context].


It works just fine and generates an Id.

Also,
Could you tell me what is the default-namespace-declaration pitfall or where
can I read up on it?

Thanks,
Ashish.

-----Original Message-----
From: Michael Kay [mailto:mhk(_at_)mhk(_dot_)me(_dot_)uk]
Sent: Monday, March 31, 2003 5:07 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] XPath & generate-id


You say that the path expression points to a valid node in the XML tree.
The evidence suggests that it doesn't.

Perhaps you've fallen into the old trap of having a default namespace
declaration? Or perhaps the context node is in a different document from
the one you are assuming?

Show us the source file and the full stylesheet.

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com 

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Bhandari, Ashish
Sent: 31 March 2003 17:48
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] XPath & generate-id


The named template below generates the following output - the 
href has no value when it should have one.

<payerPartyReference href="">
</payerPartyReference>

edcSystem is the root Element and the XPATH does point to a 
valid node in the XML tree. How do I specify an absolute path 
to generate-id function ?. I think it interprets the path as 
a relative one.


Named Template:

<xsl:template name = "eqs-utility:generate-pay-receive-references">
              <xsl:param name = "payReceiveCode"/>
              <xsl:element name = "payerPartyReference">
                      <xsl:attribute name = "href">
                              <xsl:choose>
                                      <xsl:when test =
"$payReceiveCode=0">
                                              <xsl:value-of 
select = "generate-id(/edcSystem/EDCContract/@a10)"/>
                                      </xsl:when>
                                      <xsl:otherwise>
                                              <xsl:value-of 
select = "generate-id(/edcSystem/EDCContract/@a11)"/>
                                      </xsl:otherwise>
                              </xsl:choose>
                      </xsl:attribute>
              </xsl:element>
</xsl:template>


Thanks,
Ashish.




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>