Re: Measuring the complexity of XSLT stylesheets
> you can go directly to DOM where you have more control and preformance efficience. Great point! XSLT as well as every other XML-centric technologies are designed as Domain Specific Languages. When you have crossed the line from one domain to another, using the proper language for this domain is the absolute right thing to do as opposed to FORCING a language to do something it wasnt designed to do. In Jun's example tinkering with the elements of the in-memory representation of a tree using DOM, which was designed for this type of operation, as opposed to making a copy of the portions of the tree you desire for your output - which is what is happening during the transformation process using XSLT - is a perfect example of using the right tool for the right job. XSLT is a great language but when theres something that is more appropriate for the task at hand -- pipeline it on over and leave XSLT to its lazy-natured self to enjoy some RR for a few minutes until the next job comes across the pipeline... On 4/17/05, Jun Zhang <june@xxxxxxxxxx> wrote: > > > M. David Peterson wrote: > > >> When you step back from that > >>mentality and simply design your XML and XSLT in such a way that there > >>is no need to climb up and down the tree to process the data then XSLT > >>is never complex. It may take a little getting used to the style and > >>as such seem a bit complex but after you just "let go and let God" as > >>the saying goes then your mind adjusts and it simply makes sense. It > >>seems to me that just about the time you find yourself having to write > >>complex code to make something work in XSLT is right about the time > >>you need to rethink things and realize you are doing things the hard > >>way (the procedural side of your brain if you will) and that there is > >>a much simpler approach that will work twice as efficient if you block > >>the procedural line of thinking and embrace the template-based > >>functional side of your brain > >> > >> > >> > >Totally agreeed. XSLT is easy in 95% of case and could be solved by "tempalte-based function". That's why we can develop > >Tiger XSLT Mapper. That's why drag & drop can make most XML-XML case work. If you really want to manipulate the tree in other 5% of case, you can go directly to DOM where you have more control and preformance efficience. > > > > > > June Zhang > > -- <M:D/> :: M. David Peterson :: XML & XML Transformations, C#, .NET, and Functional Languages Specialist
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