[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Exclude elements in transformation
Im not sure if I completely understand what you are trying to do. Ive checked
your mentioned thread it seems that you are really trying to use template
matching rules to group/ungroup, include/exclude data elements which is going to
be better served by grouping the data together in the correct layout/format
first and then apply-templates to the resulting temporary tree. Let me know if
the following concept is what you are ultimately attempting to accomplish...
<area> <section-title>this element could be a title or a subtitle based on whether there are any preceding sections who order of precedence is higher based on a proprietary hierarchal data structure</section-title> <section-title>If within the same "area" parent there is a preceding-sibling by my same name then I should output as an "h2" element HTML heading tag. If I am the first one then I should be output as an "h1" element tag.</section-title> <section-title>Im the back-up title in case any of my older brother and sisters lose their birth order or have been banished from the family all together for deeds we won't mention on this family oriented email list.</section-title> </area> If the above is anything close to what you are trying to accomplish why not run a first pass of "rules" that are in a separate and maintainable XML file and use document order and structure to determine whether or not an element makes "the cut". For example... <data rulesStructure="one"> <a>foo</a> <b>foo2</b> <c>better than foo!</c> <d>foo who?</d> <e>i'm an independent</a> </data> could easily be pre-processed with: <rules rulesStructure="one"> <a> <b> <c priority="1"/> <d priority="1"/> </b> </a> <e alwaysInclude="true"/> </rules> These could be "woven" with a pre-processor that would match the ruleStructure attribute value of each XML file and then use the structure of the matching rules element hierarchal data structure to state: "a" element is king if he maintains. if "a" chose to entertain over maintain then "b" gets the gig, but if "b" is out of the question then both "c" and "d" are going to have to do it together until one of them decides to either give it up to the other or somehow find a way to run things together peacefully. We'll keeps tabs on them and change there priority appropriately. "e" has always been responsible and loved by the family but ultimately is an outsider. He gets precedence only if everyone else is out of the picture but hes always going to be in the family picture even if a half shot of him leaning in to get into the outside view of the lens is all he ever gets. I realize this is a cheezy example but if the concept is even close to what you are ultimately trying to accomplish as far as making document order and hierarchal decisions as to what does and does not get processed then why not utilize the vast capabilities of describing a HUGE amount of information with a separate and easily maintainable hierarchal-based external rules file that can pre-process the data to the point that in the end the only thing being output is the absolute correct data using standard apply-templates to output things in the correct hierarchal structure and be reassured that if a last minute change shows up it will be taken care by one tiny hierarchal change or priority increase or decrease and then use standard logic building templates and your job is done. A combination of standard template rules, key elements and function, and the generate-id() function and your 95% done... Let me know if this "concept" helps things and I can help get you going on the right track if necessary... Best of luck! <M:D/> Sonke Ruempler wrote: Sonke Ruempler <mailto:ruempler@xxxxxxxxxxxxxxx> wrote on Thursday, September 16, 2004 11:58 AM:
|
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
|