is it possible to have a complex type with attribute pointing to another
member
of the complex type?
for example, I tried
<xsd:complexTyp e name="RegexType s" />
<xsd:sequence >
<xsd:element name="regexName " type="xsd:Name" />
<xsd:element ref="comment" />
</xsd:sequence>
<xsd:attribut e name="level" type="xsd:strin g" />
...
<xsd:attributeG roup ref="RegexTypes ">
<!-- error on next line's xsd:attribute, same for replacing with
element -->
<xsd:attribut e name="nextRegex Link" type="regexName " minOccurs="0"
maxOccurs="unbo unded" />
</xsd:attributeGr oup>
</xsd:complexType >
</xsd:complexType >
<xsd:element name="comment" type="xsd:strin g">
</xsd:element>
and I get:
Warning 2 The element 'attributeGroup ' in namespace
'http://www.w3.org/2001/XMLSchema' has invalid child element 'attribute' in
namespace 'http://www.w3.org/2001/XMLSchema'. List of possible elements
expected: 'annotation' in namespace 'http://www.w3.org/2001/XMLSchema'.
D:\data\Ieproj\ Util\RegexDotNe t\regex.xsd 34 8 Miscellaneous Files
Warning 1 The 'http://www.w3.org/2001/XMLSchema:attri bute' element is not
supported in this context. D:\data\Ieproj\ Util\RegexDotNe t\regex.xsd 34 8
Miscellaneous Files
I tried another approach that seem to be acceptable to ms visual studio but
not to NetBean IDE 5.5:
<xsd:group name="RegexColl ection">
<xsd:sequence >
<xsd:element name="favorite" type="xsd:strin g" />
..............
<xsd:element ref="comment" />
<xsd:element name="regexType " type="RegexType s" />
<xsd:element name="nextRegex Link" type="regexName " minOccurs="0"
maxOccurs="unbo unded" />
</xsd:sequence>
</xsd:group>
<xsd:complexTyp e name="RegexType s">
<xsd:sequence >
<xsd:element name="regexName " type="xsd:Name" />
<xsd:element ref="comment" />
</xsd:sequence>
.............
</xsd:complexType >
src-resolve: Cannot resolve the name 'regexName' to a(n) 'type definition'
component. [47]
XML validation finished.