[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: best practices, insert PI with XSLT or otherwise?
On 3 February 2010 05:35, G. Ken Holman <gkholman@xxxxxxxxxxxxxxxxxxxx> wrote: > At 2010-02-02 23:14 -0500, Hoskins & Gretton wrote: >> >> HI, I have a set of XML files in which I want to insert a processing >> instruction after the XML declaration. I could use a text function type of >> "search and replace" or XSLT identity template + override. I work with a >> Java programmer, so everything can be solved best with Java from her point >> of view, and I work with XSLT, so you know my preference. Is there ever a >> reason that a non-XSLT process would be better than XSLT? > > When that Java programmer doesn't know how to work with Unicode. A couple > of times now I've supplied a pure XML/XSLT solution to a customer only to > have them make an 11th hour change using Java in the last mile of delivery > and having the Java programmer muck up the encoding in the file. > > Reading the XML Declaration (or lack thereof) informs the Java programmer > about the character set for the rest of the document, but they may not know > that and just blindly run the file through their "quick and dirty and why > should I bother debugging such a simple change" program like a bull in a > china shop breaking things along the way. It would be rare that the Java programmer would need to determine the encoding from the xml declaration, they should really be operating on the parsed content (sax events, some object model etc) It's often because XML appears so simple ("its just angle brackets, right?") and parsing, manipulating and serialising it with Java such a pain, that many devs choose to just process it as a string... I reckon that's the reason behind the majority of requests to preserve entities in the output. -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|