You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "Kuketayev, Argyn (Contractor)" <ar...@fanniemae.com> on 2005/09/30 16:31:28 UTC
How to get element name from xmlbeans type objects?
Suppose, I have this in xml:
<Parent>
<child>bla-bla</child>
</Parent>
In the schema there's:
<xs:element name="Parent" type="ParentType"/>
<xs:complexType name="ParentType">
<xs:sequence>
<xs:element ref="dependent"/>
</xs:sequence>
</xs:complexType>
<xs:element name="dependent" type="dependentType"/>
<xs:complexType name="dependentType">
... Bla-bla...
</xs:complexType>
<xs:element name="son" type="childType"
substitutionGroup="dependent"/>
<xs:element name="daughter" type="childType"
substitutionGroup="child"/>
<xs:complexType name="childType">
<xs:complexContent>
<xs:extension base="dependentType">
... Bla-bla...
</xs:extension>
</xs:complexContent>
</xs:complexType>
Now, in my Java code, one component gets a reference of "son" element:
ParentType pt =...
DependentType dt = pt.getDependentType();
If I pass the reference of dt to another component, how would this
component find out that dt is actually "son" or "daughter"? I need to
know dt's element name.
Thanks
argyn
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org