Hi, I am trying to parse an XML File which has a single Name space . But when i try to get the Value of the Text Node i am getting an empty string.
My xml file looks like this : <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dsml="http://www.dsml.org/DSML"> <SOAP-ENV:Body> <dsml:dsml xmlns:dsml="http://www.dsml.org/DSML"> <dsml:directory-entries> <dsml:attr name="uid"> <dsml:value>213040902</dsml:value> </dsml:attr> <dsml:attr name="mail"> <dsml:value>[EMAIL PROTECTED]</dsml:value> </dsml:attr> <dsml:attr name="givenname"> <dsml:value>Kathryn</dsml:value> </dsml:attr> <dsml:attr name="sn"> <dsml:value>Bianchi</dsml:value> </dsml:attr> </dsml:directory-entries> </dsml:dsml> </SOAP-ENV:Body> </SOAP-ENV:Envelope> My requirement is fetching the value of the <dsml:value> element when the parent of this Node has an attribute called name whose value is "mail" or "uid" . Here i am enclosing the code which i wrote..pls help me.. Regards Sateesh -----Original Message----- From: Chris Cuilla [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2003 9:12 PM To: [EMAIL PROTECTED] Subject: multiple namespaces in a single document I am using Xerces 2.3.0 to parse a document that is validated by an XML Schema. My document looks like this: <jx:Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jx="http://www.jxbeans.org/JXBeans-1_0" xmlns:wz="http://www.jxbeans.org/JXModeler-1_0" xsi:schemaLocation="http://www.jxbeans.org/JXBeans-1_0 http://www.jxbeans.org/schema/JXBeans-1_0.xsd http://www.jxbeans.org/JXModeler-1_0 http://www.jxbeans.org/schema/JXModeler-1_0.xsd" > <jx:Bean jx:ID="a"> <!-- OTHER NAMESPACE ELEMENT HERE --> <wz:Location xmlns:wz="http://www.jxbeans.org/JXModeler-1_0" > <wz:X>1</wz:X> <wz:Y>1</wz:Y> </wz:Location> <!-- END OTHER NAMESPACE ELEMENT --> <jx:Class>org.jxbeans.SimpleDocumentGenerator</jx:Class> <jx:EventListener> <jx:Name>documentReady</jx:Name> <jx:Value>b</jx:Value> </jx:EventListener> </jx:Bean> <jx:Bean jx:ID="b" jx:IsFinal="true"> <jx:Class>org.jxbeans.serializer.Serializer</jx:Class> <jx:Property> <jx:Name>fileName</jx:Name> <jx:Value>tests/A.xml</jx:Value> </jx:Property> </jx:Bean> </jx:Model> I have set the following features: http://xml.org/sax/features/namespaces http://apache.org/xml/features/validation/schema Everything works fine if I do NOT include the "wz" elements. However, when I do, I get the following error: cvc-complex-type.2.4.a: Invalid content starting with element 'wz:Location'. The content must match '(("http://www.jxbeans.org/JXBeans-1_0":Class),("http:// www.jxbeans.org/JXBeans-1_0":EventListener){0-UNBOUNDED},("http:// www.jxbeans.org/JXBeans-1_0":Property){0-UNBOUNDED})'. What am I doing wrong here? Chris --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] "THIS E-MAIL MESSAGE ALONG WITH ANY ATTACHMENTS IS INTENDED ONLY FOR THE ADDRESSEE and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are notified that any dissemination, distribution or copy of this communication is strictly Prohibited. If you have received this message by error, please notify us immediately, return the original mail to the sender and delete the message from your system."
Query.xml
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]