[xsl] Wrapping pieces of content separately

Subject: [xsl] Wrapping pieces of content separately
From: <Emily.Garrett@xxxxxxxxxxx>
Date: Thu, 24 Aug 2006 14:41:09 -0400
I'm trying to convert XML into WordML and going from a recursive
structure to linear is difficult.  I  would like to try to read in XML
and output in tags like this in a recursive (normal) manner as an
intermediate step:

<p>title</p>
<p>paragraph</p>
<p>Here is a table from <r>hyperlink</r> which is below. <table>sldfkj
lsdfj lsd f</table> The above table was very small. <ul> <p>list
title</p> <p><li>Item 1</li></p><p><li>Item 2</li></p>The rest of it.
</p>

I would want to end up with this structure shown below (I don't need to
keep the <ul>), where I would take the nested <p> elements out and
structure them in a linear manner.  The content in the root level <p>
gets wrapped in separate <p> elements. This is the structure I need to
create,  but I would use WordML format in this step.:

<p>title</p>
<p>paragraph</p>
<p>Here is a table from <r>hyperlink</r> > which is below. </p>
<table>sldfkj lsdfj lsd f</table>
<p>The above table was very small. </p>
<p>list title</p>
<p><li>Item 1</li></p>
<p><li>Item 2</li></p>
<p>The rest of it.</p>

The problem is that content at the root needs to be in <p> tags, such as
"The above table was very small" and "The rest of it".   How do I
instruct the processing of it, not knowing the order?   Using
xsl:apply-templates will put <p> elements nested in other <p> elements
which won't work.  I need them to be divided into linear segments. I
thought if I could change them into a simpler set of tags, it might be
easier.  But I may not even need the intermediate step.

Thanks for any help you can provide.


Emily Garrett

Current Thread