[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Mixing pull and push
Problem. The lack of structure in a DTD I've been given is causing me a headache. Its essentially an XHTML subset. h1 to h4, usual mix of p, ul, ol etc. The problem centres around trapping Hx elements in push elements, then using moded templates for non Hx elements. Previously I've either pushed or pulled, this is the first time I've had to do both together. I'd assumed that I could have nop templates (unmoded) to handle all the push elements. I'm basically looking for an output (xml) that looks like <h1><head>Old h1 content</head any content up to next sibling Hx, copied would do it, but lets say p maps to xp, table to xtable etc. <h2><head>Old h2 content</head> ditto nesting down to h4's </h2> </h1> <h1><head> etc. the algorithm to validate which levels to close and so on would be straightforward in an ordinary language, but I'm having difficulties using XSLT for it. Since I'm basically dealing with the sibling axis, I'm finding that I'm double processing elements, once, when I pull them using apply-templates select="following-sibling::.... and then again as a response to either a moded template or a non moded template. I'm looking for an approach that sounds reasonable in outline. I've tried 3 so far, and each works simplistically, but falls down with real content. the only time I want to use xsl:apply-templates/> is with the (very) few actual nested elements such as lists and tables. Any suggestions appreciated. 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
|