I tried that, but still, I get the same error... thanks for your help.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 12, 2002 12:38 PM To: Malia Zaheer Subject: Re: problem using XPathAPI I think your xpath should start from xs:schema or use "//xs:element..." /xs:schema/xs:[EMAIL PROTECTED]'blah'] To: xalan-j-users <[EMAIL PROTECTED]> cc: Subject: problem using XPathAPI 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
