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

Re: Document() Problem:

Subject: Re: Document() Problem:
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 21 Jun 2001 23:39:07 +0100
Re:  Document() Problem:

] <xsl:variable name="xml" select="document('names.xml')//root"/>
the // there makes the processor search the entire document for all
elements called root, and return all of them. You know there's only one,
at the top, but it doesn't:


<xsl:variable name="xml" select="document('names.xml')/root"/>

would be quicker.
(by the way it's really confusing to call the document element "root"
as it confuses the issue with the document root (/) which is something
else entirely)


} <xsl:value-of select="$xml/name/."/>

<xsl:value-of select="$xml/name"/>

would select all  the name elements, which is what I think you want.
but then as you use value-of it will take th estring value of the node
set which is the string value of the first node in the set in document
order, ie just the first name.

Perhaps you want

<xsl:value-of select="$xml"/>
the string value of the (single element node, root) is the concatenation
of the values of its children, ie all th enames.

or more likely you want
<xsl:apply-templates select="$xml/name"/>
or for-each, to do something with th enames individually.

> I get null + the number of elements/attributes.
This doesn't make sense, null isn't an XSL value, what do you get?

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 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.