Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. output space in html from xml and xsl

output space in html from xml and xsl

Scheduled Pinned Locked Moved XML / XSL
xmlhelpquestionhtml
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shiby
    wrote on last edited by
    #1

    I've a xml file which contains some spaces that i need to display in html when transform using xsl sample xml file

    <root>
    <child name="The quick brown fox jump over the lazy dog"/>
    </root>

    As you see in the above sample xml, it contains lots of spaces that i need to display same in html. how do i do that? The issue is in html it render as The quick brown fox jump over the lazy dog. instead of

    The quick brown fox jump over the lazy dog.

    Is there any way by which modifying the xsl gives me the same result. Any help is highly appreciated.

    P S P 3 Replies Last reply
    0
    • S Shiby

      I've a xml file which contains some spaces that i need to display in html when transform using xsl sample xml file

      <root>
      <child name="The quick brown fox jump over the lazy dog"/>
      </root>

      As you see in the above sample xml, it contains lots of spaces that i need to display same in html. how do i do that? The issue is in html it render as The quick brown fox jump over the lazy dog. instead of

      The quick brown fox jump over the lazy dog.

      Is there any way by which modifying the xsl gives me the same result. Any help is highly appreciated.

      P Offline
      P Offline
      Perspx
      wrote on last edited by
      #2

      Replace each space with &nbsp;? Regards, --Perspx

      "The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia

      1 Reply Last reply
      0
      • S Shiby

        I've a xml file which contains some spaces that i need to display in html when transform using xsl sample xml file

        <root>
        <child name="The quick brown fox jump over the lazy dog"/>
        </root>

        As you see in the above sample xml, it contains lots of spaces that i need to display same in html. how do i do that? The issue is in html it render as The quick brown fox jump over the lazy dog. instead of

        The quick brown fox jump over the lazy dog.

        Is there any way by which modifying the xsl gives me the same result. Any help is highly appreciated.

        S Offline
        S Offline
        Shiby
        wrote on last edited by
        #3

        Assume that i cannot modify xml file. How to replace spaces with & nbsp; in xsl.. any function? please give me an xsl example... Thanks in advance.

        1 Reply Last reply
        0
        • S Shiby

          I've a xml file which contains some spaces that i need to display in html when transform using xsl sample xml file

          <root>
          <child name="The quick brown fox jump over the lazy dog"/>
          </root>

          As you see in the above sample xml, it contains lots of spaces that i need to display same in html. how do i do that? The issue is in html it render as The quick brown fox jump over the lazy dog. instead of

          The quick brown fox jump over the lazy dog.

          Is there any way by which modifying the xsl gives me the same result. Any help is highly appreciated.

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          As Perspx said. You may be able to do it with the translate function, I haven't tried it. Otherwise, maybe you could perhaps insert pre or div tags around the text.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups