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. &lt; symbols in <xsl:text xmlns:xsl="#unknown"></xsl:text>

&lt; symbols in <xsl:text xmlns:xsl="#unknown"></xsl:text>

Scheduled Pinned Locked Moved XML / XSL
questionxmlhelp
4 Posts 4 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.
  • D Offline
    D Offline
    danielk_
    wrote on last edited by
    #1

    How do I generate a < symbol using xsl:text? I have the following:

    <xsl:text disable-output-escaping="yes">
    a < b
    </xsl:text>

    but this would generate an error, (unexpected token) If I use:

    <xsl:text disable-output-escaping="yes">
    a < b
    </xsl:text>

    the text that is generated is a < b what would I need to do to have a < b to be generated? thanks

    S M E 3 Replies Last reply
    0
    • D danielk_

      How do I generate a < symbol using xsl:text? I have the following:

      <xsl:text disable-output-escaping="yes">
      a < b
      </xsl:text>

      but this would generate an error, (unexpected token) If I use:

      <xsl:text disable-output-escaping="yes">
      a < b
      </xsl:text>

      the text that is generated is a < b what would I need to do to have a < b to be generated? thanks

      S Offline
      S Offline
      Saul Johnson
      wrote on last edited by
      #2

      Hi! Hmmm... the last code example you provided works fine for me. But if you're sure you're doing everything else right, try changing your output type to HTML:

      <xsl:output method="html"/>

      Add this just below your xsl:stylesheet tag if you don't already have an output type, change it to "html" if you do. It could work but I can't replicate your problem so I have no way to be sure. Hope This Helps! MrWolfy :-D

      1 Reply Last reply
      0
      • D danielk_

        How do I generate a < symbol using xsl:text? I have the following:

        <xsl:text disable-output-escaping="yes">
        a < b
        </xsl:text>

        but this would generate an error, (unexpected token) If I use:

        <xsl:text disable-output-escaping="yes">
        a < b
        </xsl:text>

        the text that is generated is a < b what would I need to do to have a < b to be generated? thanks

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        You can always use a CDATA section if the & escape is causing problems.

        --Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ "That's what's great about doing user interface work. No matter what you do, people will say that what you did was idiotic." -- Raymond Chen

        1 Reply Last reply
        0
        • D danielk_

          How do I generate a < symbol using xsl:text? I have the following:

          <xsl:text disable-output-escaping="yes">
          a < b
          </xsl:text>

          but this would generate an error, (unexpected token) If I use:

          <xsl:text disable-output-escaping="yes">
          a < b
          </xsl:text>

          the text that is generated is a < b what would I need to do to have a < b to be generated? thanks

          E Offline
          E Offline
          Erik Westermann
          wrote on last edited by
          #4

          Just use entity references: < > and & It might be messy to go through an entire XML doc to convert values containing these special characters so, in the past, I used to just load the XML into a XML DOM object and then get it again - the DOM object does the conversion for you! (ignore the HTML tags in my sig - I turned off HTML so that the entity references show up) Erik Westermann - wWorkflow.net - BizTalk Consulting Services SOA * ESB * BPI * SaaS ... forget the alphabet soup - get the main course with our consulting services! wWorkflow.net or +1 416-809-1453

          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