[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: [XSL] Controlling Output Based on XML Processing I
Matthew,
This can be done, but.... At 04:30 PM 1/18/02, you wrote: Dear fellow list members; Actually they are, unless you mean by "node hierarchy" that the processor ought to know that you mean the characters "insertStart" to "start" something, and "insertEnd" to stop something (the same something), etc. In other words, they can't perform the function that is so natural for elements, wrapping something up. is it possible to use them in XSL to control things such as whether anything between the <?insertStart?> and <?insertEnd?> is included in the XSL output and anything between the <?deleteStart?> and <?deleteEnd?> is not included in the output? Yes, it is, but it's fairly painful. A simple SAX or SAX-like filter in the language of your choice would be a far easier and more natural way to do this. I know that it is possible to use the processing-instruction() function to get the name and text values of the content, but it seems that it would be difficult to use this to control the output. In principle, yes. You'd have to worry about parsing the content of the PI in XSLT (fairly painful), then instituting its logic, which as I suggested would have to make up for the fact that the "start/end" semantics of your PI pairings aren't built in. If you don't want to solve the problem in a serial filter that works directly over the data stream, a simpler pre-process (Perl, sed, what have you) that would change the PIs into honest element start- and end-tags would give you element containment, would make the job way way easier in XSLT. Has anyone done anything like this before? I'm beginning to think someone's tried just about everything in XSLT in its short life. But I wouldn't recommend doing this. It's be a classic case of the golden hammer used to tighten a nut. Cheers, Wendell ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|