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