Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XPathException

 
able lam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got the XPathException when passing parameter to Transformer
--- foo.xml ----

---- foo.xsl ----

---- UseStylesheetParam.java ----


I expect "Hello2" will be output, but expection is thrown, how can i solve the problem ??
[ February 13, 2004: Message edited by: able lam ]
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the full stack trace of the exception?
 
able lam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know the problem is the type is not matched,
but i really want to pass '/doc' to $param1

org.apache.xpath.XPathException: Can not convert #STRING to a NodeList!
at org.apache.xpath.objects.XObject.error(XObject.java:740)
at org.apache.xpath.objects.XObject.iter(XObject.java:443)
at org.apache.xpath.Expression.asIterator(Expression.java:288)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(
ElemApplyTemplates.java:245)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTempla
tes.java:215)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(
ElemApplyTemplates.java:429)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTempla
tes.java:215)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Tr
ansformerImpl.java:2362)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Tran
sformerImpl.java:2228)
at org.apache.xalan.transformer.TransformerImpl.transformNode(Transforme
rImpl.java:1306)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
l.java:704)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
l.java:1222)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
l.java:1200)
at UseStylesheetParam.main(UseStylesheetParam.java:95)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic