XHTML Modularization: Creating XML schema for mixed custom tags andXHTML

Discussion in 'XML' started by mk189@seznam.cz, May 9, 2008.

  1. Guest

    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:schemaLocation="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="alarm-manual"
    blockDefault="#all">
    <xs:annotation>
    <xs:documentation>
    This is the XML Schema driver for AMML
    </xs:documentation>
    </xs:annotation>
    <xs:import
    namespace="http://www.w3.org/XML/1998/namespace"
    schemaLocation="http://www.w3.org/2001/xml.xsd">
    <xs:annotation>
    <xs:documentation>
    This import brings in the XML namespace attributes
    The XML attributes are used by various modules.
    </xs:documentation>
    </xs:annotation>
    </xs:import>
    <!--
    <xs:include
    schemaLocation="xhtml11.xsd">
    <xs:annotation>
    <xs:documentation>
    Schema that includes original driver for XHTML 1.1
    </xs:documentation>
    </xs:annotation>
    </xs:include>
    -->
    <xs:redefine
    schemaLocation="xhtml11.xsd">
    <xs:annotation>
    <xs:documentation>
    Changes in XHTML 1.1 due to AML
    </xs:documentation>
    </xs:annotation>
    <xs:group name="xhtml.Inline.extra">
    <xs:choice>
    <xs:group ref="xhtml.Inline.extra"/>
    <xs:group ref="amml:amml.par-value.export"/>
    </xs:choice>
    </xs:group>
    </xs:redefine>

    <xs:import
    namespace="alarm-manual"
    schemaLocation="amml-module.xsd">
    <xs:annotation>
    <xs:documentation>
    Document Model module for the AMML
    This schema file defines all named models used by AMML
    </xs:documentation>
    </xs:annotation>
    </xs:import>
    </xs:schema>

    <!-- amml-module.xsd -->
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="alarm-manual"
    xmlns="alarm-manual"
    xmlns:html="http://www.w3.org/1999/xhtml"
    >

    <xs:annotation>
    <xs:documentation>
    This module defines all elements and attributes of private Alarm
    Manual ML.
    </xs:documentation>
    </xs:annotation>

    <!-- alarm-manual element-->
    <xs:attributeGroup name="amml.alarm-manual.attlist">
    <xs:attribute name="name" type="xs:string"/>
    </xs:attributeGroup>
    <xs:group name="amml.alarm-manual.content">
    <xs:annotation>
    <xs:documentation>
    The root element of AMML.
    </xs:documentation>
    </xs:annotation>
    <xs:sequence>
    <xs:group maxOccurs="unbounded" minOccurs="0"
    ref="html:xhtml.Flow.mix"/>
    </xs:sequence>
    </xs:group>
    <xs:complexType name="amml.alarm-manual.type">
    <xs:group ref="amml.alarm-manual.content"/>
    <xs:attributeGroup ref="amml.alarm-manual.attlist"/>
    </xs:complexType>

    <!-- par-value element-->
    <xs:attributeGroup name="amml.par-value.attlist">
    <xs:attribute name="name" type="xs:string"/>
    </xs:attributeGroup>
    <xs:group name="amml.par-value.content">
    <xs:sequence/>
    </xs:group>
    <xs:complexType name="amml.par-value.type">
    <xs:group ref="amml.par-value.content"/>
    <xs:attributeGroup ref="amml.par-value.attlist"/>
    </xs:complexType>

    </xs:schema>
     
    , May 9, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,558
    Markus
    Nov 23, 2005
  2. Peter Rohleder

    Modularization using modularized xhtml

    Peter Rohleder, Feb 20, 2004, in forum: XML
    Replies:
    0
    Views:
    357
    Peter Rohleder
    Feb 20, 2004
  3. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,272
    Stanimir Stamenkov
    Apr 25, 2005
  4. Replies:
    3
    Views:
    2,877
  5. C.W.Holeman II
    Replies:
    0
    Views:
    465
    C.W.Holeman II
    Apr 8, 2007
Loading...

Share This Page