Re: [xsl] I don't get it... line breaks (sorry, I know this has been discussed many times)

Subject: Re: [xsl] I don't get it... line breaks (sorry, I know this has been discussed many times)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 1 May 2003 16:25:25 +0100
If you want a linebreak in the output (character 10) just put one in the

    <xsl:template name="MAKE_HIDDEN_ATT">
     <input type="hidden">
            <xsl:attribute name="name">typ_<xsl:value-of
            <xsl:attribute name="value"><xsl:value-of

That could be more easily written

    <xsl:template name="MAKE_HIDDEN_ATT">
     <input type="hidden" name="typ_{@name}" value="{@type}"/>

   I'm guessing that when you
  "apply-templates" that the loop which occurs naturally (and I call it a
  "natural" loop for lack of a better term) there in the match creates line
  breaks in the source.  Correct?

I have trouble parsing that but I suspect it is confused.
If you use apply-templates without a select attribute and get line
breaks in the output then most likely this is because you have applied
templates to the text nodes in the input that contain the line breaks,
and the default template for text nodes copies them to the result.

but by going  <xsl:for-each select="$xmTmplt/FLD"> you are just applying
things to FLD element nodes and skipping over the text nodes in teh
source, so they are not copied.


This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

 XSL-List info and archive:

Current Thread