forked from w3c/qtspecs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstrip-core.xsl
59 lines (54 loc) · 2.8 KB
/
strip-core.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright (c) 2002 World Wide Web Consortium,
* (Massachusetts Institute of Technology, Institut National de
* Recherche en Informatique et en Automatique, Keio University). All
* Rights Reserved. This program is distributed under the W3C's Software
* Intellectual Property License. This program is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE.
* See W3C License http://www.w3.org/Consortium/Legal/ for more details.
-->
<!-- This stylesheet is used by various ant scripts (build.xml)
to transform the "complete" xpath/xquery grammar file into
a "temporary" XPath or XQuery grammar file, possibly with
specialized extensions (e.g., Full Text, Update Facility) -->
<!-- It appears to accept no parameters -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- Generate a comment that identifies as much as we can about the XSLT processor being used -->
<xsl:template match="/">
<xsl:variable name="XSLTprocessor">
<xsl:text>XSLT Processor: </xsl:text>
<xsl:value-of select="system-property('xsl:vendor')"/>
<xsl:if test="system-property('xsl:version') = '2.0'">
<xsl:text> </xsl:text>
<xsl:value-of select="system-property('xsl:product-name')"/>
<xsl:text> </xsl:text>
<xsl:value-of select="system-property('xsl:product-version')"/>
</xsl:if>
</xsl:variable>
<xsl:message><xsl:value-of select="$XSLTprocessor"/></xsl:message>
<xsl:comment><xsl:value-of select="$XSLTprocessor"/></xsl:comment>
<xsl:apply-templates/>
</xsl:template>
<!-- This is a "near-identity" transformation template -->
<xsl:template match="@*|node()">
<!-- If a node doesn't have an "if" attribute, or if it has one
and the value of the attribute contains a string equal to
"core", then... -->
<xsl:if test="self::node()[not(@if) or contains(@if,'core')]">
<!-- ...produce a copy of the node by applying this template
to all of the contained nodes and attributes other than
attributed named "if" -->
<xsl:copy>
<xsl:apply-templates select="@*[not(name(.) = 'if')]|node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios/><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->