|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Working with 2 namespaces
On Sunday 24 March 2002 13:21, Andreas Schlegel wrote:
> I have a "<xsl:for-each select="/test/common/fields/*">" loop.
> For every item in this loop I would refer to an item in another
> namespace ("<xsl:value-of select="/test/common/labels/."/>.
> Both items have the same name but are in different namespaces.
> My problem is: how to get the name of the current item and use it to get
> the corresponding item in the other namespace ("/test/common/labels/")?
Can you please post some sample input and output? There are a dozen possible
answers, but it is impossible to tell what you really mean.
Either way, though, the answer will likely end up using <xsl:key> and key(),
so you might investigate those. Also investigate the local-name() function,
which will give you the name of an element not including its namespace
prefix. If I'm interpreting your question right, you could do this:
<xsl:key name="label" match="/test/common/labels/*" use="local-name(.)"/>
...
<xsl:for-each select="/test/common/fields/*">
<xsl:value-of select="key('label', local-name(.))"/>
</xsl:for-each>
--
Peter Davis
Valerie: Aww, Tom, you're going maudlin on me ...
Tom: I reserve the right to wax maudlin as I wane eloquent ...
-- Tom Chapin
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








