Referenced attributes [message #599147] |
Thu, 23 November 2006 10:02 |
Alexander Koezle Messages: 13 Registered: July 2009 |
Junior Member |
|
|
Hi,
i have a little problem by retrieving of top-level attributes referenced
in <xsd:attribute/> by "ref".
E.g. we have the following schema:
<!-- top level attribute -->
<xsd:attribute name="attr1" type="xsd:string"/>
<!-- complex type that reference that attribute -->
<xsd:complexType name="complexType1">
<xsd:attribute ref="attr1"/>
</xsd:complexType>
<!-- complex type that extends defined above complex type -->
<xsd:complexType name="extComplexType1">
<xsd:complexContent>
<xsd:extension base="complexType1">
<xsd:attribute name="extAttr1" type="xsd:string" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
1. I can reach the attribute "attr1" on the complex type "complexType1" by
calling of XSDComplexTypeDefinition#getAttributeContents instead of
XSDComplexTypeDefinition#getAttributeUses
2. XSDComplexTypeDefinition#getAttributeContents on the extension
"extComplexType1" doesn't return the "attr1" in the list, so i should
check all my base types recursive to find all "ref"-attributes that i
missing.
So here is my first question - how can i distinguish those
"ref"-attributes from the "normal"? - it seems to be also the instance of
XSDAttributeUse in the list, returned by
XSDComplexTypeDefinition#getAttributeContents
And why don't return the "ref"-attributes in
XSDComplexTypeDefinition#getAttributeUses like by referencing of an
attribute group? What is the difference?
thanks and warm regards,
Alexander
|
|
|
Powered by
FUDForum. Page generated in 0.03535 seconds