[Gestalt-users] XML Inclusions
Status: Alpha
Brought to you by:
colin-adams
From: Colin P. A. <co...@co...> - 2007-02-04 09:37:57
|
Erik Wilde (dr...@be...) has written an XSLT 2.0 transformation for performing XInclude processing. Google for xipr.xsl. It is therefore now possible (with certain limitations) to perform XInclude processing within Gobo. To do so, first create a transformation called xinclude.xsl like this: <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:include href="xipr.xsl"/> <xsl:template match="/"> <xsl:apply-templates select="." mode="xipr"/> </xsl:template> </xsl:transform> Then from the command line: gexslt xinclude.xsl my.xml (or the equivalent from within an Eiffel program). The output will be a copy of my.xml with all XInclude actions performed. This could be useful with geant scripts, for instance, or as a goanna servlet, perhaps. Limitations: The accept and accept-language attributes are not supported (this is not possible from XSLT). Only shorthand and element() xpointers are supported (minimal conformance). Additional gobo limitations: Parse=text processing is currently only supported for UTF-8 (and therefore ASCII). ACTION: Franck Likewise, parse=xml is restricted to those encodings currently supported by the Gobo Eiffel XML parser (UTF-8, UTF-16, ISO8859-1 and US-ASCII if my memory serves me). If the xpointer attribute is present, then gexslt will throw an error due to the limitations of the Gobo PCRE regular expression library (it does not understand Unicode character classes/properties). I think it will not be possible to patch this, and so a new, Unicode-aware, regular expression engine is needed. ACTION: Any takers? It may be possible to get around this by patching xipr.xsl - simply remove the matches (@xpointer, ...) tests. This will mean that bad xpointers will slip through, causes spurious crashes, but it should work for good ones. Better would be to replace the matches (@xpointer, ...) function calls with other, more cumbersome, regular expressions, that have the same effect, or a specially written xsl:function to check the syntax without using regular expressions. -- Colin Adams Preston Lancashire |