Is there a way to get xml to IGNORE < and >

Discussion in 'XML' started by Eric, Feb 12, 2007.

  1. Eric

    Eric Guest

    I'm trying to build a mailto url like so:

    <td class="{$sData}"><![CDATA[<a href="mailto:]]><xsl:value-of
    select="email"/><![CDATA[?subject=Support question">]]><xsl:value-of
    select="email"/><![CDATA[</a>]]></td>

    The html that's rendered looks like I would expect my html source to,
    however in the source there are &lt; and &gt; chraracters so my links
    don't work. Any way to get it to just spit out what I have onto the
    page?

    -Eric
     
    Eric, Feb 12, 2007
    #1
    1. Advertising

  2. Eric

    Guest

    On Feb 12, 9:38 am, "Eric" <> wrote:
    > I'm trying to build a mailto url like so:
    >
    > <td class="{$sData}"><![CDATA[<a
    > href="mailto:]]><xsl:value-of
    > select="email"
    > /><![CDATA[?subject=Support question">]]><xsl:value-of
    > select="email"/><![CDATA[</a>]]></td>
    >
    > The html that's rendered looks like I would expect my
    > html source to, however in the source there are &lt; and
    > &gt; chraracters so my links don't work. Any way to get
    > it to just spit out what I have onto the page?


    There is a way, but I'm not going to tell you, since it's
    an obvious case of XY problem. Instead, here's the Right
    Way to solve your problem:

    <td class="{$sData}">
    <a>
    <xsl:attribute name="href">
    <xsl:text>mailto:</xsl:text>
    <xsl:value-of select="email"/>
    <xsl:text>?subject=Support question</xsl:text>
    </xsl:attribute>
    <xsl:value-of select="email"/>
    </a>
    </td>

    --
    Pavel Lepin
     
    , Feb 12, 2007
    #2
    1. Advertising

  3. schrieb:
    > <xsl:text>?subject=Support question</xsl:text>


    A ' ' is not allowed in URLs, so change ot to Support%20question

    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)
     
    Johannes Koch, Feb 12, 2007
    #3
  4. Eric

    Guest

    On Feb 12, 12:59 pm, Johannes Koch <>
    wrote:
    > schrieb:
    >
    > > <xsl:text>?subject=Support question</xsl:text>

    >
    > A ' ' is not allowed in URLs, so change ot to
    > Support%20question


    Indeed. Although using an url-encode template would've been
    an even better solution.

    --
    Pavel Lepin
     
    , Feb 12, 2007
    #4
    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. Replies:
    4
    Views:
    380
    Branimir Maksimovic
    Oct 20, 2005
  2. =?ISO-8859-15?Q?Juli=E1n?= Albo

    cin.ignore... better way wanted...

    =?ISO-8859-15?Q?Juli=E1n?= Albo, Oct 29, 2006, in forum: C++
    Replies:
    6
    Views:
    416
    =?ISO-8859-15?Q?Juli=E1n?= Albo
    Oct 29, 2006
  3. lightning
    Replies:
    7
    Views:
    1,401
  4. Replies:
    7
    Views:
    264
  5. Rob Meade
    Replies:
    6
    Views:
    268
    Rob Meade
    Mar 1, 2004
Loading...

Share This Page