[[Note: this post is out of order because I sent to xalan-j-user by mistake.]]

> How to make it serialize the <page>...</page> content, processed by 
> apply-templates, to a
String while retaining all
xhtml markup?

Yup, that's a good problem! Obviously string($pageText) is not going to work 
because string()
strips all the markup from
the given result tree fragment. I don't think XSLT can do it, but maybe Xalan's 
multiple output
document feature (of
which I'm clueless) could HTML-serialize to a string that you could use within 
XSLT. The best
bet might be to use
org.apache.xalan.serialize.SerializerToHTML from within addPage.

Maybe you can rethink the problem. What I can see from your code is that you're 
launching a
transform from Task.java().
The transform does a callback to Task.addPage() with a result tree fragment 
(which you'd like
serialized to XHTML), and
addPage() calls Task.pages.add(new Page(Task, String, String IntegerField)). 
Now if
Task.addPage() is called only once
per transform, you could forego the callback and have the transform output to 
some kind of
String buffer (or even a
file). Then Task.java() could call Task.pages.add() with that String. Just an 
idea.

Brad Cox wrote:

> That's it!! Simple! Now I wonder why I didn't try that.
>
> One last glitch and I"m there. This is working except that its
> stripping the xhtml markup from $pageText. How to make it
> serialize the <page>...</page> content, processed by
> apply-templates, to a String while retaining all xhtml markup?
>
> <xsl:template match="page">
> <xsl:variable name="pageText">
> #parse("vel/macros.vel")
> #taskOpening("@ident")
> <xsl:apply-templates select="*"/>
> #taskClosing("@ident")
> </xsl:variable>
> <xsl:value-of select="task:addPage($task, string(@ident),
> string($pageText))" />
> </xsl:template>
>



Reply via email to