XML to HTML Character Escaping


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: XML to HTML Character Escaping

  1. #1
    Colin Guest

    XML to HTML Character Escaping

    I've got an xsl stylesheet transforming an xml file into html. It works
    fine, including using <xslutput mode="html"> to control the style of
    output.

    My problem is that I need to output an href value which contains an
    ampersand. i.e. something like:

    <A HREF="page.asp?value1=Hello&value2=World">

    The output always has the & replaced with &amp; which I of course don't
    want. I've tried all sorts including a script function to build the string
    and using a CDATA section containing the & but the & still gets changed.

    Any ideas?




  2. #2
    Hetal Guest

    Re: XML to HTML Character Escaping


    Hi,
    Try using 38 instead of &amp; it is the numeris value for ampersand.
    Regards
    hetal
    "Colin" <colinm@zy.com> wrote:
    >I've got an xsl stylesheet transforming an xml file into html. It works
    >fine, including using <xslutput mode="html"> to control the style of
    >output.
    >
    >My problem is that I need to output an href value which contains an
    >ampersand. i.e. something like:
    >
    ><A HREF="page.asp?value1=Hello&value2=World">
    >
    >The output always has the & replaced with & which I of course don't
    >want. I've tried all sorts including a script function to build the string
    >and using a CDATA section containing the & but the & still gets changed.
    >
    >Any ideas?
    >
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center