Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: third_party/libxml/src/xstc/xstc-to-python.xsl

Issue 1193533007: Upgrade to libxml 2.9.2 and libxslt 1.1.28 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove suppressions, have landed in blink now Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <xsl:stylesheet
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:ts="TestSuite" version="1.0"
5 xmlns:xl="http://www.w3.org/1999/xlink">
6 <xsl:param name="vendor" select="'NIST'"/>
7 <xsl:output method="text"/>
8
9 <xsl:template match="/">
10 <xsl:text>#!/usr/bin/python -u
11 # -*- coding: UTF-8 -*-
12 #
13 # This file is generated from the W3C test suite description file.
14 #
15
16 import xstc
17 from xstc import XSTCTestRunner, XSTCTestGroup, XSTCSchemaTest, XSTCInstanceTest
18
19 xstc.vendor = "</xsl:text><xsl:value-of select="$vendor"/><xsl:text>"
20
21 r = XSTCTestRunner()
22
23 # Group definitions.
24
25 </xsl:text>
26
27 <xsl:apply-templates select="ts:testSet/ts:testGroup" mode="group-def"/>
28 <xsl:text>
29
30 # Test definitions.
31
32 </xsl:text>
33 <xsl:apply-templates select="ts:testSet/ts:testGroup" mode="test -def"/>
34 <xsl:text>
35
36 r.run()
37
38 </xsl:text>
39
40 </xsl:template>
41
42 <!-- groupName, descr -->
43 <xsl:template match="ts:testGroup" mode="group-def">
44 <xsl:text>r.addGroup(XSTCTestGroup("</xsl:text>
45 <!-- group -->
46 <xsl:value-of select="@name"/><xsl:text>", "</xsl:text>
47 <!-- main schema -->
48 <xsl:value-of select="ts:schemaTest[1]/ts:schemaDocument/@xl:hre f"/><xsl:text>", """</xsl:text>
49 <!-- group-description -->
50 <xsl:call-template name="str">
51 <xsl:with-param name="str" select="ts:annotation/ts:docu mentation/text()"/>
52 </xsl:call-template>
53 <xsl:text>"""))
54 </xsl:text>
55 </xsl:template>
56
57 <xsl:template name="str">
58 <xsl:param name="str"/>
59 <xsl:choose>
60 <xsl:when test="contains($str, '&quot;')">
61 <xsl:call-template name="str">
62 <xsl:with-param name="str" select="subst ring-before($str, '&quot;')"/>
63 </xsl:call-template>
64 <xsl:text>'</xsl:text>
65 <xsl:call-template name="str">
66 <xsl:with-param name="str" select="subst ring-after($str, '&quot;')"/>
67 </xsl:call-template>
68
69 </xsl:when>
70 <xsl:otherwise>
71 <xsl:value-of select="$str"/>
72 </xsl:otherwise>
73 </xsl:choose>
74 </xsl:template>
75
76 <xsl:template match="ts:testGroup" mode="test-def">
77 <xsl:param name="group" select="@name"/>
78 <xsl:for-each select="ts:schemaTest">
79 <!-- groupName, isSchema, Name, Accepted, File, Val, Des cr -->
80 <xsl:text>r.addTest(XSTCSchemaTest("</xsl:text>
81 <!-- group -->
82 <xsl:value-of select="$group"/><xsl:text>", "</xsl:text>
83 <!-- test-name -->
84 <xsl:value-of select="@name"/><xsl:text>", </xsl:text>
85 <!-- accepted -->
86 <xsl:value-of select="number(ts:current/@status = 'accep ted')"/><xsl:text>, "</xsl:text>
87 <!-- filename -->
88 <xsl:value-of select="ts:schemaDocument/@xl:href"/><xsl: text>", </xsl:text>
89 <!-- validity -->
90 <xsl:value-of select="number(ts:expected/@validity = 'va lid')"/><xsl:text>, "</xsl:text>
91 <!-- test-description -->
92 <xsl:value-of select="ts:annotation/ts:documentation/tex t()"/><xsl:text>"))
93 </xsl:text>
94 </xsl:for-each>
95 <xsl:for-each select="ts:instanceTest">
96 <!-- groupName, isSchema, Name, Accepted, File, Val, Des cr -->
97 <xsl:text>r.addTest(XSTCInstanceTest("</xsl:text>
98 <!-- group -->
99 <xsl:value-of select="$group"/><xsl:text>", "</xsl:text>
100 <!-- test-name -->
101 <xsl:value-of select="@name"/><xsl:text>", </xsl:text>
102 <!-- accepted -->
103 <xsl:value-of select="number(ts:current/@status = 'accep ted')"/><xsl:text>, "</xsl:text>
104 <!-- filename -->
105 <xsl:value-of select="ts:instanceDocument/@xl:href"/><xs l:text>", </xsl:text>
106 <!-- validity -->
107 <xsl:value-of select="number(ts:expected/@validity = 'va lid')"/><xsl:text>, "</xsl:text>
108 <!-- test-description -->
109 <xsl:value-of select="ts:annotation/ts:documentation/tex t()"/><xsl:text>"))
110 </xsl:text>
111 </xsl:for-each>
112 </xsl:template>
113
114 </xsl:stylesheet>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698