This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: RE: How to transform <BR> to </P><P>


Adam wrote:

><TEXT>This is first paragraph.<BR />Second paragraph.</TEXT>

>Then <TEXT> has 3 children, there is:
>	TEXT/text() -- This is the first paragraph
>	TEXT/BR
>	TEXT/text()	-- This is the second paragraph

>Each block of text that is a child of >text is its own text node.


Dimitre and Adam, 

Thanks a lot for your explanations. You two are abosolutely correct.
However, I should have given all the details at the beginning:

There are more than <BR> and text() as children of <TEXT>. And I wish to
break the text into paragraphs only when it reaches a <BR TYPE="END">. 

Input xml:
<TEXT>
	text1
	<BR TYPE="SOFT">
	text2
	<BR TYPE="END">
	text3<NODE TYPE="SPECIAL" VALUE="HEX 27"
/>text4<AUTOITALIC>text5</AUTOITALIC>text6
	<!-- there are other similar elements like NODE or AUTOITALIC among
text nodes-->
	<BR TYPE="END">
	<BR TYPE="END">
	<BR TYPE="END">
</TEXT>

Output xml:
<TEXT>
  <P>
    text1 text2
  </P>
  <P>
    text3&#039;text4<ITALIC>text5</ITALIC>text6
  </P> <!-- The last three BRs will be treated as one. -->
</TEXT>

Any thoughts? Again, thank you for your help.

Cheers,
Chris
	




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]