thank you for your reply Radu. I found this link on xmlbeans site:
http://xmlbeans.apache.org/docs/2.0.0/guide/conHandlingAny.html that
talks about 4 ways of acheiving what i want.
 
1- XmlCursor
2- selectPath
3-selectChildren
4-DOM
 
I don't wanna use DOM API. XmlCursor approach seems too complicated. Now
you suggested selectChildren approach. any reason you prefer this
approach over the others? is it maintainable? my main concern is
maintainability of the code which is why i am using xmlbeans in the
first place.
 
again, thanks for the reply. i was afraid that nobody uses this mailing
list :)
 

Shahzad Qureshi 
Systems Analyst/Programmer 
CIOB 
Environment Canada 
[EMAIL PROTECTED] 

 

________________________________

From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 06, 2008 8:44 PM
To: [email protected]
Subject: RE: Nested namespaces


What getters are generated depends on the Schema definition of the type
of the <om:result> element. If that type is not defined to contain a
<dms:name> child, then you need to use the generic
XmlObject.selectChildren(new QName("http://dms.ec.gc.ca/schema","name";))
to get the values you want. Have you tried that?
 
Radu



________________________________

        From: Qureshi,Shahzad [Ontario]
[mailto:[EMAIL PROTECTED] 
        Sent: Thursday, November 06, 2008 10:54 AM
        To: [email protected]
        Subject: Nested namespaces
        
        

        Hi All, 

        I am very new to xmlbeans. I am using xmlbean 2.4.0. 

        I am use xmlbean fairly well on simple xml files but now I've to
deal with an xml with multiple namespaces. Here is an example

        <om:ObservationCollection
xmlns:om="http://www.opengis.net/om/1.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:dms="http://dms.ec.gc.ca/schema";

            xsi:schemaLocation="http://dms.ec.gc.ca/schema 
            dms-quality_controlled-ncawos-1_1-english.xsd"> 

                <om:member> 
                        <om:Observation> 
                                <om:result> 
                                        <dms:name>Shahzad</dms:name> 
                                </om:result> 
                        </om:Observation> 
                </om:member> 
        </om:ObservationCollection> 

        For the life of me, I can't figure out how to acess the
<dms:name> element in the above xml. 

        I don't see a get method for dms:name element. I've searched on
this mail list but didn't see anything that made sense to me. Any help?

        I do the following: 

        ObservationCollectionDocument a =
ObservationCollectionDocument.parse(f); 
        ObservationCollectionType b = a.getObservationCollection(); 
        ObservationPropertyType[] c = b.getMemberArray(); 
        For (ObservationPropertyType obs:c) { 
                ObservationType obsType = obs.getObservation(); 
                //now what do I do? 
                //I expected that I could do something like
obsType.getResult() or something like that but 
                //I can't. 
        } 

        Any help will be appreciated. I don't wanna have to use xerces
to parse my xml since I am already using xmlbean to parse other xml
files in the project. 


        thanks 

        Shahzad Qureshi 

Reply via email to