Subject: [xsl] Removing Newlines From: Greg Kushmerek <gkushmer@xxxxxxxxxxxxx> Date: Tue, 11 Jun 2002 17:21:22 -0400 |
I need to remove newlines from the <o><o/> element in the following XML:
<Synopsis> <c>mmerge</c> <o>[-n] [-to <var>tag</var>|<var>rev</var>] [-from <var>tag</var>|<var>rev</var>] [-v[<var>N</var>]] [-mytag] [-noeditor] [mput_options] <var>file</var>...</o>
<c>mmerge</c> <o>[-n] [-to <var>tag</var>|<var>rev</var>] [-v[<var>N</var>]] [-noeditor] [mput_options] -j <var>job@cluster</var> [...]</o> </Synopsis>
My XSLT has a strip-space declaration for all of the Synopsis element, which I'm assuming covers child elements too?
Yes or no, I then tried a normalize-space function on the <o> element, but this made the transformed text ignore the <var> child element translation instructions.
My next step was to try to use translate function to translate newlines into whitespace. I did it like this:
<!-- o template --> <xsl:template match="o"> <xsl:text /><xsl:value-of select="translate(.,' ','')" /><xsl:text /> </xsl:template>
Greg Kushmerek Sr. Technical Writer IA/Tools The MathWorks (+1) 508-647-7136
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Problems generating a link in, Doug Metcalfe-White | Thread | Re: [xsl] Removing Newlines, Wendell Piez |
RE: [xsl] Grouping and Sorting on v, Hunsberger, Peter | Date | RE: [xsl] Grouping and Sorting on v, Wendell Piez |
Month |