Subject: Re: [xsl] Want to process XHTML in my XSL stylesheets. From: Francis Norton <francis@xxxxxxxxxxx> Date: Tue, 09 Jul 2002 17:34:57 +0100 |
Yes - I'd assumed that you would simply flag the over-dynamic cases as generating invalid content, but as you say, it's quite possible that there will be cases which in fact are valid but are undecidable by any program of sensible complexity.There are some things that happen in a stylesheet that make the analysis impossible, e.g. use of <xsl:element name="{expr}">. There are many other things that make the analysis impractical, for example if the stylesheet does <xsl:apply-templates select="*[position()>2]", you might have to infer that this can't select a <title> or <subtitle> element because those can only occur in the first two positions; or you have to infer that the template rule for match="para[1]" will always be fired before the one for match="para". In general that requires some quite powerful analysis.
It's still very much an open question how much is achievable form staticI'd have thought it would be possible to specify a profile of XSLT for which you can do static structural typing, though your examples so far are impressively daunting...
analysis of a stylesheet, but my suspicion is that in most cases the
only type you can deduce for the result tree is "document".
This is addressing the slightly different problem of whether the source schema guarantees valid input to a transform, as opposed to whether the transform guarantees output that is valid for the target schema. But of course they are related, in that breaking transform inputs may break the output.One reason for this is that I think most real stylesheets assume things about the source documents that are not actually explicit in the schema, things like "all rows will contain the same number of columns", and the stylesheet will actually fail if these assumptions prove wrong.
Thanks - they've helpfully included a link to a Haskell XML library, which give me confidence that there's a sensible path forward if I start exploring this area.The Software AG XQuery prototype (QuiP)[1] is written in Haskell, and its developers are very enthusiastic about the language.
[1] http://developer.softwareag.com/tamino/quip/
-- "Never mind manoeuvre, go straight at 'em." - Admiral Horatio Nelson
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Want to process XHTML in , Michael Kay | Thread | RE: [xsl] Want to process XHTML in , Hunsberger, Peter |
RE: [xsl] including files, Dion Houston | Date | Re: [xsl] Sorting Nested Loops, Joerg Heinicke |
Month |