Re: When *not* to use XLST...
XSLT is fantastic for allowing me to define XML and then create dynamic text boxes, check boxes, and radio buttons. However, it gets more complicated as need to add some advanced features.
Complicated is a relative term
I'm wondering if I should just create a (programming) class to handle my XML pages and have my back-end code read the XML directly and create the dynamic HTML instead.
Different strokes for different folks.
As I said earlier, I'm brand-new to XML (as of about two weeks ago), and have just pieced a bunch of things together from Google searches to get it working so far. I wouldn't really say I "know" XSLT -- only that I have "been using" XSLT.
Not a problem since you are just creating static HTML that will be delivered to the browser for filling in.
2. If I have many simple controls in a row, for example 15 checkboxes, I'd like to have them two or three per line, rather than one per line. Of course, it has to gracefully handle a number of items which doesn't divide evenly by the desired number per line.
Not a problem and since you are creating static HTML using XSLT 2 has features to make this easier than when using XSLT 1.
3. Some XML nodes of the same type may have some, but not all, possible attributes. The HTML for one case can be different than another.
Not a problem.
It seems that XSLT is designed to turn XML data into a formatted document,
And a formatted document is represented using structured markup.
rather than use XML data to create dynamic forms,
... which is just represented using structured markup. No difference.
and maybe I should just be writing code. I just wanted to check in with the list to see whether the problem is more due to my lack of knowledge about XSLT than limitations of XSLT.
Let me say it isn't the limitations of XSLT.
If that's the case, let me know, and please recommend the best book for becoming a proficient user of XSLT.
"Best" is a relative term. I sell a PDF book off my web site (with perpetual free updates and a freely-downloaded preview; customers of my book in 1999 have received 12 free updates since). For paper books many people like Michael Kay's books and many people like Jeni Tennison's books.
Hands-on training classes are also offered by reputable companies. Many people find my classes useful and my next publicly-subscribed class is in the Los Angeles area in June. The hands-on class covers every element, every attribute, every function and every keyword of XSLT, XPath, and XQuery. The following week is a class covering every formatting object of XSL-FO.
Many people find the classes Mulberry Technologies useful and they also have expert trainers who live and breath what they are talking about.
A final note which may help clarify what I'm asking for: The two most challenging problems I've had so far were how to get the value of an attribute of a parent node in the XSLT section that processes the child, and how to check to see whether any of the child nodes had a specific value in a named attribute when processing the parent node. Both are trivial to do with a class in a programming language by just accessing a property or method. To be fair they're trivial in XSLT as well,
Indeed they are trivial.
but the syntax to do takes a long time to discover by Google searches.
I wouldn't think this is an effective way to learn any new language.
I hope this helps.
. . . . . . . . . . . . Ken
-- XSLT/XSL-FO/XQuery hands-on training - Los Angeles, USA 2009-06-08 Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
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