RELAX verifier for XSLT

Version 20000406


Abstract

RELAX verifier for XSLT verify the RELAX instance.

a verifing mechanism


A”Ėsample.xml

  <?xml version="1.0"?>

  <!-- sample.rlx is a relax module file. -->
  <?xml-relax href="sample.rlx" type="text/xml"?>

  <foo x="a">
    <def>20</def>
    <abc>10</abc>
    <abc>10</abc>
  </foo>



B”Ėsample.xsl

  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">        


  <!-- relax.xsl is a relax verifier. -->
  <xsl:include href="relax.xsl"/>


  <!-- user's template rule -->
  <xsl:output method="html" encoding="UTF-16"/>

  <xsl:template match="foo">
    <h1><xsl:value-of select="@x"/></h1>
    <xsl:apply-templates select="*"/>
  </xsl:template>

  <xsl:template match="abc">
    <h2>abc : <xsl:value-of select="."/></h2>
  </xsl:template>

  <xsl:template match="def">
    <h2>def : <xsl:value-of select="."/></h2>
  </xsl:template>

  </xsl:stylesheet>


C”Ėsample.rlx

  <module                                                                  
  xmlns="http://www.xml.gr.jp/2000/relaxCore">

  <interface>
    <export label="foo"/>
  </interface>

  <elementRule role="foo">
    <mixed>
      <choice occurs="*">
        <ref label="abc"/>
        <ref label="def"/>
      </choice>
    </mixed>
  </elementRule>

  <tag name="foo">
    <attribute name="x" required="true" type="integer"/>
    <attribute name="y" type="integer"/>
  </tag>

  <elementRule role="abc" type="integer"/>
  <tag name="abc"/>

  <elementRule role="def" type="integer"/>
  <tag name="def"/>

  </module>


a verify error happen --> XSLT processor abort. ( <xsl:message terminate="yes"/> )

Distribution

relax.xsl

Limitations

the mixed element wraps a <choice occurs="*"> or a <ref> .
the datatypes
the enumeration mechanism
the include element

Requirment

XSLT processor (e.g. XT)

Reporting Bugs

Please report bugs to me.


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