You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by cu...@apache.org on 2001/01/25 21:15:12 UTC
cvs commit: xml-xalan/test/tests/api/trax/systemid/impincl EmbeddedRelative.xsl
curcuru 01/01/25 12:15:11
Added: test/tests/api/impincl EmbeddedRelative.xsl
test/tests/api/trax EmbeddedFragment.xml EmbeddedImpIncl.xml
EmbeddedImpIncl.xsl EmbeddedMediaTitle.xml
EmbeddedRelative.xml
EmbeddedType-application-xml-xslt.xml
EmbeddedType-text-xml.xml EmbeddedType-text-xsl.xml
EmbeddedType.xsl
test/tests/api/trax/impincl EmbeddedRelative.xsl
test/tests/api/trax/systemid/impincl EmbeddedRelative.xsl
Log:
Embedded stylesheet tests for EmbeddedStylesheetTest
Revision Changes Path
1.1 xml-xalan/test/tests/api/impincl/EmbeddedRelative.xsl
Index: EmbeddedRelative.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Filename: EmbeddedRelative.xsl -->
<xsl:template match="/list">
<embedded-relative-level0>
<xsl:apply-templates select="@*|node()"/>
</embedded-relative-level0>
</xsl:template>
<xsl:template match="item">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/api/trax/EmbeddedFragment.xml
Index: EmbeddedFragment.xml
===================================================================
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="#style1"?>
<!DOCTYPE doc [
<!ELEMENT doc (#PCDATA | head | body)*>
<!ELEMENT head (#PCDATA | xsl:stylesheet)*>
<!ELEMENT body (#PCDATA|para)*>
<!ELEMENT xsl:stylesheet (#PCDATA | xsl:key | xsl:template)*>
<!ATTLIST xsl:stylesheet
id ID #REQUIRED
xmlns:xsl CDATA #FIXED "http://www.w3.org/1999/XSL/Transform"
version NMTOKEN #REQUIRED>
<!ELEMENT xsl:key EMPTY>
<!ATTLIST xsl:key
name NMTOKENS #REQUIRED
match CDATA #REQUIRED
use CDATA #REQUIRED>
<!ELEMENT xsl:template (#PCDATA | out)*>
<!ATTLIST xsl:template match CDATA #IMPLIED>
<!ELEMENT out (#PCDATA | xsl:value-of | xsl:text)*>
<!ELEMENT xsl:value-of EMPTY>
<!ATTLIST xsl:value-of select CDATA #REQUIRED>
<!ELEMENT xsl:text (#PCDATA)>
<!ELEMENT para (#PCDATA)*>
<!ATTLIST para id ID #REQUIRED>
]>
<doc>
<head>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
id="style1">
<!-- FileName: EmbeddedFragment/embed01 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.7 Embedding Stylesheets. -->
<!-- Purpose: General test of embedded stylesheet using fragment identifier -->
<xsl:key name="test" match="para" use="@id"/>
<xsl:template match="/">
<out>
<xsl:value-of select="doc/body/para"/>
<xsl:value-of select="key('test','foey')"/><xsl:text> </xsl:text>
</out>
</xsl:template>
</xsl:stylesheet>
</head>
<body>
<para id="foo">
Hello
</para>
<para id="foey">
Goodbye
</para>
</body>
</doc>
1.1 xml-xalan/test/tests/api/trax/EmbeddedImpIncl.xml
Index: EmbeddedImpIncl.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xml" href="EmbeddedImpIncl.xsl"?>
<doc>
<list>
<item>Above Should be include-list then import-list</item>
<item>This is EmbeddedImpIncl.xml, used for setSystemId testing Note that different settings of systemIds will have different expected results!</item>
<item match-by="import">Should be matched-by-import</item>
<item match-by="include">Should be matched-by-include</item>
<item match-by="main">Should be matched-by-import-also</item>
<list>
<item>Should be matched-by-main</item>
<item>Should be matched-by-main</item>
</list>
</list>
</doc>
1.1 xml-xalan/test/tests/api/trax/EmbeddedImpIncl.xsl
Index: EmbeddedImpIncl.xsl
===================================================================
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- FileName: EmbeddedImpIncl.xsl -->
<!-- Author: shane_curcuru@lotus.com -->
<!-- Purpose: Basic import and include tests with differen systemId's. -->
<!-- This is EmbeddedImpIncl.xsl, used for setSystemId testing Note that different settings of systemIds will have different expected results! -->
<!-- We re-use the stylesheets from the SystemId test here -->
<xsl:import href="impincl/SystemIdImport.xsl"/>
<xsl:include href="impincl/SystemIdInclude.xsl"/>
<xsl:template match="doc">
<out>
<xsl:apply-templates/>
</out>
</xsl:template>
<xsl:template match="list" priority="-1">
<main-list>
<xsl:apply-templates/>
</main-list>
</xsl:template>
<xsl:template match="item[not(@match-by)]">
<matched-by-main>
<xsl:value-of select="." />
</matched-by-main>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/api/trax/EmbeddedMediaTitle.xml
Index: EmbeddedMediaTitle.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet media="foo/media" title="foo-title" type="text/xsl" href="impincl/EmbeddedRelative.xsl"?>
<?xml-stylesheet media="bar/media" title="bar-title" type="text/xml" href="../impincl/EmbeddedRelative.xsl"?>
<?xml-stylesheet media="alt/media" alternate="no" title="alt-title" type="application/xml+xslt" href="NotFoundAlternate.xsl"?>
<?xml-stylesheet media="alt/media" alternate="yes" title="alt-title" type="application/xml+xslt" href="systemid/impincl/EmbeddedRelative.xsl"?>
<list>
<item>Xalan-J 1.x</item>
<item>Xalan-J 2.x</item>
<item>Xalan-C 1.x</item>
<list>
<item>Xalan documentation</item>
<item>Xalan tests</item>
</list>
</list>
1.1 xml-xalan/test/tests/api/trax/EmbeddedRelative.xml
Index: EmbeddedRelative.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="impincl/EmbeddedRelative.xsl"?>
<list>
<item>Xalan-J 1.x</item>
<item>Xalan-J 2.x</item>
<item>Xalan-C 1.x</item>
<list>
<item>Xalan documentation</item>
<item>Xalan tests</item>
</list>
</list>
1.1 xml-xalan/test/tests/api/trax/EmbeddedType-application-xml-xslt.xml
Index: EmbeddedType-application-xml-xslt.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="not/valid" href="file-not-found.xsl"?>
<?xml-stylesheet type="application/xml+xslt" href="EmbeddedType.xsl"?>
<list>
<item>Xalan-J 1.x</item>
<item>Xalan-J 2.x</item>
<item>Xalan-C 1.x</item>
<list>
<item>Xalan documentation</item>
<item>Xalan tests</item>
</list>
</list>
1.1 xml-xalan/test/tests/api/trax/EmbeddedType-text-xml.xml
Index: EmbeddedType-text-xml.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="not/valid" href="file-not-found.xsl"?>
<?xml-stylesheet type="text/xml" href="EmbeddedType.xsl"?>
<list>
<item>Xalan-J 1.x</item>
<item>Xalan-J 2.x</item>
<item>Xalan-C 1.x</item>
<list>
<item>Xalan documentation</item>
<item>Xalan tests</item>
</list>
</list>
1.1 xml-xalan/test/tests/api/trax/EmbeddedType-text-xsl.xml
Index: EmbeddedType-text-xsl.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="not/valid" href="file-not-found.xsl"?>
<?xml-stylesheet type="text/xsl" href="EmbeddedType.xsl"?>
<list>
<item>Xalan-J 1.x</item>
<item>Xalan-J 2.x</item>
<item>Xalan-C 1.x</item>
<list>
<item>Xalan documentation</item>
<item>Xalan tests</item>
</list>
</list>
1.1 xml-xalan/test/tests/api/trax/EmbeddedType.xsl
Index: EmbeddedType.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Filename: EmbeddedType.xsl -->
<!-- Explicitly only matches on /list so we don't get top-level PI's -->
<xsl:template match="/list">
<embedded-type>
<xsl:apply-templates select="item"/>
</embedded-type>
</xsl:template>
<xsl:template match="item">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/api/trax/impincl/EmbeddedRelative.xsl
Index: EmbeddedRelative.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Filename: EmbeddedRelative.xsl -->
<xsl:template match="/list">
<embedded-relative-level1>
<xsl:apply-templates select="@*|node()"/>
</embedded-relative-level1>
</xsl:template>
<xsl:template match="item">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/api/trax/systemid/impincl/EmbeddedRelative.xsl
Index: EmbeddedRelative.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Filename: EmbeddedRelative.xsl -->
<xsl:template match="/list">
<embedded-relative-level2>
<xsl:apply-templates select="@*|node()"/>
</embedded-relative-level2>
</xsl:template>
<xsl:template match="item">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>