Re: [Gestalt-users] New extension function
Status: Alpha
Brought to you by:
colin-adams
From: Colin P. A. <co...@co...> - 2006-07-17 07:19:04
|
>>>>> "Florent" == Florent Georges <dar...@ya...> writes: Florent> So if I understand right, the idea is that caching is Florent> on by default, and to allow in the future more control on Florent> caching through flags. Your understanding is correct. I have now implemented a 2-argument form of the function (the full 7-argument form will have to wait for next weekend). The following output: transformAt line 33 in file://localhost/home/colin/gobo/src/gexslt/transformation.xsl#test2: Fatal error: http://www.w3.org/2005/xqt-errors#FOER0000: error generated by test of gexslt:transformation Found an error is produced by this transformation: <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:gexslt="http://www.gobosoft.com/eiffel/gobo/gexslt/extension" xmlns:test="http://colina.demon.co.uk/xslt/tests/" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="gexslt" > <test:transformations> <test1> <!-- prints local name of document element --> <xsl:transform xml:id="test1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" > <xsl:template match='/'> <output> <xsl:value-of select="*[1]/local-name()"/> </output> </xsl:template> </xsl:transform> </test1> <test2> <!-- raises an error --> <xsl:transform xml:id="test2" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gexslt="http://www.gobosoft.com/eiffel/gobo/gexslt/extension" version="2.0" > <xsl:template match='/'> <output> <xsl:value-of select="error(gexslt:TEST_GENERATED_ERROR, 'error generated by test of gexslt:transformation', ())"/> </output> </xsl:template> </xsl:transform> </test2> </test:transformations> <xsl:output method="text"/> <xsl:template name="initial" > <xsl:variable name="transformation_result" select="gexslt:transformation('#test1', doc(''))"/> <xsl:value-of select="$transformation_result/output/text()"/> <xsl:variable name="transformation_result_2" select="gexslt:transformation('#test2', doc(''))"/> <xsl:if test="count ($transformation_result_2) gt 1 and $transformation_result_2[1] instance of xs:QName"> Found an error </xsl:if> </xsl:template> </xsl:transform> Note there have been some changes to the spec. In particular, on an error, the output is now: (QName, description, error-objects...) If no error, only the principal result document is output. This is because, for xsl:result-document, I cannot capture the output with my current architecture, as, int the case of file output at least, the output is streamed directly to the file. I might think about that one. -- Colin Adams Preston Lancashire |