[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Compound filter in for-each
Alan,
You are certainly welcome to the help. Considering your posts, I also think you would be well served by a good introductory treatment or tutorial. Not only are you still guessing when it comes to the XPath, but also it appears that your code is not yet taking advantage of the XSLT processing model, which is characterized by a general preference for template matching over explicit conditionals using xsl:choose or xsl:if. This isn't surprising if you're new to the language. Template matching requires a rather different kind of thinking from the imperative statements typical of procedural languages, although it is just as predictable and logical once you get the hang of it. Related to this, it appears that a good part of the reason why you aren't using a template matching approach is that you are faced with a kind of problem (essentially, flattening a very regular structure) that doesn't need it and wouldn't necessarily even take advantage of it. In a sense, the problem you are solving hasn't actually demanded that you "take the plunge". While XSLT is perfectly able to do what you're doing with it, it doesn't have to do it in a particularly XSLT-like way. Other kinds of problems, on the other hand.... Competency in XSLT really requires at least two things: proficiency (if not absolute mastery) of XPath syntax, and a certain comfort level with the related concept of context (which you've now taken in) and the applying and matching of templates that is at the heart of its processing model. This is the case even (or especially) when working with problems that are outside the core problem domain of straightforward conversions of semi-structured input. (As noted, your input looks very structured.) I bet if you take a few hours to study the language on its own (on the net or with a good book), if only as an academic exercise and out of curiosity, you'll be much better able to move forward and learn more quickly. Questions you might ask yourself are: What are templates and how to they work? What sorts of transformation problems take advantage of templates? What does the basic grammar of XPath look like? Put this together with what you've recently learned about processing context, and you'll be well on your way. Cheers, Wendell
|
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
|