RELAX2DTD for XSLT


Abstract

RELAX2DTD converts RELAX module into DTD schema. XSLT stylesheet version is available.

Distribution

RELAX2DTD.lzh (compressed RELAX2DTD.xsl)

Example

RELAX module = source tree

  <module
      moduleVersion="1.2"
      relaxCoreVersion="1.0"
      targetNamespace=""
      xmlns="http://www.xml.gr.jp/2000/relaxCore">

    <interface>
      <export labels="doc"/>
    </interface>

    <hedgeRule label="doc.body">
      <ref label="para" occurs="*"/>
    </hedgeRule>

    <elementRule pred="doc">
      <sequence>
        <ref label="title"/>
        <ref label="doc.body"/>
      </sequence>
    </elementRule>
  
    <elementRule pred="para">
      <mixed>
        <ref label="em" occurs="*"/>
      </mixed>
    </elementRule>
  
    <elementRule pred="title">
      <mixed>
        <ref label="em" occurs="*"/>
      </mixed>
    </elementRule>

    <elementRule pred="em" type="string"/>
  
    <tag name="doc"/>

    <tag name="para">
      <attribute name="role" type="NMTOKEN"/>
    </tag>
  
    <tag name="title">
      <attribute name="role" type="NMTOKEN"/>
      <attribute name="number" required="true" type="integer"/>  
    </tag>

    <tag name="em"/>

  </module>

DTD schema = result tree

  <!--

  genarated by RELAX2DTD
  moduleVersion : 1.2
  relaxCoreVersion : 1.0

  document type declaration Example:
  <!DOCTYPE doc SYSTEM "" >

  -->

  <!ENTITY % doc.body "para*" >
  <!ELEMENT doc (title,%doc.body; ) >
  <!ELEMENT para (#PCDATA | em)* >
  <!ELEMENT title (#PCDATA | em)* >
  <!ELEMENT em (#PCDATA) >

  <!ATTLIST para role NMTOKEN IMPLIED >
  <!ATTLIST title role NMTOKEN IMPLIED number NMTOKEN REQUIRED >  

Limitations

The degree of converting on this version is HOW TO RELAX STEP2.

Requirment

XSLT processor (e.g. XT)


copyright (c) 2000 by Yonekura Koji. All rights reserved.