make a space in between data in xsl

Discussions

XML & Web services: make a space in between data in xsl

  1. make a space in between data in xsl (7 messages)

    hi there , may i know how can i make a "space" in between to data ...

    <TD><xsl:value-of select="weight"/> "need a space here" <xsl:value-of select="weight/@units"/></TD>

    Threaded Messages (7)

  2. try &#83;#32; . Its basically escaping the & of space. Hence its equivalent to &amp;nbsp; when parsed would result &nbsp;

    Hope this helps.

    Rakesh.
  3. re:[ Go to top ]

    hi there thanks for the reply

    but after using that code the result is
    12S#32;pound
  4. Try this[ Go to top ]

    Try adding disable-output-escaping="yes" in your <xsl:value > tag.
    Roman
  5. Um. Can you not use xsl:text?

    <xsl:value-of select="foo"/><xsl:text> </xsl:text></xsl:value-of select="bar"/>


    Paul
  6. still no space[ Go to top ]

    hmm not sure why , but all of those doesnt give a space in between the values ...
  7. still no space[ Go to top ]

    Hmm. You could also try the following, which will insert a unicode non-breaking space into the XML stream.

    <xsl:value-of/> <xsl:value-of/>

    It would help a lot to know what the context of your question is:
    * Are you using any particular framework (e.g. cocoon?)
    * What are you using to serialise the resulting XML into HTML that the browser can understand? (i.e. what do you have after the XSLT transformation)
      * Your HTML serialiser is responsible for turning the   into something meaningful from an HTML point of view as the stream is serialized. If you're not using a serialiser, or you're using something hand-crafted, this may be your problem. The suggestions of trying to do &amp;nbsp; shouldn't work if you're using a proper serializer, because it will render the '&' in the output stream as &amp; again.

    Hope that helps...

    Paul
  8. The "" didn't work for me. I used: <![CDATA[ ]]>