473,226 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

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

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:DrTebi@yahoo.com">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:Dr****@yahoo.com">DrTebi</a>

Now I tried this in the XSL stylesheet:
<a><xsl:attribute
name="href"><![CDATA[mailto:DrTebi@yahoo.com]]></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;&a mp;#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

Jul 20 '05 #1
1 11386
In article <pa***************************@yahoo.com>,
DrTebi <Dr****@yahoo.com> wrote:

[...]

% Now I tried this in the XSL stylesheet:
% <a><xsl:attribute
% name="href"><![CDATA[mailto:DrTebi@yahoo.com]]></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;&a mp;#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
pt**@interlog.com
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nimmi Srivastav | last post by:
When I was learning C, I learned that the data type of a function name by itself is a function pointer. For example int someFunction(char* str) { .... }
6
by: adnanx82 | last post by:
Hi, I was wondering if anyone knew how to perform the following 2 tasks in Javascript: 1) distinguish between frames and iframes (during an onload event for example) 2) figure out whether a...
7
by: John Nagle | last post by:
I've been parsing existing HTML with BeautifulSoup, and occasionally hit content which has something like "Design & Advertising", that is, an "&" instead of an "&amp;". Is there some way I can get...
3
by: Goran Djuranovic | last post by:
Hi all, I ran into a problem where my XMLTextReader fails on .Read() when I have "<" character in one of the attribute's values. What I am trying to do is replace illegal characters ("<", "&" ,...
14
by: arnuld | last post by:
i have slightly modified the programme from section 1.5.1 which takes the input frm keyboard and then prints that to the terminal. it just does not run and i am unable to understand the error...
3
by: John Nagle | last post by:
I have XML replies in a DOM which contain entity escapes, like "&amp;". What's the proper way to replace them with the ordinary characters? Preferably something that will work in most browsers? I...
5
by: coldstar | last post by:
In an ASP Querystring, how do I include the double quotes in the code below at "1.0" part as text in my string? I have tried ""1.0"" and almost everything else but can't get it to work. I need...
30
by: Medvedev | last post by:
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at...
4
by: Winks | last post by:
How do I print the "&" symbol in an Access 2007 report? The help system says I should use the ASCI character 38 while holding the Alt key. This works---I can see it in the caption property, but...
3
by: yuanyun.ken | last post by:
hi,dear all js gurus. In my app, server responses some text like: '&nbsp;&nbsp; ' and I need display these content in textarea. But Html would convert specail characters to space, and ignore line...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.