[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xpathapi question

Subject: xpathapi question
From: "Sanjay Pandey/Towers Perrin" <pandeys@xxxxxxxxxx>
Date: Thu, 11 Oct 2001 10:46:53 -0400
xpathapi
Hi List,

I have a Schema as follows
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://www.x.com/x" xmlns
="http://www.w3.org/2001/XMLSchema" xmlns:x="http://www.x.com/x"
elementFormDefault="qualified">
     <!-- XYZ Info -->
     <element name="XYZ" type="x:XYZ"/>
     <complexType name="XYZ">
          <sequence>
               <element name="x" type="string"/>
               <element name="y" type="double"/>
               <element name="y" type="date"/>
          </sequence>
     </complexType>
</schema>

I am reading this XSD using DocumentBuilderFactory
(javax.xml.parsers.DocumentBuilderFactory)

I have had no problem using XPathAPI Java function for various purposes on
XML data, but when I use XPathAPI on this XSD (Schema), I am not getting
any result back.

I want to get the "element" node with @name="x" ( and then I would go on to
get the "type" info ...) .
XObject obj = null;
String result = null;
            obj = XPathAPI.eval(rootNode,"//element[@name
= 'x']",rootNode);
            result = obj.toString();
            obj = XPathAPI.eval(rootNode,"//x:element[@name
= 'x']",rootNode);
            result = obj.toString();
            obj = XPathAPI.eval(rootNode,"//element[@name = 'x']");
            result = obj.toString();
            obj = XPathAPI.eval(rootNode,"//x:element[@name = 'x']");
            result = obj.toString();

I do not get anything from "result".

What am I missing? Some NameSpace kind of issue or what?

Thanks in advance,
Sanjay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.