
<?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>
|
<?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>
|
<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>
|