Sebastian Rahtz writes:
> Tomaz Erjavec wrote:
> > ask something else that has been haunting me: the infamous milestone elements.
>
> I wonder if this problem is not simplified by multi-pass processing,
> either using trees in memory, or by a file pipeline.
I finally tried to do this, but got stuck. I'd really really like to
do it in memory, as it would get very messy with files. I have the
great XSLT reference by M. Kay, where it even tells you how, by
passing a variable with the transformed 'result tree fragment' to
apply-templates. I tried, and it doesn't work. Below is the minimal
test file, which should (I think) do the same thing as an empty
stylesheet:
<xsl:template match="/">
<xsl:variable name="content">
<xsl:apply-templates/>
</xsl:variable>
<xsl:apply-templates select="$content"/>
</xsl:template>
Well, for me it produces no output, and I can't figure out why.
No to be accused of rtfm I went to check the XSLT 1.1 specs
and, lo and behold, it says:
http://www.w3.org/TR/xslt11/#N6743
Note: The result tree fragment data-type has been removed in XSLT 1.1.
Hm. And yes, I'm using xsltproc:
$ xsltproc -V
Using libxml 20616, libxslt 10110-CVS940 and libexslt 808-CVS940
xsltproc was compiled against libxml 20613, libxslt 10110 and libexslt 808
Any advice much appreciated!
Tomaz
PS: btw, I don't think you could use DOE in memory, so that option is
only good for a file pipe.
>
> so take
>
> <div><head>One</head>
> hello
> <lb/>
> goodbye
> </div>
> <div><head>Two</head>
> merry
> <lb/>
> christmas
> </div>
>
> and transform it to
>
> <PAGE>
> <heading>One</heading>
> hello
> </PAGE>
>
> <PAGE>
> goodbye
> <heading>Two</heading
> merry
> </PAGE>
>
> <PAGE>
> christmas
> </PAGE>
>
> and then build the HTML from that. a transform which throws away one
> sort of structure, and builds a new one, is fairly easy to imagine?
> using the dread disable-output-escaping trick if you have to?
>
> The alternative is to wait 5 minutes, and wait for Michael B to show the
> really clever way.....
> --
> Sebastian Rahtz Information Manager
> Oxford University Computing Services
> 13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431
--
Tomaž Erjavec | Dept. of Knowledge Technologies
email: [log in to unmask] | Jozef Stefan Institute
www: http://nl.ijs.si/et/ | Jamova 39
fax: (+386 1) 477-3131 | SI-1000 Ljubljana, Slovenia
|