kmartin7
asked on
normalize-space for entire document?
Does anyone have an idea how to use normalize-space for an entire document? I have a mixutre of element and mixed nodes, and keeping the mixed nodes proper has been difficult.
TIA
TIA
ASKER
Hi Geert,
For some reason, I have never been able to get that to work. I have tried it on different parsers with the same result each time. Here is a snippet. As you can see, we would like to remove all that extra space for the authors.
Thanks.
For some reason, I have never been able to get that to work. I have tried it on different parsers with the same result each time. Here is a snippet. As you can see, we would like to remove all that extra space for the authors.
Thanks.
<para>Text and more text (
<xref type="figure" idref="i0f3a011"></xref>) text and more text:
</para>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yeah, it doesn't quite give us what we need. It is just a bad having all collapse. We are just going to use SS with the editor options and then run a series of find/replace to add spaces before and after certain instances.
Thanks anyway.
Kurt
Thanks anyway.
Kurt
cheers
<xsl:preserve-space elements="elements go here space seperated"/>
tends to work, in the preserve space you could put the mixed content elements, for whom space preservation is important
that ofcourse doesn't normalize the whitespace inside PCDATA streams
note that msxml and xml spy do the wrong thing with whitespace only text nodes
or you could make a multi-pass, with the second pass being an identity transform that normalize-spaces every text node
in XSLT2, you can easily add both passes inone stylesheet
(or you could do that using node-set() if your processor supports that)