Hi,

I tried to use XPathAPI.selectNodeIterator method to get a NodeIterator but
I get an error that I don't understand:

org.apache.xpath.XPathException: Can not convert #BOOLEAN to a NodeList!
        at org.apache.xpath.objects.XObject.error(XObject.java:718)
        at org.apache.xpath.objects.XObject.nodeset(XObject.java:448)
        at org.apache.xpath.XPathAPI.selectNodeIterator(XPathAPI.java:175)
        at org.apache.xpath.XPathAPI.selectNodeIterator(XPathAPI.java:152)
        at MapXSLGenerator.generate(MapXSLGenerator.java:80)
        at Mapper.transform(Mapper.java:89)
        at test.main(test.java:27)

Here is the xml:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";> 
 
  <!-- definition of complex type elements -->
  <xs:element name="book">
    <xs:complexType>
      <xs:sequence>
          <xs:element name="title" type="xs:string"/>
          <xs:element name="author" type="xs:string"/>
          <xs:element name="character" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
        <xs:sequence>
                  <xs:element name="name" type="xs:string"/>
                  <xs:element name="friend-of" type="xs:string"
minOccurs="0"
maxOccurs="unbounded"/>             
        </xs:sequence>
            </xs:complexType>
          </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>

I am trying to get xs:elment name="book".

The code is:

NodeIterator nl = XPathAPI.selectNodeIterator(scRoot,
"xs:element/@name=\""+book +"\"");

Note that book is a String containing the value "book".

Please help.

thanks,
Malia


Reply via email to