Dear all,
I am having problem in one of my XSL which I believe is due to the lack
of context on the nodelist returned by one of my XSL extensions.
The function looks like:
public static org.w3c.dom.traversal.NodeIterator tokenize(
org.apache.xalan.extensions.ExpressionContext iContext,
String istrValue,
String istrSeparator)
throws javax.xml.transform.TransformerException
{
org.apache.xpath.NodeSet result = new
org.apache.xpath.NodeSet();
org.w3c.dom.Document dom =
com.anite.connect.utility.XML.newDocument();
if(istrValue != null || istrSeparator != null)
{
java.util.StringTokenizer tokenizer =
new java.util.StringTokenizer(istrValue, istrSeparator);
while(tokenizer.hasMoreElements())
{
result.addNode(dom.createTextNode(tokenizer.nextToken()));
}
}
return result;
}
if I use it in a for each statement, the context seems to point to
nothing (i.e. <xsl:copy-of select="/"/> returns nothing, and my
apply-templates returns nothing) :
<xsl:for-each
select="java:MyXslt.tokenize(string(/message//request_summary/TaskList),
',')">
<xsl:comment>Task ID: <xsl:value-of select="."/></xsl:comment>
<xsl:comment><xsl:copy-of select="/"/></xsl:comment>
<xsl:apply-templates
select="/message/message_body/opti:DataSet1" ><xsl:with-param
name="taskId" select="."/></xsl:apply-templates>
</xsl:for-each>
What do I need to do for the result of my extension to be in the proper
context?
All help appreciated
Franck
Scanned for viruses by BlackSpider MailControl. The integrity and security of
this message cannot be guaranteed. This email is intended for the named
recipient only, and may contain confidential information and proprietary
material. Any unauthorised use or disclosure is prohibited.