how can I display "&#34" etc. after xml-xsl transformation?

Discussion in 'XML' started by DrTebi, Jun 25, 2004.

  1. DrTebi

    DrTebi Guest

    Hello,
    I have the following problem:
    I used to "encode" my email address within links, in order to avoid (most)
    email spiders. So I had a link like this:
    <a
    href="mailto:D">DrTebi</a>

    This would work like a regular mailto link in any browser, but wouldn't be
    visible to spiders if they don't have a function to decode it.

    The problem is if I use this in an XSL stylesheet, it gets converted to my
    email address:
    <a href="mailto:D">DrTebi</a>

    Now I tried this in the XSL stylesheet:
    <a><xsl:attribute
    name="href"><![CDATA[mailto:D]]></xsl:attribute>DrTebi</a>

    But that resulted in
    <a
    href="mailto:&amp;#68;&amp;#114;&amp;#84;&amp;#101;&amp;#98;&amp;#105;&amp;#64;&amp;#121;&amp;#97;&amp;#104;&amp;#111;&amp;#111;&amp;#46;&amp;#99;&amp;#111;&amp;#109;">DrTebi</a>

    --which does not work in a browser as a link.

    Can anyone please point me to the right direction?

    Thanks,
    DrTebi

    P.S.: I am using PHP5 for XML/XSL transformations, which is based on
    libxml2
     
    DrTebi, Jun 25, 2004
    #1
    1. Advertising

  2. In article <>,
    DrTebi <> wrote:

    [...]

    % Now I tried this in the XSL stylesheet:
    % <a><xsl:attribute
    % name="href"><![CDATA[mailto:D]]></xsl:attribute>DrTebi</a>
    %
    % But that resulted in
    % <a
    % href="mailto:&amp;#68;&amp;#114;&amp;#84;&amp;#101;&amp;#98;&amp;#105;&amp;#64;&amp;#121;&amp;#97;&amp;#104;&amp;#111;&amp;#111;&amp;#46;&amp;#99;&amp;#111;&amp;#109;">DrTebi</a>

    Try
    <a><xsl:attribute name="href">
    <xsl:text>mailto:</xsl:text>
    <xsl:text disable-output-escaping='yes'><![CDATA[Dr]]></xsl:text>
    <xsl:text disable-output-escaping='yes'><![CDATA[Te]]></xsl:text>
    <xsl:text disable-output-escaping='yes'><![CDATA[bi]]></xsl:text>
    <xsl:text disable-output-escaping='yes'><![CDATA[@y]]></xsl:text>
    <xsl:text disable-output-escaping='yes'><![CDATA[ah]]></xsl:text>
    <xsl:text disable-output-escaping='yes'><![CDATA[oo]]></xsl:text>
    <xsl:text disable-output-escaping='yes'><![CDATA[.c]]></xsl:text>
    <xsl:text disable-output-escaping='yes'><![CDATA[om]]></xsl:text>
    </xsl:attribute></a>

    (that is, try disable-output-escaping -- I've just put several of them
    there to keep the line lenghts shorter)
    --

    Patrick TJ McPhee
    East York Canada
     
    Patrick TJ McPhee, Jun 27, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hugo Ferreira
    Replies:
    0
    Views:
    393
    Hugo Ferreira
    Jul 14, 2004
  2. John
    Replies:
    1
    Views:
    969
    Bob Foster
    Oct 22, 2003
  3. Replies:
    0
    Views:
    560
  4. bizt
    Replies:
    2
    Views:
    558
    Joseph J. Kesselman
    Jul 11, 2008
  5. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    456
    Fredrik Lundh
    Aug 13, 2008
Loading...

Share This Page