[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Should I use XSLT or DOM
>The destination tree will be >different from the source tree with element >and attribute values from the source tree >becoming element/attribute values of a >totally different tree structure. No problem. XSLT allows you to completely reorganize the data; that's one of its major advantages over the relatively simple CSS model. Your example's a bit too fuzzy to come up with specific examples -- you show the reorganization, but it isn't clear what principles are being applied to produce that result. Still, there should be plenty of XSLT examples out there demonstrating this capability and the principles behind it. Basically, an XSLT template can specify a mixture of What kinds of nodes it will be applied to What data gets pulled out of the source document (from the current node or others) What happens to that data (what markup it's combined with to generate the output) Which other nodes should be considered for further processing. Moving data around is just a matter of adjusting where you look for it and what you wrap around it. As to whether to use XSLT or the DOM -- That depends on the details of the problem, the level at which you want to work with it, who you expect will be maintaining this in the future. XSLT's a higher-level language, which means some things are more elegant and some are less so. Driving things via pattern-matching, as XSLT does, may make your tranformation more robust if the document's structure changes... or may just mean that it fails silently. Screw guns make poor hammers, hammers make poor screwdrivers, but each can do some things better than the other. ______________________________________ Joe Kesselman / IBM Research 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
|