added some precedence tests

This commit is contained in:
jez 2008-08-05 20:35:28 +01:00
parent 2667963142
commit 72e8decc76
9 changed files with 67 additions and 3 deletions

View file

@ -78,11 +78,11 @@ public:
for(boost::ptr_vector<TopLevelParam>::const_iterator pi = params_.begin(), pe = params_.end(); pi != pe; ++pi)
pi->declare(context);
for(ItemStack::const_iterator isi = items_.begin(), ise = items_.end(); isi != ise; ++isi)
{
for(ItemList::const_iterator ci = isi->begin(), ce = isi->end(); ci != ce; ++ci)
{
(*ci)->execute(initialNode, context);
context.pushVariablePrecendence();
} // for ...
context.pushVariablePrecendence();
} // for ...
context.freezeTopLevel();
// go!

View file

@ -160,5 +160,23 @@
<input-file role="principal-stylesheet">VariableWithinVariable4.xsl</input-file>
</scenario>
</test-case>
<test-case id="variables05">
<file-path>variables</file-path>
<purpose>import precedence</purpose>
<scenario operation="standard">
<input-file role="principal-data">foo.xml</input-file>
<input-file role="principal-stylesheet">import_precedence.xsl</input-file>
<output-file role="principal">import_precedence_result.xml</output-file>
</scenario>
</test-case>
<test-case id="variables06">
<file-path>variables</file-path>
<purpose>import precedence</purpose>
<scenario operation="standard">
<input-file role="principal-data">foo.xml</input-file>
<input-file role="principal-stylesheet">import_precedence2.xsl</input-file>
<output-file role="principal">import_precedence2_result.xml</output-file>
</scenario>
</test-case>
</test-catalog>
</test-suite>

View file

@ -0,0 +1 @@
<e1>var(foo3)</e1>

View file

@ -0,0 +1 @@
<e1>var(foo)</e1>

View file

@ -0,0 +1 @@
<FOO/>

View file

@ -0,0 +1,14 @@
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:template match="/">
<xsl:element name="e1"><xsl:value-of select="$foo"/></xsl:element>
</xsl:template>
<xsl:variable name="foo" select="'var(foo)'"/>
<xsl:include href="import_precedence_a.xsl"/>
</xsl:stylesheet>

View file

@ -0,0 +1,13 @@
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:template match="/">
<xsl:element name="e1"><xsl:value-of select="$foo"/></xsl:element>
</xsl:template>
<xsl:include href="import_precedence_a.xsl"/>
</xsl:stylesheet>

View file

@ -0,0 +1,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:foo="urn:bang" xmlns="urn:foo">
<xsl:import href="import_precedence_b.xsl"/>
</xsl:stylesheet>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:foo="urn:bang">
<!-- xmlns="urn:foo"> -->
<xsl:variable name="foo" select="'var(foo3)'"/>
</xsl:stylesheet>