[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: I don't get it... line breaks (sorry, I know this

Subject: Re: 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
xsl attribute line break
If you want a linebreak in the output (character 10) just put one in the
template:

    <xsl:template name="MAKE_HIDDEN_ATT">
     <xsl:text>&#10;</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>&#10;</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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.