Skip to content
Permalink
Browse files

Bug 20843, updated autogen xsl, now excl. xslt2 functions (1902), add…

…ed xslt rec xml

updated output format, added compare file, added indented version, minor updates on other autogen xsl
  • Loading branch information...
abelbraaksma
abelbraaksma committed Mar 31, 2015
1 parent fa1c47f commit 9c2c099a60681d49163b407208cc0b93cab49de7
@@ -1,6 +1,11 @@
<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<!--
IGNORE DOCTYPE, processors may try to load it and we don't need it
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
--><html lang="EN" xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN">
-->
<html lang="EN" xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN">
<head>
<meta name="generator" content=
"HTML Tidy for Windows (vers 14 February 2006), see www.w3.org" />
@@ -1,6 +1,10 @@
<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<!-- IGNORE DOCTYPE, processors may try to load it and we don't need it
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
--><!--XSLT Processor: SAXON 9.3.0.5 from Saxonica SAXON EE 9.3.0.5-->
-->

<!--XSLT Processor: SAXON 9.3.0.5 from Saxonica SAXON EE 9.3.0.5-->
<html lang="EN" xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN">
<head>
<meta name="generator" content=

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1123,12 +1123,13 @@
<test-case name="function-1902">
<description>
Test that all functions defined in the F+O 3.0 specification are NOT implemented in a 2.0 processor.
Note: update the source document from time to time with the latest draft spec</description>
Note: call function-2001-generate.xsl (without arguments) from time to time if the RECs are updated</description>
<created by="Michael Kay" on="2012-11-07"/>
<modified by="Tim Mills" on="2012-12-20" change="Removed whitespace"/>
<modified by="Michael Kay" on="2014-06-04" change="Update results for renamed functions; output only the discrepancies to make results comparison easier"/>
<modified by="Abel Braaksma" on="2014-10-16" change="Changed the auto-generation of this test, it is now dependent on actual XHTML spec, and updated the set of functions it tests"/>
<modified by="Michael Kay" on="2014-11-14" change="Changed test assertion to pass catalog-004"/>
<modified by="Abel Braaksma" on="2015-03-30" change="Bug 20843: Updated autogen xslt to exclude xslt20 functions, updated test to create more useful output, added output comparison file."/>
<environment ref="function-1902"/>
<dependencies>
<spec value="XSLT30+"/>
@@ -1137,7 +1138,7 @@
<stylesheet file="function-1902.xsl"/>
</test>
<result>
<assert>empty(/out/*)</assert>
<assert-xml file="function-1902.out" />
</result>
</test-case>

@@ -9,12 +9,13 @@
<!--
creates: function-1901.xml
generates a list of functions from the F&O 3.0 spec, for XSLT 3.0
Modified (2015-03-30, ABr) fixed path
-->

<xsl:mode on-no-match="shallow-skip" />
<xsl:output indent="true" />

<xsl:variable name="location">../../../../specs/functions-and-operators-rec30.xml</xsl:variable>
<xsl:variable name="location">../../../specs/functions-and-operators-rec30.xml</xsl:variable>

<xsl:template name="xsl:initial-template">
<xsl:result-document href="function-1901.xml">
@@ -7,16 +7,19 @@
version="3.0">

<!--
creates: function-1902.xml (list of functions of F&O 3.0 that are NOT in F&O 1.0
generates a list of functions of F&O 3.0 that are NOT in F&O 1.0 spec, for XSLT 2.0
TODO: this generator was updated and needs to be verified
creates: function-1902.xml (list of functions of F&O 3.0 that are NOT in F&O 2.0 or in XSLT 2.0
generates a list of functions of F&O 3.0 that are NOT in the F&O 2.0 spec, for XSLT 2.0-only processors, who should not recognize these functions
TODO: (ABr 2015-03-30) this generator was updated and needs to be verified (Bug 20843)
Modified (2015-03-30, ABr) fixed path, added XSLT 2.0 functions to be excluded
-->

<xsl:mode on-no-match="shallow-skip" />
<xsl:output indent="true" />

<xsl:variable name="location20">../../../../specs/functions-and-operators-rec20.xml</xsl:variable>
<xsl:variable name="location30">../../../../specs/functions-and-operators-rec30.xml</xsl:variable>
<xsl:variable name="location20">../../../specs/functions-and-operators-rec20.xml</xsl:variable>
<xsl:variable name="location30">../../../specs/functions-and-operators-rec30.xml</xsl:variable>
<xsl:variable name="locationXslt20">../../../specs/xslt-rec20.xml</xsl:variable>

<xsl:template name="xsl:initial-template">
<xsl:variable name="fo20">
@@ -29,14 +32,37 @@
<xsl:apply-templates select="doc($location30)/html[1]/body[1]//code[@class='function']" />
</function-list>
</xsl:variable>
<xsl:result-document href="function-1902.xml">
<xsl:variable name="xslt20">
<function-list>
<xsl:copy-of select="$fo30/*:function-list/*:function[not(@name || @arity = $fo20/*:function-list/*:function/(@name || @arity))]" />
<xsl:apply-templates select="doc($locationXslt20)/html[1]/body[1]//code[@class='function']" mode="xslt20" />
</function-list>
</xsl:variable>

<!--
Go over the FO30 functions and remove those that are inside XSLT20 or FO20 function lists.
Result is a list of functions that only contains the functions that were added in FO30
-->
<xsl:result-document href="function-1902.xml" xpath-default-namespace="">
<function-list>
<xsl:copy-of select="$fo30/function-list/function
[let $f := . return not($fo20/function-list/function[@name = $f/@name and @arity = $f/@arity])]
[let $f := . return not($xslt20/function-list/function[@name = $f/@name and @arity = $f/@arity])]" />
</function-list>
</xsl:result-document>
</xsl:template>


<!-- xslt 2.0 functions, some functions were moved to FO30, they were supported of course in XSLT20 -->
<xsl:template match="code" mode="xslt20">

<function
name="fn:{. (: prefixed with 'fn' for ease of comparison :)}"
arity="{count(if(following-sibling::code)
then following-sibling::code[@class='arg']
else ancestor::table[1]/tr/td/code[@class='arg'])}"/>
</xsl:template>

<!-- F&O 2.0 and 3.0 functions -->
<xsl:template match="code[not(
(: excluding the example functions and xs:dateTimeStamp (XSD 1.1 specific) :)
@@ -55,5 +81,4 @@
then following-sibling::code[@class='arg']
else ancestor::table[@summary='Function/operator prototype']/tr/td/code[@class='arg'])}"/>
</xsl:template>

</xsl:stylesheet>
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<out>
<incorrectly-available-function name="fn:node-name" arity="0"/>
<incorrectly-available-function name="fn:nilled" arity="0"/>
<incorrectly-available-function name="fn:data" arity="0"/>
<incorrectly-available-function name="fn:document-uri" arity="0"/>
<incorrectly-available-function name="fn:round" arity="2"/>
<incorrectly-available-function name="fn:format-integer" arity="2"/>
<incorrectly-available-function name="fn:format-integer" arity="3"/>
<incorrectly-available-function name="math:pi" arity="0"/>
<incorrectly-available-function name="math:exp" arity="1"/>
<incorrectly-available-function name="math:exp10" arity="1"/>
<incorrectly-available-function name="math:log" arity="1"/>
<incorrectly-available-function name="math:log10" arity="1"/>
<incorrectly-available-function name="math:pow" arity="2"/>
<incorrectly-available-function name="math:sqrt" arity="1"/>
<incorrectly-available-function name="math:sin" arity="1"/>
<incorrectly-available-function name="math:cos" arity="1"/>
<incorrectly-available-function name="math:tan" arity="1"/>
<incorrectly-available-function name="math:asin" arity="1"/>
<incorrectly-available-function name="math:acos" arity="1"/>
<incorrectly-available-function name="math:atan" arity="1"/>
<incorrectly-available-function name="math:atan2" arity="2"/>
<incorrectly-available-function name="fn:string-join" arity="1"/>
<incorrectly-available-function name="fn:analyze-string" arity="2"/>
<incorrectly-available-function name="fn:analyze-string" arity="3"/>
<incorrectly-available-function name="fn:path" arity="0"/>
<incorrectly-available-function name="fn:path" arity="1"/>
<incorrectly-available-function name="fn:has-children" arity="0"/>
<incorrectly-available-function name="fn:has-children" arity="1"/>
<incorrectly-available-function name="fn:innermost" arity="1"/>
<incorrectly-available-function name="fn:outermost" arity="1"/>
<incorrectly-available-function name="fn:head" arity="1"/>
<incorrectly-available-function name="fn:tail" arity="1"/>
<incorrectly-available-function name="fn:uri-collection" arity="0"/>
<incorrectly-available-function name="fn:uri-collection" arity="1"/>
<incorrectly-available-function name="fn:unparsed-text-lines" arity="1"/>
<incorrectly-available-function name="fn:unparsed-text-lines" arity="2"/>
<incorrectly-available-function name="fn:environment-variable" arity="1"/>
<incorrectly-available-function name="fn:available-environment-variables" arity="0"/>
<incorrectly-available-function name="fn:parse-xml" arity="1"/>
<incorrectly-available-function name="fn:parse-xml-fragment" arity="1"/>
<incorrectly-available-function name="fn:serialize" arity="1"/>
<incorrectly-available-function name="fn:serialize" arity="2"/>
<incorrectly-available-function name="fn:function-lookup" arity="2"/>
<incorrectly-available-function name="fn:function-arity" arity="1"/>
<incorrectly-available-function name="fn:for-each" arity="2"/>
<incorrectly-available-function name="fn:filter" arity="2"/>
<incorrectly-available-function name="fn:fold-left" arity="3"/>
<incorrectly-available-function name="fn:fold-right" arity="3"/>
<incorrectly-available-function name="fn:for-each-pair" arity="3"/>
<incorrectly-available-function name="xs:NMTOKENS" arity="1"/>
<incorrectly-available-function name="xs:ENTITIES" arity="1"/>
<incorrectly-available-function name="xs:IDREFS" arity="1"/>
<incorrectly-available-function name="xs:error" arity="1"/>
</out>
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><out><correctly-missing-function name="fn:node-name" arity="0"/><correctly-missing-function name="fn:nilled" arity="0"/><correctly-missing-function name="fn:data" arity="0"/><correctly-missing-function name="fn:document-uri" arity="0"/><correctly-missing-function name="fn:round" arity="2"/><correctly-missing-function name="fn:format-integer" arity="2"/><correctly-missing-function name="fn:format-integer" arity="3"/><correctly-missing-function name="math:pi" arity="0"/><correctly-missing-function name="math:exp" arity="1"/><correctly-missing-function name="math:exp10" arity="1"/><correctly-missing-function name="math:log" arity="1"/><correctly-missing-function name="math:log10" arity="1"/><correctly-missing-function name="math:pow" arity="2"/><correctly-missing-function name="math:sqrt" arity="1"/><correctly-missing-function name="math:sin" arity="1"/><correctly-missing-function name="math:cos" arity="1"/><correctly-missing-function name="math:tan" arity="1"/><correctly-missing-function name="math:asin" arity="1"/><correctly-missing-function name="math:acos" arity="1"/><correctly-missing-function name="math:atan" arity="1"/><correctly-missing-function name="math:atan2" arity="2"/><correctly-missing-function name="fn:string-join" arity="1"/><correctly-missing-function name="fn:analyze-string" arity="2"/><correctly-missing-function name="fn:analyze-string" arity="3"/><correctly-missing-function name="fn:path" arity="0"/><correctly-missing-function name="fn:path" arity="1"/><correctly-missing-function name="fn:has-children" arity="0"/><correctly-missing-function name="fn:has-children" arity="1"/><correctly-missing-function name="fn:innermost" arity="1"/><correctly-missing-function name="fn:outermost" arity="1"/><correctly-missing-function name="fn:head" arity="1"/><correctly-missing-function name="fn:tail" arity="1"/><correctly-missing-function name="fn:uri-collection" arity="0"/><correctly-missing-function name="fn:uri-collection" arity="1"/><correctly-missing-function name="fn:unparsed-text-lines" arity="1"/><correctly-missing-function name="fn:unparsed-text-lines" arity="2"/><correctly-missing-function name="fn:environment-variable" arity="1"/><correctly-missing-function name="fn:available-environment-variables" arity="0"/><correctly-missing-function name="fn:parse-xml" arity="1"/><correctly-missing-function name="fn:parse-xml-fragment" arity="1"/><correctly-missing-function name="fn:serialize" arity="1"/><correctly-missing-function name="fn:serialize" arity="2"/><correctly-missing-function name="fn:function-lookup" arity="2"/><correctly-missing-function name="fn:function-arity" arity="1"/><correctly-missing-function name="fn:for-each" arity="2"/><correctly-missing-function name="fn:filter" arity="2"/><correctly-missing-function name="fn:fold-left" arity="3"/><correctly-missing-function name="fn:fold-right" arity="3"/><correctly-missing-function name="fn:for-each-pair" arity="3"/><correctly-missing-function name="xs:NMTOKENS" arity="1"/><correctly-missing-function name="xs:ENTITIES" arity="1"/><correctly-missing-function name="xs:IDREFS" arity="1"/><correctly-missing-function name="xs:error" arity="1"/></out>
@@ -1,70 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<function-list>
<function name="fn:node-name" arity="0"/>
<function name="fn:nilled" arity="0"/>
<function name="fn:data" arity="0"/>
<function name="fn:document-uri" arity="0"/>
<function name="fn:round" arity="2"/>
<function name="fn:format-integer" arity="2"/>
<function name="fn:format-integer" arity="3"/>
<function name="fn:format-number" arity="2"/>
<function name="fn:format-number" arity="3"/>
<function name="math:pi" arity="0"/>
<function name="math:exp" arity="1"/>
<function name="math:exp10" arity="1"/>
<function name="math:log" arity="1"/>
<function name="math:log10" arity="1"/>
<function name="math:pow" arity="2"/>
<function name="math:sqrt" arity="1"/>
<function name="math:sin" arity="1"/>
<function name="math:cos" arity="1"/>
<function name="math:tan" arity="1"/>
<function name="math:asin" arity="1"/>
<function name="math:acos" arity="1"/>
<function name="math:atan" arity="1"/>
<function name="math:atan2" arity="2"/>
<function name="fn:string-join" arity="1"/>
<function name="fn:analyze-string" arity="2"/>
<function name="fn:analyze-string" arity="3"/>
<function name="fn:format-dateTime" arity="2"/>
<function name="fn:format-dateTime" arity="5"/>
<function name="fn:format-date" arity="2"/>
<function name="fn:format-date" arity="5"/>
<function name="fn:format-time" arity="2"/>
<function name="fn:format-time" arity="5"/>
<function name="fn:path" arity="0"/>
<function name="fn:path" arity="1"/>
<function name="fn:has-children" arity="0"/>
<function name="fn:has-children" arity="1"/>
<function name="fn:innermost" arity="1"/>
<function name="fn:outermost" arity="1"/>
<function name="fn:head" arity="1"/>
<function name="fn:tail" arity="1"/>
<function name="fn:generate-id" arity="0"/>
<function name="fn:generate-id" arity="1"/>
<function name="fn:uri-collection" arity="0"/>
<function name="fn:uri-collection" arity="1"/>
<function name="fn:unparsed-text" arity="1"/>
<function name="fn:unparsed-text" arity="2"/>
<function name="fn:unparsed-text-lines" arity="1"/>
<function name="fn:unparsed-text-lines" arity="2"/>
<function name="fn:unparsed-text-available" arity="1"/>
<function name="fn:unparsed-text-available" arity="2"/>
<function name="fn:environment-variable" arity="1"/>
<function name="fn:available-environment-variables" arity="0"/>
<function name="fn:parse-xml" arity="1"/>
<function name="fn:parse-xml-fragment" arity="1"/>
<function name="fn:serialize" arity="1"/>
<function name="fn:serialize" arity="2"/>
<function name="fn:function-lookup" arity="2"/>
<function name="fn:function-arity" arity="1"/>
<function name="fn:for-each" arity="2"/>
<function name="fn:filter" arity="2"/>
<function name="fn:fold-left" arity="3"/>
<function name="fn:fold-right" arity="3"/>
<function name="fn:for-each-pair" arity="3"/>
<function name="xs:NMTOKENS" arity="1"/>
<function name="xs:ENTITIES" arity="1"/>
<function name="xs:IDREFS" arity="1"/>
<function name="xs:error" arity="1"/>
</function-list>
<?xml version="1.0" encoding="UTF-8"?>
<function-list>
<function name="fn:node-name" arity="0"/>
<function name="fn:nilled" arity="0"/>
<function name="fn:data" arity="0"/>
<function name="fn:document-uri" arity="0"/>
<function name="fn:round" arity="2"/>
<function name="fn:format-integer" arity="2"/>
<function name="fn:format-integer" arity="3"/>
<function name="math:pi" arity="0"/>
<function name="math:exp" arity="1"/>
<function name="math:exp10" arity="1"/>
<function name="math:log" arity="1"/>
<function name="math:log10" arity="1"/>
<function name="math:pow" arity="2"/>
<function name="math:sqrt" arity="1"/>
<function name="math:sin" arity="1"/>
<function name="math:cos" arity="1"/>
<function name="math:tan" arity="1"/>
<function name="math:asin" arity="1"/>
<function name="math:acos" arity="1"/>
<function name="math:atan" arity="1"/>
<function name="math:atan2" arity="2"/>
<function name="fn:string-join" arity="1"/>
<function name="fn:analyze-string" arity="2"/>
<function name="fn:analyze-string" arity="3"/>
<function name="fn:path" arity="0"/>
<function name="fn:path" arity="1"/>
<function name="fn:has-children" arity="0"/>
<function name="fn:has-children" arity="1"/>
<function name="fn:innermost" arity="1"/>
<function name="fn:outermost" arity="1"/>
<function name="fn:head" arity="1"/>
<function name="fn:tail" arity="1"/>
<function name="fn:uri-collection" arity="0"/>
<function name="fn:uri-collection" arity="1"/>
<function name="fn:unparsed-text-lines" arity="1"/>
<function name="fn:unparsed-text-lines" arity="2"/>
<function name="fn:environment-variable" arity="1"/>
<function name="fn:available-environment-variables" arity="0"/>
<function name="fn:parse-xml" arity="1"/>
<function name="fn:parse-xml-fragment" arity="1"/>
<function name="fn:serialize" arity="1"/>
<function name="fn:serialize" arity="2"/>
<function name="fn:function-lookup" arity="2"/>
<function name="fn:function-arity" arity="1"/>
<function name="fn:for-each" arity="2"/>
<function name="fn:filter" arity="2"/>
<function name="fn:fold-left" arity="3"/>
<function name="fn:fold-right" arity="3"/>
<function name="fn:for-each-pair" arity="3"/>
<function name="xs:NMTOKENS" arity="1"/>
<function name="xs:ENTITIES" arity="1"/>
<function name="xs:IDREFS" arity="1"/>
<function name="xs:error" arity="1"/>
</function-list>
Oops, something went wrong.

0 comments on commit 9c2c099

Please sign in to comment.
You can’t perform that action at this time.