[yelp-tools] Validate Mallard cache files
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-tools] Validate Mallard cache files
- Date: Sat, 27 Jul 2013 15:39:22 +0000 (UTC)
commit 3d238cca529e10803fe4af05b1e9fba37b1bbb33
Author: Shaun McCance <shaunm gnome org>
Date: Sat Jul 27 11:39:09 2013 -0400
Validate Mallard cache files
tools/yelp-check.in | 6 +++++-
xslt/mal-rng.xsl | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/tools/yelp-check.in b/tools/yelp-check.in
index f566a37..31d6545 100755
--- a/tools/yelp-check.in
+++ b/tools/yelp-check.in
@@ -593,6 +593,7 @@ yelp_validate_page () {
check_out_file=`mktemp`
check_rng_file=`(
echo '<xsl:stylesheet'
+ echo ' xmlns:cache="http://projectmallard.org/cache/1.0/"'
echo ' xmlns:xsl="http://www.w3.org/1999/XSL/Transform"'
echo ' version="1.0">'
echo '<xsl:output method="text"/>'
@@ -601,6 +602,9 @@ yelp_validate_page () {
echo '<xsl:when test="string(@version) != '"''"'">'
echo '<xsl:value-of select="@version"/>'
echo '</xsl:when>'
+ echo '<xsl:when test="/cache:cache">'
+ echo '<xsl:text>cache/1.0 1.0</xsl:text>'
+ echo '</xsl:when>'
echo '<xsl:otherwise>'
echo '<xsl:text>1.0</xsl:text>'
echo '</xsl:otherwise>'
@@ -648,7 +652,7 @@ yelp_validate () {
for page in "$xml"/*.page; do
yelp_validate_page "$page" || gret="$?"
done
- elif [ "x$ext" = "xpage" ]; then
+ elif [ "x$ext" = "xpage" -o "x$ext" = "xcache" ]; then
yelp_validate_page "$xml" || gret="$?"
else
xmllint --noout --xinclude --noent --postvalid "$xml" || gret="$?"
diff --git a/xslt/mal-rng.xsl b/xslt/mal-rng.xsl
index 6049dcd..2c75878 100644
--- a/xslt/mal-rng.xsl
+++ b/xslt/mal-rng.xsl
@@ -3,9 +3,10 @@
xmlns:str="http://exslt.org/strings"
xmlns:exsl="http://exslt.org/common"
xmlns:mal="http://projectmallard.org/1.0/"
+ xmlns:cache="http://projectmallard.org/cache/1.0/"
xmlns:rng="http://relaxng.org/ns/structure/1.0"
xmlns="http://relaxng.org/ns/structure/1.0"
- exclude-result-prefixes="mal str exsl rng"
+ exclude-result-prefixes="mal cache str exsl rng"
version="1.0">
<xsl:param name="rng.strict" select="false()"/>
@@ -16,6 +17,9 @@
<xsl:when test="string(@version) != ''">
<xsl:value-of select="@version"/>
</xsl:when>
+ <xsl:when test="/cache:cache">
+ <xsl:value-of select="'cache/1.0 1.0'"/>
+ </xsl:when>
<xsl:otherwise>
<xsl:value-of select="'1.0'"/>
</xsl:otherwise>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]