This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Document() Problem:
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Document() Problem:
- From: Gavin Myers <GavinM at yatra dot net>
- Date: Thu, 21 Jun 2001 17:16:45 -0500
- Reply-To: xsl-list at lists dot mulberrytech dot com
Okay, lets say this is my xml:
<!--names.xml-->
<root>
<name>joe</name>
<name>fred</name>
</root>
and this is my xsl:
<!--nameprocess.xsl-->
<xsl:variable name="xml" select="document('names.xml')//root"/>
<!--... skipping all of the not-important things -->
<xsl:template match="/">
<xsl:value-of select="$xml/name/."/>
</xsl:template>
this is correct right?
Now, i've been working on this all day, i mean ALL DAY. So i've tried every
single / ./ //. /./ .//. combination i can think of.
I'm using xalan.
If I Just do this:
<xsl:variable name="xml" select="document('names.xml')/>
<xsl:value-of select"$xml"/>
I get null + the number of elements/attributes. So with the example xml
above it would return: nullnullnullnullnull
If i put ANY slash in the xsl:Variable i get a xalan error that says it
cannot get the value of $variable.
If i put ANY slash in the xsl:value-of i get a null pointer exception
I've tried xsl:copy-of, xsl:for-each, and xsl:value-of
I've also tried xsl:paramater, and xsl:variable
I've also tried <xsl:value-of select="document('names.xml')/> <xsl:for-each,
<xsl:copy-of, etc...
I've tried EVERYTHING i can think of but i cannot get this seemingly simple
thing to work. Does anyone know if this is a xalan issue, or is there
something i am missing?
Gavin
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list