xsl-list
[Top] [All Lists]

RE: [xsl] Test for child node categories

2007-07-04 08:11:36
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

e.g.

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

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
it.

Cheers
T


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>