Re: [xsl] Paragraphs in Word XML

Subject: Re: [xsl] Paragraphs in Word XML
From: Peter Flynn <pflynn@xxxxxx>
Date: Wed, 04 Jan 2006 16:01:17 +0000
On Wed, 2006-01-04 at 13:52, Kaila Kaarle wrote:
> Hello,
> 
> I have an xml file containing the data for my genealogical report. It contains table elements and section elements and within sections there are person - relation and notices elements.
> Notices elements contain notice elements with information such as birth dates and places but also long texts about what the person did. The text is divided into para elements and some of them must be written into separate paragraps in the output.
> 
> Word XML requires that <body> element contains <p> (paragraph) elements. When I use XSTL to create my document I would usually transform one section in my XML into a <p> element in Word XML. But if the text contains paragraph marks I need to fininsh the current Word paragraph and start a new one (with a different style) but I don't know if I can do that in XSLT.
> 
> I'll add an example at the end of this message of my xml.
> 
> My xml looks like this: All of it should go to one pargraph if the <notice tag="NOTE"> would not contain the <para type="NEW"> element. The rest of the text should go to the second paragraph. 

Just output the para elements within notice[@tag='NOTE'] as separate p
elements.

I'm not clear what you mean by "paragraph mark". That term usually means
the pilcrow character (6 or &#x00B6;) and there aren't any of those in
your document.

> How can I split the text in the example into two different elements on
> output???

But it's already in separate para elements. Just output them:

  <xsl:template match="notice[@tag='NOTE']">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="para">
    <p>
      <xsl:apply-templates/>
    </p>
  </xsl:template>

Or have I misunderstood the problem?

///Peter

Current Thread