V
Volker Lenhardt
I'm but an amateur with xsl stylesheets. I need some help to the output
of text nodes with embedded element nodes like the following:
<uf><ns>This</ns> example</uf>
<uf>Another <ns>This</ns> example</uf>
<uf>Another <ns>This</ns></uf>
I need to output the ns strings in italics.
<xsl:apply-templates select="./uf" />
<xsl:template match="ns">
<i><xsl:value-of select="." /></i>
</xsl:template>
As long as the xml file is exported in lines as above the output is ok:
"This example". (In this email I don't indicate the italicised part string.)
But lately the document server hosting the application that contains xml
files of the sort above changed the export of xml files. Now there are
line breaks at each new element boundary:
<uf>
<ns>This</>
example
</uf>
With my xsl code I get an additional space at the beginning and the end
of the phrase: " This example ". I tried to get rid of them with
<xsl:template match="text()">
<xsl:value-of select="normalize-space()" />
</xsl:template>
But this results in "Thisexample".
What is to be done? (There is no option to substitute the mandatory
spaces with ).
Volker
of text nodes with embedded element nodes like the following:
<uf><ns>This</ns> example</uf>
<uf>Another <ns>This</ns> example</uf>
<uf>Another <ns>This</ns></uf>
I need to output the ns strings in italics.
<xsl:apply-templates select="./uf" />
<xsl:template match="ns">
<i><xsl:value-of select="." /></i>
</xsl:template>
As long as the xml file is exported in lines as above the output is ok:
"This example". (In this email I don't indicate the italicised part string.)
But lately the document server hosting the application that contains xml
files of the sort above changed the export of xml files. Now there are
line breaks at each new element boundary:
<uf>
<ns>This</>
example
</uf>
With my xsl code I get an additional space at the beginning and the end
of the phrase: " This example ". I tried to get rid of them with
<xsl:template match="text()">
<xsl:value-of select="normalize-space()" />
</xsl:template>
But this results in "Thisexample".
What is to be done? (There is no option to substitute the mandatory
spaces with ).
Volker