xsl-list
[Top] [All Lists]

Re: Paragraphs in Word XML

2006-01-04 09:01:17
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[(_at_)tag='NOTE'] as separate p
elements.

I'm not clear what you mean by "paragraph mark". That term usually means
the pilcrow character (¶ 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[(_at_)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


--~------------------------------------------------------------------
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>