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 template: <xsl:template name="MAKE_HIDDEN_ATT"> <xsl:text> </xsl:text> <input type="hidden"> <xsl:attribute name="name">typ_<xsl:value-of select="@name"/></xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="@type"/></xsl:attribute> </input> </xsl:template> That could be more easily written <xsl:template name="MAKE_HIDDEN_ATT"> <xsl:text> </xsl:text> <input type="hidden" name="typ_{@name}" value="{@type}"/> </xsl:template> 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. David ________________________________________________________________________ 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: http://www.star.net.uk ________________________________________________________________________ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] I don't get it... line breaks, Karl J. Stubsjoen | Thread | Re: [xsl] I don't get it... line br, Mike Haarman |
RE: [xsl] I don't get it... line br, Sundar Shanmugasunda | Date | Re: [xsl] how to get rid of tag nam, Andrew Watt |
Month |