|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
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








