I am using XML to store a small contact list and trying to write a XSL template that will transform it into a CSV file. The problem I am having is with whitespace in the out
This answer may not direct answer to the problem. But a general way solve this issue. Create a template rule:
Now call it to remove excess white-space:
For example, consider the below XML fragment:
some text some other text some other text
And if someone likes to convert it to below text:
{test{my-element{e1some text} {e2some other text} {e3some other text}}}
Now comes the stylesheet:
{
}
{
}
After applying the stylesheet, it produce:
{test{my-element{e1some text} {e2some other text} {e3some other text}}}
{test
some text some other text some other text
}
The output describes how @mode="t1"
(
approach) differs from the @mode="t2"
(xsl:call-template
approach). Hope this helps somebody.