You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Brian Hüttner <ti...@Informatik.Uni-Bremen.DE> on 2000/06/17 20:39:37 UTC

Possible bug in XPath implementation

Hello,

I'm working on a project at my university. In this project
we build a GUI to construct simple XSL transformations.

In the XSLT instances we use _absolute_ XPath expressions
to match the templates we need. The XPath expression always
looks like this:
  /child::node()[2]/child::node()[3]

Say, we have the document element at position 2, so we can
match it by typing /child::node()[2] but if we try to match
another node at position 2 under the document element (it's
the default I think) Xalan produces an Java error message.

So, if we try to match 
  /child::node()[2]/child::node()[3]/child::node()[2]
Xalan gets into trouble and quits with an error message.

Every template match except of position 2 works fine.

Here is the error message:
========= Parsing file:/home/tim/Eigene
Dateien/Diplom/Source/ixx/example/testgen.xsl ==========
Parse of file:/home/tim/Eigene
Dateien/Diplom/Source/ixx/example/testgen.xsl took 2103 milliseconds
========= Parsing test2.xml ==========
Parse of test2.xml took 6930 milliseconds
=============================
Transforming...
java.lang.NullPointerException:
	at
org.apache.xalan.xpath.SimpleNodeLocator.findChildren(SimpleNodeLocator.java:716)
	at
org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java:403)
	at
org.apache.xalan.xpath.SimpleNodeLocator.stepPattern(SimpleNodeLocator.java:1627)
	at
org.apache.xalan.xpath.SimpleNodeLocator.stepPattern(SimpleNodeLocator.java:1491)
	at
org.apache.xalan.xpath.SimpleNodeLocator.locationPathPattern(SimpleNodeLocator.java:1467)
	at org.apache.xalan.xpath.XPath.getMatchScore(XPath.java:348)
	at
org.apache.xalan.xslt.TemplateList.findTemplate(TemplateList.java:304)
	at org.apache.xalan.xslt.Stylesheet.findTemplate(Stylesheet.java:1033)
	at
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement.java:1138)
	at
org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemplateElement.java:957)
	at
org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)
	at
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java:659)
	at org.apache.xalan.xslt.ElemTemplate.execute(ElemTemplate.java:145)
	at
org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java:440)
	at org.apache.xalan.xslt.Process.main(Process.java:507)

Any idea? Any workaround or solution appreciated. 

Best regards
Brian
-- 
+--------------------------------------------------------+
| Brian Hüttner                   University of Bremen   |
| tim@informatik.uni-bremen.de    FB3 - Computer Science |
+--------------------------------------------------------+