- From: Jo Rabin <jrabin@mtld.mobi>
- Date: Tue, 15 May 2007 20:21:09 +0100
- To: <public-mobileok-checker@w3.org>
> > root of the moki doc, or am I missing the point? > I'm not sure - this example don't work with my XSLT processor > (libxslt V10111). > Maybe it is only a libxslt problem? No, I'm sorry, I was being silly and confusing myself. To go back to my example output [1] and a snippet of Sean's caching test, lightly edited: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xpath-default-namespace="http://moki.mobi/2007/v0.1"> <xsl:output method="xml" version="1.0" encoding="UTF-8"/> <xsl:template match="/"> <test name="caching"> <xsl:choose> <xsl:when test="count(/moki/primaryDoc/retrieval/HTTPResponse[1]/header[@name='exp ires']) = 0 and count(/moki/primaryDoc/retrieval/HTTPResponse[1]/header[@name='cache-con trol']) = 0"> <result outcome="FAIL">No expires or cache control HTTP header</result> </xsl:when> <xsl:otherwise> <result outcome="PASS"/> </xsl:otherwise> </xsl:choose> </test> </xsl:template> </xsl:stylesheet> Generates, correctly, PASS - because of the inclusion of the specification: xpath-default-namespace="http://moki.mobi/2007/v0.1" in the stylesheet element which also specifies version="2.0". If you change HTTPResponse[1] for HTTPResponse[last()] it generates, correctly, a FAIL. Otherwise, for XSLT 1.0 you need to put namespaces on the xpath in the node test. Sorry to have missed the point, earlier. Also, I think the XPATH should be /moki/primaryDoc/retrieval/HTTPResponse[last()]/status[@code='200']/foll owing-sibling::header[@name='cache-control] to make sure that the last redirect was actually successful ... Jo
Received on Tuesday, 15 May 2007 19:21:28 UTC