[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Nesting <xsl:value-of> tags

Subject: RE: Nesting <xsl:value-of> tags
From: "Roger Glover" <glover_roger@xxxxxxxxx>
Date: Mon, 3 Feb 2003 15:27:44 -0600
nesting xsl
Zvolensky, Thomas J {PGL~Nutley} wrote:

> I have an xsl stylesheet that reads an xml document and selects
> all nodes having a specific non-blank attribute.
>
> The skeleton of my tags is as follows:
>
>
> <xsl:for-each select="//*[./@filename != '']">
> .
> .
> <xsl:value-of
> select="document('ShareWebUsers.xml')//person[id=<xsl:value-of
> select="../@ownedby"/>]/ntname"/>
> .
> .
> </xsl:for-each>
>
>
> In the middle, I have an <xsl:value-of> tag that reads a value
> from another document (ShareWebUsers.xml) and returns the value
> of the <ntname> tag based on the value of "ownedby" attribute of
> the current node.
>
> When I use the code as described above, XMLSPY informs me that my
> XML is not well-formed.
>
> Is it possible to nest <xsl: value-of> tags like this?

No, XSLT does not allow it, but even more fundamentally, it is not
well-formed XML.


> If not,
> is there another way to look up the value of <ntname> from the
> other document?

Since you are confused on this issue, it is unclear to me what you intend
".." to mean:
    o   parent of the "current node" ("current" is node selected by
        "//*[./@filename != '']")
    o   parent of the "context node" ("context" is node selected by
        "document('ShareWebUsers.xml')//person")

If you want the current node's parent, use this:

    <xsl:value-of
    select =
    "document('ShareWebUsers.xml')//person[id =
current()/../@ownedby"/>]/ntname"
    />

If you want the context node's parent, use this:

    <xsl:value-of
    select =
    "document('ShareWebUsers.xml')//person[id = ../@ownedby"/>]/ntname"
    />

I hope this helps!

-- Roger Glover
   glover_roger@xxxxxxxxx



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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.