This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

error using XNodeSet to pass global stylesheet parameters (in Xalan)


I am trying to pass an XNodeSet as a global parameter to a stylesheet, but
when i try to use that parameter in the stylesheet it is
giving an error "XPATH: Can not convert #RTREEFRAG to a NodeList!"

This is what i did


Created a org.w3c.dom.Element and made an XNodeSet out of it.
Element NameList;
XNodeSet namenodelist = new XNodeSet(NameList);
The XML representation of NameList is below:
<NameList>
	<Name value="John"/>
	<Name value="Robert"/>
	<Name value="Mark"/>
</NameList>

then I set it using setStylesheetParam method of
org.apache.xalan.xslt.XSLTProcessor 
for eg setStylesheetParam("listofnames", namenodeset )

in my xslt sheet i have a global parameter defined as follows

<xsl:param name="listofnames"/>


and in some template i try this

<xsl:variable name="names" select="$listofnames/Name"/>

Basically I am trying to access the Name nodes of the NameList parameter I
passed in, but it does not work.

I get this error. "XPATH: Can not convert #RTREEFRAG to a NodeList!"

Can someone figure out the problem in my methodology.

thanks

-Vasu

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]