Built-in schemas

Gosu includes several XSDs in the gw.xsd.* package. The following table lists the built-in XSDs.

Description of the XSD                                                                                        

Fully qualified XSD package name

The SOAP XSD

gw.xsd.w3c.soap

SOAP envelope XSD

gw.xsd.w3c.soap_envelope

WSDL XSD

gw.xsd.w3c.wsdl

XLink XSD for linking constructs

gw.xsd.w3c.xlink

The XML XSD that defines the attributes beginning with the xml: prefix, such as xml:lang

gw.xsd.w3c.xml

The XML Schema XSD, which is the XSD that defines the format of an XSD

gw.xsd.w3c.xmlschema.Schema

See also

The metaschema XSD that defines an XSD

The definition of an XSD is itself an XML file. The XML Schema XSD is the XSD that defines the XSD format. The XML Schema XSD is also known as the metaschema. This schema is in the Gosu package gw.xsd.w3c.xmlschema. You can use the metaschema for building or parsing schemas.

Example

The following code parses the metaschema.

var schema = new gw.xsd.w3c.xmlschema.Schema()
schema.Element[0].Name = "Element1"
schema.Element[0].ComplexType.Sequence.Element[0].Name = "Child"
schema.Element[0].ComplexType.Sequence.Element[0].Type = new javax.xml.namespace.QName( "Type1" )
schema.ComplexType[0].Name = "Type1"
schema.print()

This code prints the following:

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="Element1">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Child" type="Type1"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:complexType name="Type1"/>
</xsd:schema>

Gosu does not provide a way to inject a schema into the type system at run time.