#This source doc used to bomb cDomlette just on parse, as Uche found out from Xml.Xslt import test_harness sheet_1 = """\ /@[]EXSLT 1.9 In pattern exslt:function: The root element must be exslt:function element. In pattern exslt:name or count(exslt:name) > 1: A element must contain one exslt:name element. In pattern rdf:Description or count(rdf:Description) > 1: A element must contain one rdf:Description element. In pattern exslt:doc or count(exslt:doc) > 1: A element must contain one exslt:doc element. In pattern exslt:definition or count(exslt:definition) > 1: A element must contain one exslt:definition element. In pattern exslt:implementations or count(exslt:implementations) > 1: A element must contain one exslt:implementations element. In pattern exslt:use-cases or count(exslt:use-cases) > 1: A element must contain one exslt:use-cases element. In pattern @module: A element must have a module attribute. In pattern @version: A element must have a version attribute. In pattern @status and (@status='new' or @status='revised' or @status='reviewed' or @status='implemented' or @status='stable'): A element must have a status attribute of value 'new', 'revised', 'reviewed', 'implemented' or 'stable. In pattern @function: A element must have a function attribute. In pattern @src: A element must have a src attribute. In pattern @language: A element must have a language attribute. In pattern @version: A element must have a version attribute. In pattern @algorithm: A element must have an algorithm attribute. In pattern @function: A element must have a function attribute. In pattern @type: A element must have a type attribute. In pattern @template: A element must have a template attribute. In pattern @data: A element must have a data attribute. In pattern @xslt: A element must have a xslt attribute. In pattern @result: A element must have a result attribute. In pattern exslt:revision|exslt:version: A element must contain either one exslt:version element or at least one exslt:revision element. In pattern exslt:revision and count(dc:title) > 1: A element with exslt:revision must contain no more than one dc:title element. In pattern exslt:revision and count(dc:rights) > 1: A element with exslt:revision must contain no more than one dc:rights element. In pattern exslt:version and dc:creator: A element with exslt:version must contain at least one dc:creator element. In pattern exslt:version and dc:date: A element with exslt:version must contain one dc:date element. In pattern exslt:version and dc:description: A element with exslt:version must contain one dc:description element. """ source_1 = """\ min EXSLT math min minimum public domain 1 Jeni Tennison 2001-03-28 Returns the minimum value from a node-set.
The math:min function returns the minimum, for each node in the argument node-set, of the result of converting the string-values of the node to a number using the number function. The numbers are compared as with the < operator. If the node set is empty, NaN is returned. The math:min template returns a result tree fragment whose string value is the result of turning the number returned by the function into a string.
This use case shows an error when the function is passed a number as the value of the first argument. This use case shows an error when the function is passed a number as the value of the nodes parameter.
""" expected_1 = """\ EXSLT 1.9 In pattern exslt:revision and count(dc:title) > 1: A rdf:Description element with exslt:revision must contain no more than one dc:title element. In pattern exslt:revision and count(dc:rights) > 1: A rdf:Description element with exslt:revision must contain no more than one dc:rights element. In pattern exslt:version and dc:creator: A rdf:Description element with exslt:version must contain at least one dc:creator element. In pattern exslt:version and dc:date: A rdf:Description element with exslt:version must contain one dc:date element. In pattern exslt:version and dc:description: A rdf:Description element with exslt:version must contain one dc:description element. In pattern exslt:revision and count(dc:title) > 1: A rdf:Description element with exslt:revision must contain no more than one dc:title element. In pattern exslt:revision and count(dc:rights) > 1: A rdf:Description element with exslt:revision must contain no more than one dc:rights element. In pattern @function: A exslt:implementation element must have a function attribute. In pattern @algorithm: A exslt:implementation element must have an algorithm attribute. In pattern @function: A exslt:implementation element must have a function attribute. In pattern @algorithm: A exslt:implementation element must have an algorithm attribute. In pattern @function: A exslt:implementation element must have a function attribute. In pattern @algorithm: A exslt:implementation element must have an algorithm attribute. In pattern @function: A exslt:use-case element must have a function attribute. In pattern @template: A exslt:use-case element must have a template attribute. In pattern @function: A exslt:use-case element must have a function attribute. In pattern @function: A exslt:use-case element must have a function attribute. In pattern @template: A exslt:use-case element must have a template attribute. In pattern @function: A exslt:use-case element must have a function attribute. In pattern @function: A exslt:use-case element must have a function attribute. In pattern @template: A exslt:use-case element must have a template attribute. In pattern @result: A exslt:use-case element must have a result attribute. In pattern @function: A exslt:use-case element must have a function attribute. In pattern @result: A exslt:use-case element must have a result attribute. """ def Test(tester): source = test_harness.FileInfo(string=source_1) sheet = test_harness.FileInfo(string=sheet_1) test_harness.XsltTest(tester, source, [sheet], expected_1) return