[Home] [By Thread] [By Date] [Recent Entries]
Doug,
At 01:39 PM 12/21/2008, you wrote: Thank you ... I had thought of using perl. In fact the transformation script is a perl script that first converts from SGML to XML and then changes graphic names and bunch of other strings. The problem for me with perl is that I have to do more work to handle items, like elements starting on one line and finishing on another. I wanted to move from my serial and string based approach to XSL thinkin' I could get my skills more current and do more with less effort. This is true, and the fact that you've happened on a counter-example doesn't disprove it in the general case. Extension functions like Saxon's parse() and serialize() allow you to cross the line that XSLT draws between string processing and tree transformation. Similarly, many processors have various ways of calling out to external utilities. But part of the issue here is that your requirement implicitly asks for a change in the XML text stream (write comment delimiters around a chunk of tags-and-text), not in the tree that results from parsing it. (Even using saxon:serialize() you may not get precisely the same tagging inside the comment as you had before your file was parsed.) Accordingly, a clean solution would work on that level. For example, a SAX filter could perform your task simply and fast. Cheers, Wendell
|

Cart



