Attempting to restrict VXML schema

Having trouble installing Oxygen? Got a bug to report? Post it all here.
mjlee@mindless.com

Attempting to restrict VXML schema

Post by mjlee@mindless.com »

Hi,

I am currently evaluating oxygen to become our platform for editing/generating VXML files. At the moment, we only support a subset of VXML, so want to redefine portions of the published vxml.xsd schema.

All my attempts to redefine the vxml element have been rejected by oxygen. I'm probably doing it wrong, but maybe it's a problem with oxygen? Basically, I want to restrict the allowed "top level" elements to <form> and <menu>. Here's my attempt:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.w3.org/2001/vxml"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:redefine schemaLocation="http://www.w3.org/TR/voicexml20/vxml.xsd">
<xsd:complexType name="vxml">
<xsd:complexContent>
<xsd:restriction base="vxml">
<xsd:element ref="form"/>
<xsd:element ref="menu"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:redefine>
</xsd:schema>


The errors oxygen gives are:

E src-redefine.5.b.d: 'restriction' does not have a 'base' attribute that refers to the redefined element, 'http://www.w3.org/2001/vxml,vxml'. <complexType> children of <redefine> elements must have <extension> or <restriction> descendants, with 'base' attributes that refer to themselves.

and

E src-resolve.4.1: Error resolving component 'vxml'. It was detected that 'vxml' has no namespace, but components with no target namespace are not referenceable from schema document 'http://192.168.168.200/vxml/symvxml.xsd'. If 'vxml' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that 'vxml' has no namespace, then an 'import' without a "namespace" attribute should be added to 'http://192.168.168.200/vxml/symvxml.xsd'.


Am I doing something wrong?

Thanks,
Matt
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Matt,

Both errros refer to the fact that the vxml value specified as the value of the xsd:restriction/@base attribute is from no namespace, while there it is expected to be from the http://www.w3.org/2001/vxml namespace, and more, as the type redefined is called vxml it should be in fact a reference to the vxml complex type definition from the http://www.w3.org/TR/voicexml20/vxml.xsd schema.

So correcting this by setting the default namespace to point to the http://www.w3.org/2001/vxml namespace:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.w3.org/2001/vxml" xmlns="http://www.w3.org/2001/vxml"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:redefine schemaLocation="http://www.w3.org/TR/voicexml20/vxml.xsd">
<xsd:complexType name="vxml">
<xsd:complexContent>
<xsd:restriction base="vxml">
<xsd:element ref="form"/>
<xsd:element ref="menu"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:redefine>
</xsd:schema>
will remove the errors you reported BUT will also give you an error. The reson for the last error is that there is no vxml complex type declaration in the http://www.w3.org/TR/voicexml20/vxml.xsd schema. The vxml element is specified using an anonymous type therefore you cannot redefine the vxml element type:

Code: Select all


<xsd:element name="vxml">
<xsd:complexType> <!-- this is the anonymous type for the vxml element -->
...
</xsd:complexType>
</xsd:element>
Hope that clarifies things for you.

Best Regards,
George
leematthew
Posts: 3
Joined: Sun May 30, 2004 7:43 am

Post by leematthew »

George,

Thanks a lot for your assistance!

If I understand your reply correctly, W3C have made it impossible to redefine portions of the VXML Schema?

Thanks again,
Matt
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Matt,

No, only that you cannot redefine vxml as it is an element and not a complex type. You can refefine the complex and simple types, the groups and the attribute groups. So look for these constrcuts in the VXML schema and you will find what can be redefined.

For instance the following schema redefines the executable.content group allowing only two elements, log and return:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.w3.org/2001/vxml"
xmlns="http://www.w3.org/2001/vxml"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:vxml="http://www.w3.org/2001/vxml">
<xsd:redefine schemaLocation="http://www.w3.org/TR/voicexml20/vxml.xsd">
<xsd:group name="executable.content">
<xsd:choice>
<xsd:element ref="log"/>
<xsd:element ref="return"/>
</xsd:choice>
</xsd:group>
</xsd:redefine>
</xsd:schema>
The executable.content group is used for instance in the definition of the block element:

Code: Select all


<xsd:element name="block">
<xsd:complexType mixed="true">
<xsd:group ref="executable.content" minOccurs="0" maxOccurs="unbounded"/>
<xsd:attributeGroup ref="Form-item.attribs"/>
</xsd:complexType>
</xsd:element>
Thus the block element will contain only log an return.

If you look at the vxml element

Code: Select all


<xsd:element name="vxml">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:group ref="event.handler"/>
<xsd:element ref="form"/>
<xsd:element ref="link"/>
<xsd:element ref="menu"/>
<xsd:element ref="meta"/>
<xsd:element ref="metadata"/>
<xsd:element ref="property"/>
<xsd:element ref="script"/>
<xsd:element ref="var"/>
</xsd:choice>
<xsd:attribute name="application" type="URI.datatype"/>
<xsd:attribute ref="xml:base"/>
<xsd:attribute ref="xml:lang"/>
<xsd:attribute name="version" type="xsd:string" use="required"/>
</xsd:complexType>
you can see that the only thing that can be redefined in order to change the content of vxml is the event.handler group:

Code: Select all


<xsd:group name="event.handler">
<xsd:choice>
<xsd:element ref="catch"/>
<xsd:element ref="help"/>
<xsd:element ref="noinput"/>
<xsd:element ref="nomatch"/>
<xsd:element ref="error"/>
</xsd:choice>
</xsd:group>
If you decide to redefine the event.handler group you should check also all the places where this group is referenced to see if your changes make sense also there.

Best Regards,
George
leematthew
Posts: 3
Joined: Sun May 30, 2004 7:43 am

Post by leematthew »

OK, I understand. Thanks again for you help.

Regards,
Matt
Post Reply