Hello!

I don't understand the conept of the XPath class in dom4j. To find an
xpath with namespaces like

"SOAP-ENV:Envelope/SOAP-ENV:Header/ns1:services"

I need to build an XPath object and add a map of namespaces with prefix
and uri to it.

so I add in the example above

SOAP-ENV - http://schemas.xmlsoap.org/soap/envelope/
ns1 - http://schemas.biztalk.org/btf-2-0/endpoints

Than I will find the node if I execute the XPath.

This is okay! But in an XML document there could be different namespaces
with the same prefix in different branches.

An Example:

|<?xml version="1.0"?>
<!-- initially, the default namespace is "books" -->
<book xmlns='urn:loc.gov:books'
      xmlns:isbn='urn:ISBN:0-395-36341-6'>
    <title>Cheaper by the Dozen</title>
    <isbn:number>1568491379</isbn:number>
    <notes>
      <!-- make HTML the default namespace for some commentary -->
      <p xmlns='urn:w3-org-ns:HTML'>
          This is a <i>funny</i> book!
      </p>
    </notes>
</book>

||There are two default namespaces. I could not use an dom4j XPath to
find a node here, because I could not add two times the same prefix
(entry will be overwritten in map). (It is the same if this is not a
default namespace, but has a prefix.)
|||
What is the concept to handle such documents?

-- 
Viele Grüße / best regards

Marc Pellmann - System Architect
_______________________________
inubit - integrating your business and IT
inubit AG
Lützowstraße 105-106
D-10785 Berlin
Fon: +49.30. 72 61 12-132
Fax: +49.30. 72 61 12-100
Freecall: 0800-go inubit
Web: www.inubit.com



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to