You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Mathias Laguérie <ml...@softeam.fr> on 2001/02/20 18:30:11 UTC
Xpath
I'm trying to use XPathAPI on an XML Schema.
this my code :
Document ddoc = doc.getSchema_doc();
NodeList elts = XPathAPI.selectNodeList(ddoc,"//test:element");
System.out.println(elts.item(0).getNodeName());
and this the XML Schema :
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2000/10/XMLSchema"
targetNamespace="http://ici.com/" xmlns:ici="http://ici.com/"
elementFormDefault="qualified">
<element name="coucou">
<annotation>
<documentation>Comment describing your root element</documentation>
</annotation>
</element>
</schema>
the code can not find the element : java.lang.NullPointerException
at ihmsaisie.TestIhmXSD.main(TestIhmXSD.java:39)
the Exception occurs when the JVM treat the last lign of my code.
Any body could help me.
Mathias