Hi Andreas,

I had a problem with this using dom4j. To get over the problem, I had to create a w3c dom document and then pass this one into dom4j. It works fine then.

e.g.
InputStream is = CabCfg.class.getClassLoader().getResourceAsStream("sampleMessages/requestApptCanc.xml");
 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
 dbf.setNamespaceAware(false);

 // Step 2: create a DocumentBuilder
 DocumentBuilder db = dbf.newDocumentBuilder();

 // Step 3: parse the input file to get a Document object
 org.w3c.dom.Document w3cdoc = db.parse(is);

 // Pass the w3c document to dom4j so that it will work with namespaces
 Document doc = new DOMReader().read(w3cdoc);

Hope it helps!

Regards,
   Barbara


Barbara Worwood
Irish Medical Systems
Clara House
Glenageary Park
Co Dublin
Ireland


Email: [EMAIL PROTECTED]
Web: http://www.imsmaxims.com


----- Original Message ----- From: "Andreas Andersson" <[EMAIL PROTECTED]>
To: <dom4j-user@lists.sourceforge.net>
Sent: Friday, August 12, 2005 10:22 AM
Subject: [dom4j-user] SelectSingleNode - namespace unspecific


Hi!

Is there any way to select nodes with xpaths and ignoring the namespace,
just like with the Element.element("") method?

Thanks.
--
Andreas Andersson
IT Dept.
Travelstart Nordic
[EMAIL PROTECTED]
http://www.travelstart.se


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to