On 5/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
First advice: DON'T output badly-formed documents. Set output mode to HTML (since that seems to be what you want to produce) and see if that gets you close enough. Then fix or replace whatever downsteam tool isn't accepting them.
I'm mostly wanting it for generating custom SVGs I wish that I could somehow fix the broken downstream tool, but adding a new input format to the php engine would take quite a bit of time if I could get them to agree to it in the first place. The actual purpose in using this preprocessor is I want to be able to do automated verification and transformation of my documents before they turn into php, since php requires writing invalid documents in certain situations.
If you can't take that advice: 1) Have Xalan output SAX, and plug its output into your own SAX-to-appropriately-broken-HTML serializer.
I don't think I can really do this, can I? I would get the startElement event and then the processingInstruction event, but I couldn't distinguish between: <auth name="<?php print $test ?>" /> and <auth name=""><?php print $test ?></auth>
2) Generate well-formed documents, then run some kind of text-based postprocessor that patches whatever the broken tool is unwilling ot accept.
I suppose this is what I need to do. I dislike php forces such a kludge, but it has far and away the best install base at this point, so I really need to generate it. Thank you for your replies. It saved me several hours of wandering confusedly through code trying to figure out what to do. Will