[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Re: Can not convert #STRING to a NodeList! Error..


Subject: Re: [xsl] Re: Can not convert #STRING to a NodeList! Error..
From: "arun prasath" <arunwaits@xxxxxxxxxxx>
Date: Sun, 09 Nov 2003 20:02:23 +0530


Thank you so much for all your replies.
Still I couldnt solve the problem. This would give much more information.
I am using the root template just to load the corresponding labels xml file depending upon language preference. From root template, I am calling second template "main", inside which all the main processing is done.


I have tested the code in debug mode, using xmlspy and found these:
these are the steps which are executed.
1. From root template(First template): I load the xml document using document() function and call second template <xsl:call-template name="main">
2. In first child template(second template) "main", I am able to fetch the labels successfully using
<xsl:for-each select="$labelsfile">
<xsl:value-of select="key('label','labelname')"/>
</xsl:for-each>
3. From this template, I am again calling child templates using
<xsl:apply-templates>
<xsl:with-param name="labelsfile" select="$labelsfile"/>
</xsl:apply-templates>
4. Next Default template prints the node values for some of the xml tags.
5. Next when a template node is matched (third),the third template is being executed, I have declared the param tag
<xsl:param name="labelsfile"/>


Problem comes only here.. here, the variable "labelsfile" is shown as a String rather than a Nodelist. and its value is blank.
and when the tag <xsl:for-each select="$labelsfile"> is being executed, it shows error.
The error shown is correct.
But why is the parameter not being passed to this child template. am I missing something..


please correct me where I have gone wrong.
regards
s.arun prasath

"arun prasath" <arunwaits@xxxxxxxxxxx> wrote in message
news:BAY2-F124pwACkWHZqY00003637@xxxxxxxxxxxxxx
> Hi,
> In my XSL,
> from the parent template I load a XML file using document() function. and
I
> pass this as parameter to child templates.
> <xsl:call-template name="main">
> <xsl:with-param name="labelsfile" select="document('English.xml')"/>
> </xsl:call-template>
>
> In my child templates, I am retrieving using
> <xsl:param name="labelsfile"/>
>
> I also have declared a key(xsl:key) in the importing xml file in my xsl.
> <xsl:for-each select="$labelsfile">
> <xsl:value-of select="key('label','ecollab.businessfollowedby')"
/>
> </xsl:for-each>
>
> when I transform this using my java program, I get the following
exception.
> Can not convert #STRING to a NodeList!
>
> I want to know why we get this error usually.
> please help
> regards
> s.arun prasath
>
> _________________________________________________________________
> Make fun prints Click here to order. http://www.kodakexpress.co.in
Delivery
> anywhere in India.
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>





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



_________________________________________________________________
Discover digital jadoo! Enter this contest. http://server1.msn.co.in/sp03/mediacenter/index.asp Win cool prizes!



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




Current Thread
Keywords