diff options
author | Shaun McCance <shaunm@gnome.org> | 2013-10-23 23:26:50 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2013-10-23 23:26:50 -0400 |
commit | 41ecb1992c6a632eaa10968639d435542fe4eff9 (patch) | |
tree | d9acad2551542f22d497e05d051750771585b29e /xslt | |
parent | 669cefc096b8c9566258480926a849d8bb3a21da (diff) | |
download | yelp-tools-41ecb1992c6a632eaa10968639d435542fe4eff9.tar.gz |
yelp-check: Support explicitly allows namespaces in strict validation
Diffstat (limited to 'xslt')
-rw-r--r-- | xslt/mal-rng.xsl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/xslt/mal-rng.xsl b/xslt/mal-rng.xsl index aebda73..d6d8895 100644 --- a/xslt/mal-rng.xsl +++ b/xslt/mal-rng.xsl @@ -10,6 +10,7 @@ version="1.0"> <xsl:param name="rng.strict" select="false()"/> +<xsl:param name="rng.strict.allow" select="''"/> <xsl:template match="/*"> <xsl:variable name="version"> @@ -89,6 +90,26 @@ <xsl:choose> <xsl:when test="$rng.strict and rng:anyName"> <xsl:choose> + <xsl:when test="$rng.strict.allow != ''"> + <xsl:copy> + <choice> + <xsl:if test="self::rng:attribute/ancestor::rng:element[1]/rng:anyName"> + <nsName ns=""/> + </xsl:if> + <xsl:for-each select="str:split($rng.strict.allow)"> + <nsName ns="{.}"/> + </xsl:for-each> + <xsl:if test="ancestor::rng:define/@name = 'mal_attr_external'"> + <nsName ns="http://www.w3.org/XML/1998/namespace"/> + </xsl:if> + </choice> + <xsl:apply-templates mode="rng.mode" select="rng:anyName/following-sibling::*"> + <xsl:with-param name="first" select="$first"/> + <xsl:with-param name="ns" select="$ns"/> + <xsl:with-param name="nss" select="$nss"/> + </xsl:apply-templates> + </xsl:copy> + </xsl:when> <xsl:when test="ancestor::rng:define/@name = 'mal_attr_external'"> <xsl:copy> <nsName ns="http://www.w3.org/XML/1998/namespace"/> |