Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Placing two XSL values on same line

    I am trying to add the Xsl value of sale price and the xsl if value of You Save $x.xx - (x%) on the same line. So it looks something like this:

    Regular Price: $x.xx
    Sale Price: $x.xx - You Save $x.xx (x%)

    So far I can get it on two separate lines - but not one. Any ideas?

    Code:
    <div>
    <span>
    <h4><xsl:attribute name="id">VariantPrice_<xsl:value-of select="VariantID"/></xsl:attribute></h4>
    <h3><xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes"/></h3>
    <h5><xsl:if test="SalePrice > 0">You Save $<xsl:value-of select="format-number((Price - SalePrice),'##.00')" />  (<xsl:value-of select="100-(round((format-number (SalePrice div Price,'##.00'))*100))" />%)
    </xsl:if></h5>
    </span>
                </div>

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,350
    Thanks
    13
    Thanked 349 Times in 345 Posts
    then don’t use a block element for each part.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,316
    Thanks
    29
    Thanked 279 Times in 273 Posts
    Quote Originally Posted by wing43215 View Post
    So far I can get it on two separate lines - but not one. Any ideas?
    Block-level elements, such as the h# elements, create automatic line breaks.

    It's worth noting that you've improperly nested h# elements within a span element; that isn't allowed in HTML and may result in odd layout behaviors because you're nesting block-level (h#) elements within an inline (span) element.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •