Hi,
I am trying to create XML schema of custom markup language, enriched
by XHTML. In simplified version, the XML documet could look like that:
<a:alarm-manual
xmlns:a="alarm-manual"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="alarm-manual alarm-manual.xsd"
<h:p>Text ... <a:par-value name="myName"/... text </h:p>
</a:alarm-manual>
In full version, the root element and document structure elements are
from custom namespace, the "formating" elements are from xhtml
namespace, and there are also some inline elements from custom
namespace.
I've tried to create XML Schema based on http://www.w3.org/TR/xhtml-modularization
, however I do not know whether it is correctly done. I have created
two new xsd files:
XML Schema driver: amml.xsd
and custom module definition: amml-module.xsd
(both files see below, of course other XHTML schema files must be
added)
Can someone with better knowledge of XML Schema and/or XHTML
modularization comment it?
Thanks a lot, regards, Martin
<!-- amml.xsd -->
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace ="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:amml="ala rm-manual"
blockDefault="# all">
<xs:annotatio n>
<xs:documentati on>
This is the XML Schema driver for AMML
</xs:documentatio n>
</xs:annotation>
<xs:import
namespace="http ://www.w3.org/XML/1998/namespace"
schemaLocation= "http://www.w3.org/2001/xml.xsd">
<xs:annotatio n>
<xs:documentati on>
This import brings in the XML namespace attributes
The XML attributes are used by various modules.
</xs:documentatio n>
</xs:annotation>
</xs:import>
<!--
<xs:include
schemaLocation= "xhtml11.xs d">
<xs:annotatio n>
<xs:documentati on>
Schema that includes original driver for XHTML 1.1
</xs:documentatio n>
</xs:annotation>
</xs:include>
-->
<xs:redefine
schemaLocation= "xhtml11.xs d">
<xs:annotatio n>
<xs:documentati on>
Changes in XHTML 1.1 due to AML
</xs:documentatio n>
</xs:annotation>
<xs:group name="xhtml.Inl ine.extra">
<xs:choice>
<xs:group ref="xhtml.Inli ne.extra"/>
<xs:group ref="amml:amml. par-value.export"/>
</xs:choice>
</xs:group>
</xs:redefine>
<xs:import
namespace="alar m-manual"
schemaLocation= "amml-module.xsd">
<xs:annotatio n>
<xs:documentati on>
Document Model module for the AMML
This schema file defines all named models used by AMML
</xs:documentatio n>
</xs:annotation>
</xs:import>
</xs:schema>
<!-- amml-module.xsd -->
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefa ult="qualified"
targetNamespace ="alarm-manual"
xmlns="alarm-manual"
xmlns:html="htt p://www.w3.org/1999/xhtml"
<xs:annotatio n>
<xs:documentati on>
This module defines all elements and attributes of private Alarm
Manual ML.
</xs:documentatio n>
</xs:annotation>
<!-- alarm-manual element-->
<xs:attributeGr oup name="amml.alar m-manual.attlist" >
<xs:attribute name="name" type="xs:string "/>
</xs:attributeGro up>
<xs:group name="amml.alar m-manual.content" >
<xs:annotatio n>
<xs:documentati on>
The root element of AMML.
</xs:documentatio n>
</xs:annotation>
<xs:sequence>
<xs:group maxOccurs="unbo unded" minOccurs="0"
ref="html:xhtml .Flow.mix"/>
</xs:sequence>
</xs:group>
<xs:complexTy pe name="amml.alar m-manual.type">
<xs:group ref="amml.alarm-manual.content"/>
<xs:attributeGr oup ref="amml.alarm-manual.attlist"/>
</xs:complexType>
<!-- par-value element-->
<xs:attributeGr oup name="amml.par-value.attlist">
<xs:attribute name="name" type="xs:string "/>
</xs:attributeGro up>
<xs:group name="amml.par-value.content">
<xs:sequence/>
</xs:group>
<xs:complexTy pe name="amml.par-value.type">
<xs:group ref="amml.par-value.content"/>
<xs:attributeGr oup ref="amml.par-value.attlist"/>
</xs:complexType>
</xs:schema>
I am trying to create XML schema of custom markup language, enriched
by XHTML. In simplified version, the XML documet could look like that:
<a:alarm-manual
xmlns:a="alarm-manual"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="alarm-manual alarm-manual.xsd"
>
</a:alarm-manual>
In full version, the root element and document structure elements are
from custom namespace, the "formating" elements are from xhtml
namespace, and there are also some inline elements from custom
namespace.
I've tried to create XML Schema based on http://www.w3.org/TR/xhtml-modularization
, however I do not know whether it is correctly done. I have created
two new xsd files:
XML Schema driver: amml.xsd
and custom module definition: amml-module.xsd
(both files see below, of course other XHTML schema files must be
added)
Can someone with better knowledge of XML Schema and/or XHTML
modularization comment it?
Thanks a lot, regards, Martin
<!-- amml.xsd -->
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace ="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:amml="ala rm-manual"
blockDefault="# all">
<xs:annotatio n>
<xs:documentati on>
This is the XML Schema driver for AMML
</xs:documentatio n>
</xs:annotation>
<xs:import
namespace="http ://www.w3.org/XML/1998/namespace"
schemaLocation= "http://www.w3.org/2001/xml.xsd">
<xs:annotatio n>
<xs:documentati on>
This import brings in the XML namespace attributes
The XML attributes are used by various modules.
</xs:documentatio n>
</xs:annotation>
</xs:import>
<!--
<xs:include
schemaLocation= "xhtml11.xs d">
<xs:annotatio n>
<xs:documentati on>
Schema that includes original driver for XHTML 1.1
</xs:documentatio n>
</xs:annotation>
</xs:include>
-->
<xs:redefine
schemaLocation= "xhtml11.xs d">
<xs:annotatio n>
<xs:documentati on>
Changes in XHTML 1.1 due to AML
</xs:documentatio n>
</xs:annotation>
<xs:group name="xhtml.Inl ine.extra">
<xs:choice>
<xs:group ref="xhtml.Inli ne.extra"/>
<xs:group ref="amml:amml. par-value.export"/>
</xs:choice>
</xs:group>
</xs:redefine>
<xs:import
namespace="alar m-manual"
schemaLocation= "amml-module.xsd">
<xs:annotatio n>
<xs:documentati on>
Document Model module for the AMML
This schema file defines all named models used by AMML
</xs:documentatio n>
</xs:annotation>
</xs:import>
</xs:schema>
<!-- amml-module.xsd -->
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefa ult="qualified"
targetNamespace ="alarm-manual"
xmlns="alarm-manual"
xmlns:html="htt p://www.w3.org/1999/xhtml"
>
<xs:documentati on>
This module defines all elements and attributes of private Alarm
Manual ML.
</xs:documentatio n>
</xs:annotation>
<!-- alarm-manual element-->
<xs:attributeGr oup name="amml.alar m-manual.attlist" >
<xs:attribute name="name" type="xs:string "/>
</xs:attributeGro up>
<xs:group name="amml.alar m-manual.content" >
<xs:annotatio n>
<xs:documentati on>
The root element of AMML.
</xs:documentatio n>
</xs:annotation>
<xs:sequence>
<xs:group maxOccurs="unbo unded" minOccurs="0"
ref="html:xhtml .Flow.mix"/>
</xs:sequence>
</xs:group>
<xs:complexTy pe name="amml.alar m-manual.type">
<xs:group ref="amml.alarm-manual.content"/>
<xs:attributeGr oup ref="amml.alarm-manual.attlist"/>
</xs:complexType>
<!-- par-value element-->
<xs:attributeGr oup name="amml.par-value.attlist">
<xs:attribute name="name" type="xs:string "/>
</xs:attributeGro up>
<xs:group name="amml.par-value.content">
<xs:sequence/>
</xs:group>
<xs:complexTy pe name="amml.par-value.type">
<xs:group ref="amml.par-value.content"/>
<xs:attributeGr oup ref="amml.par-value.attlist"/>
</xs:complexType>
</xs:schema>