Hi Jeff,
In general, the only way to get at non-schema attributes that the schema
component model provides is via annotations. So, if you had
<attribute name="foo" fooNS:myAttr="something">
<annotation>
<documentation>
some text
</documentation
</annotation>
</attribute>
you could get fooNS:myAttr off of the annotation (Xerces provides various
ways to do this). But references to attributes (attribute uses as the
Schema specs call them) don't have annotation components, so there's
simply no way to get at these attributes in that context.
Is it really common for attributes from the WSDL namespace to be placed on
references to global attributes? If it is, perhaps someone should let the
Schema WG know (I believe that fixing this bug is on the todo list, but
have no more info than that.)
Cheers,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone: 905-413-3519, T/L 969-3519
E-mail: [EMAIL PROTECTED]
|---------+----------------------------->
| | "Jeff Greif" |
| | <[EMAIL PROTECTED]|
| | nceton.edu> |
| | |
| | 07/25/2003 10:01 |
| | PM |
| | Please respond to |
| | xerces-j-user |
| | |
|---------+----------------------------->
>---------------------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: <[EMAIL PROTECTED]>
|
| cc:
|
| Subject: exploring the innards of a WXS derived complex type
definition |
|
|
|
|
>---------------------------------------------------------------------------------------------------------------------------------------------|
Lots of Web Services using SOAP contain XML Schema type definitions like
this:
<xsd:complexType name="ResultElementArray">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType" wsdl:arrayType
="typens:ResultElement[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
(The base type is given below).
When a SOAP/WSDL processor reads this type, it can determine via special
knowledge (out of band as far as WXS is concerned) based on presence of the
soapenc:arrayType attribute and the wsdl:arrayType attribute value that an
element of type ResultElementArray may contain an unrestricted number of
child elements (with any name allowed -- see the base type) of type
ResultElement.
When an instance document is encountered, it might look like this
<return arrayType="ResultElement[3]" xsi:type="ResultElementArray">
<item xsi:type="ResultElement">...</item>
<item xsi:type="ResultElement">...</item>
<item xsi:type="ResultElement">...</item>
</return>
and the SOAP processor can determine from the arrayType value that there
will be three child elements of type ResultElement.
The question is, if I get the grammar containing this type and convert it
to an XSModel, how can I find the all-important wsdl:arrayType attribute
value, (and thus be able to emulate the SOAP/WSDL processor's knowledge of
the content, without having an instance document to look at)? Is this
information captured somewhere in the XSModel? Is it possible to examine
the contents of the restriction, rather than only determine the base type
and the derivation method?
Jeff
Note:
The base type, somewhat simplified, is from the SOAP-Encoding spec:
<xs:complexType name="Array" >
<xs:sequence>
<xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded"
processContents="lax" />
</xs:sequence>
<xs:attribute name="arrayType" type="xs:string" />
<xs:attribute name="arrayOffset" type="xs:string"/>
<xs:anyAttribute namespace="##other" processContents="lax" />
</xs:complexType>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]