xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Vasilik" <eric...@bea.com>
Subject RE: Problem using XmlCursor with xml document containing default namespace
Date Wed, 07 Jul 2004 18:05:06 GMT
XPath is not functional with documents using namespaces.  We're working on fixing this problem.

The toChild(String local) method will move the cursor to a child whose name has the requested
locale part and no namespace.  Whether you use the default namespace mechanism or not does
not influence this.  The name of the element after parsing is all that matters.

The option setLoadSubstituteNamespaces does not work the way you imply.  It does not affect
the default namespace per se.  You can use this option to substitute one namespace for another.
 If you put ( "", "foo" ) in the map, then all elements and attributes which have no namespace
will be in the foo namespace instead.  Putting ( "foo", "bar" ) in the map, then all elems/attrs
in the foo namespace will be in the bar namespace instead.  Note that here, foo and bar are
*not* prefixes, they are namespaces.  How the element/attr originally got its namespace (by
prefix or by default) does not matter when substituting namespaces.

- Eric

> -----Original Message-----
> From: Roger Gogniat [mailto:roger_gogniat@yahoo.com]
> Sent: Wednesday, July 07, 2004 3:35 AM
> To: xmlbeans-user@xml.apache.org
> Subject: Problem using XmlCursor with xml document containing default
> namespace
> 
> Hi,
> 
> I'am working with xmlbeans 1.0.2 with xmlbean_path.
> 
> I have problem using the method selectPath in XmlCursor; it doesn't select
> any node.
> But when I remove the default namespace definition in the xml document it
> is working.
> I know default namespace can make trouble with XPath so I have tried to
> use XmlOption by
> setting different options: setLoadSubstituteNamespaces,
> setLoadAdditionalNamespaces, and
> nothing seems to work.
> 
> So can you explain me how should I proceed?
> 
> I have also a similar problem with the toChild(String) method that doesn't
> move the
> cursor; is it also a default namespace problem?
> 
> With setLoadSubstituteNamespaces I am not sure about the form of map to
> set: if I want to
> substitute the default namespace by "def", should I use map.put("", "def")
> or map.put("",
> "http://www.lalala.com/lalala/XSD") or ...?
> 
> Thank you in advance for your precious help.
> 
> 
> 
> 
> 
> 
> 
> Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
> Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
> 
> Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez
> Yahoo! Messenger sur http://fr.messenger.yahoo.com
> 
> - ---------------------------------------------------------------------
> To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message