Altova Mailing List Archives

RE: [xsl] Test for child node categories

From: "Trevor Nicholls" <trevor@------------------>
Date: 7/4/2007 3:12:00 PM
Thanks for the node tests, useful. May I ask a follow up question?

>> In the output HTML an <answer> element is going to generate a <div>, and
>> case (a) will require a <div><p>...</p></div>, while in case (b) a simple
>> <div>...</div> will suffice.
> it depends how your stylesheet is structured, but it is rather rare that
> you need any explict test, usually you just let the templates for (say)
> answer/para generate the needed <p> element.,

Yes that's fine, it's the mixed content I have a problem with, i.e.

(c) a mixture of textcontent and blockcontent children


   What was the question? Oh yes:
   <para>To be, or not to be></para>
   <em>That</em> was the question.

My standard para template will deal with the central <para> element, but the
first text child, and the children which follow the para, both need to be
encapsulated in <p> elements.

This is a pathological case but I still want to generate conformant HTML for



These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.