| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
|
| 3 |
<!-- |
| 4 |
* Copyright (c) 2002 World Wide Web Consortium, |
| 5 |
* (Massachusetts Institute of Technology, Institut National de |
| 6 |
* Recherche en Informatique et en Automatique, Keio University). All |
| 7 |
* Rights Reserved. This program is distributed under the W3C's Software |
| 8 |
* Intellectual Property License. This program is distributed in the |
| 9 |
* hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
| 10 |
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 11 |
* PURPOSE. |
| 12 |
* See W3C License http://www.w3.org/Consortium/Legal/ for more details. |
| 13 |
--> |
| 14 |
|
| 15 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 16 |
version="1.0" xmlns:g="http://www.w3.org/2001/03/XPath/grammar"> |
| 17 |
<xsl:param name="spec1" select="'xquery'"/> |
| 18 |
<xsl:param name="spec2" select="'dummy'"/> |
| 19 |
<xsl:param name="spec3" select="'dummy'"/> |
| 20 |
|
| 21 |
<xsl:template match="@*|node()[@exposition-only='yes']"> |
| 22 |
<!-- empty --> |
| 23 |
</xsl:template> |
| 24 |
|
| 25 |
<xsl:template match="@*|node()[not(@exposition-only='yes')]"> |
| 26 |
|
| 27 |
<xsl:if test="self::node()[not(@if) |
| 28 |
or contains(@if, $spec1) |
| 29 |
or contains(@if, $spec2) |
| 30 |
or contains(@if, $spec3)]"> |
| 31 |
<!-- |
| 32 |
Additional check for StringLiteral token. XQuery 1.0 uses |
| 33 |
a more restricted version than XPath 2.0. JCR XPath must |
| 34 |
use the XPath 2.0 variant. |
| 35 |
See: http://issues.apache.org/jira/browse/JCR-739 |
| 36 |
--> |
| 37 |
<xsl:if test="not(ancestor::g:token[@name = 'StringLiteral']) or not(@if)"> |
| 38 |
<xsl:copy> |
| 39 |
<xsl:apply-templates select="@*|node()"/> |
| 40 |
</xsl:copy> |
| 41 |
</xsl:if> |
| 42 |
</xsl:if> |
| 43 |
|
| 44 |
</xsl:template> |
| 45 |
|
| 46 |
</xsl:stylesheet> |