> I'm afraid I didn't understand your recommendation. I've tried > changing the subroutine to accept several of the possible types > (Node, NodeIterator), etc, which worked in that the subroutine > was still being called. Gave up on that because I wasn't sure > where to go from there.
Good to hear that you've gotten to that point. You may wind up there again. I think Gary explained why the alternative String parameter wasn't working. > Are you saying the ONLY way to do this is to walk the tree in > hardcoded java? If so I'll dig in. But surely there's a way to > do this in xslt???? Coding a new treewalk? I hope not! (BTW I couldn't find anything about XSLT/Xalan multiple output documents - that's the only approach I know of that would be entirely within XSLT.) If you dig into org.apache.xalan.serialize.SerializerToHTML you might find some way to give it the RTF you got in addPage and make it spit out HTML. You'll also have to dump the stream into a String or buffer of some kind so you can hand it off to the Page constructer. Maybe java.io.ByteArrayOutputStream. But what does the Page constructor ultimately do with the body string? I'm just thinking that if it saves it to a file or streams it out a network port, there's not point in converting the RTF into a string first. Just point the serializer to the output stream or file. Yikes! It looks like a nasty plumbing job. As a last resort a two-pass (actually 1+N transforms) approach would have a greater likelihood of working. First pass gets the index information. Second pass iterates over the index from the first pass and repeatedly runs a transform with a parameter passed in to select which page to transform. I've used a similar technique where the first pass creates an Ant build file with a number of Style tasks. I can tell you more about that if you like.
