• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XPathException

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic