Godmar

Godmar Back wrote:
Hi,

there are a number of formats out the (SRW, OAI-PMH, Atom, to name a
few) in which a schema describes an XML based container for
domain-specific objects. For instance, for the Atom syndication
format, it may be custom-defined XML content that's carried in a
<content> element inside an entry. In the case of SRW (a protocol used
in information retrieval systems, such as search engines), the
children of <recordData> contain XML that's specific to a particular
system.

To make this more concrete: The Atom schema says:

<xs:sequence>
       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>

whereas the SRW schema says:

<xsd:element name="recordData" type="stringOrXmlFragment" nillable="false"/>

where stringOrXmlFragment is defined similarly:

  <xsd:complexType name="stringOrXmlFragment" mixed="true">
    <xsd:sequence>
      <xsd:any namespace="##any" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
    </xsd:sequence>
  </xsd:complexType>

My question: is it possible to apply one or more schemata to the
elements that would show up in "xsd:any" and if so, can Castor
generate the code for this?
Not sure whether I understand your question fully. In theory, you can put any element of any name space (other than the target name space of the root schema) into a place that id declared <xs:any>. Those elements could come from any XML schema definition that is imported into the root XML schema. Actually, the last statement sort of depends whether upon whether you are validating against an XML schema at unmarshalling or not.

Given that I would like to know what your question really is about, let's see what your reply is.


Right now, Castor generates nodes of "AnyNode" type, ..
Yes, indeed.

... and it's extremely awkward to work with.
In what way, if I may ask. And given your opinion, what would you change ?

 - Godmar

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to