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: Normalizing string containing entities


Thank you very much for your help. In fact, I need to get one space between
each word where there was at least one space in the document. So :

some <em>text
some <em> text
some<em> text

should all result in :

some <em>text

but :

some<em>text

should not be changed.

I think I can get it to work now.

Thanks again,

Pierre-Yves

-----Message d'origine-----
De : owner-xsl-list@mulberrytech.com
[mailto:owner-xsl-list@mulberrytech.com]De la part de Wendell Piez
Envoyé : mardi 18 juillet 2000 11:29
À : 'xsl-list@mulberrytech.com'
Objet : Re: Normalizing string containing entities

[cut]

<x>
<para>Some    text    <em>some    other   text</em>   remaining text</para>
<para>Some    text<em>    some    other   text</em>   remaining text</para>
<para>Some    text    <em>   some    other   text</em>   remaining
text</para>
<para>Some    text    <em>some    other   text </em>   remaining text</para>
<para>Some    text    <em>some    other   text </em>remaining text</para>
<para> Some    text    <em>some    other   text</em>   remaining text
</para>
</x>

We get output (using Saxon)
<x>
   <para>Some text <em>some other text</em> remaining text</para>
   <para>Some text<em>some other text</em> remaining text</para>
   <para>Some text <em>some other text</em> remaining text</para>
   <para>Some text <em>some other text</em> remaining text</para>
   <para>Some text <em>some other text</em>remaining text</para>
   <para>Some text <em>some other text</em> remaining text</para>
</x>

If you wanted to get space before the <em> element in the second case or
after in the fifth case, the logic could be extended to catch them (left as
an exercise :-).



 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]