473,382 Members | 1,717 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,382 software developers and data experts.

Creating links using XSLT

I'm just starting with XSLT and I'm having problems generating links.
Here's a snippet of my xml file:

users.xml

<users>
<user>
<name>User1</name>
<email>te**@server.com</email>
</user>
....
</users>

My XSL file is as follows:

<xsl:for-each select="users/user">
<a href="<xsl:value-of select="email" />"><xsl:value-of
select="email"/></a>
</xsl:for-each>

I keep getting the error "XML Parsing Error: not well-formed" at the
line number that contains the email.

My question, how can I generate the following string: <a
href="mailto:$email">$email</a>

Thanks.

-Carlos
Nov 11 '05 #1
4 4576
In <kJVcf.80079$An6.78148@trnddc08>, carlosramirez wrote:
<users>
<user>
<name>User1</name>
<email>te**@server.com</email>
</user>
...
</users>

My XSL file is as follows:

<xsl:for-each select="users/user">
<a href="<xsl:value-of select="email" />"><xsl:value-of
select="email"/></a>


<a href="mailto:{email}"><xsl:value-of> select="email" /></a>

--
|":._.:"| http://habett.com/
| (=) | http://habett.org/
\...:.../ Iyonix - PC - iBook
Nov 11 '05 #2
In <a0***************@habett.habett.org>, Stephane Roux (HAbeTT)
wrote:
In <kJVcf.80079$An6.78148@trnddc08>, carlosramirez wrote:
<users>
<user>
<name>User1</name>
<email>te**@server.com</email>
</user>
...
</users>

My XSL file is as follows:

<xsl:for-each select="users/user">
<a href="<xsl:value-of select="email" />"><xsl:value-of
select="email"/></a>


<a href="mailto:{email}"><xsl:value-of> select="email" /></a>


<a href="mailto:{email}"><xsl:value-of select="email" /></a>

--
|":._.:"| http://habett.com/
| (=) | http://habett.org/
(..'|'..) Birthdays are the cult of growing old
Nov 11 '05 #3
Stephane Roux (HAbeTT) wrote:
In <kJVcf.80079$An6.78148@trnddc08>, carlosramirez wrote:

<users>
<user>
<name>User1</name>
<email>te**@server.com</email>
</user>
...
</users>

My XSL file is as follows:

<xsl:for-each select="users/user">
<a href="<xsl:value-of select="email" />"><xsl:value-of
select="email"/></a>

<a href="mailto:{email}"><xsl:value-of> select="email" /></a>


Thanks!
Nov 11 '05 #4
Try this :

<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="email" />
</xsl:attribute>
</xsl:element>

Best regards,

A.Brillant
EditiX - XML Editor and XSLT Debugger
http://www.editix.com
Stephane Roux (HAbeTT) wrote:
In <kJVcf.80079$An6.78148@trnddc08>, carlosramirez wrote:

<users>
<user>
<name>User1</name>
<email>te**@server.com</email>
</user>
...
</users>

My XSL file is as follows:

<xsl:for-each select="users/user">
<a href="<xsl:value-of select="email" />"><xsl:value-of
select="email"/></a>

<a href="mailto:{email}"><xsl:value-of> select="email" /></a>

Nov 23 '05 #5

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

Similar topics

2
by: SDM | last post by:
I need to create a stylesheet to allow the querystring in my attribute links to format as: <TD<A href='IQNet.asp?f=2&t=3'>Choice 1</A></TD> not <TD<A href='IQNet.asp?f=2&amp;t=3'>Choice...
0
by: Jurrie | last post by:
Hi all, I have a XML-document which i want to transform into PDF with apaches FOP. In my XML document i have <href> tags that are links to either a chapter in the document or to a place on the...
4
by: TP | last post by:
Hi, I have reached a situation where I have to create small pieces of xml (around 8k characters) within my java app. Right now I am using stringbuffer to create the xml which does not go against...
2
by: Bob | last post by:
I have an xml document that I xslt into html for display. I include various links to external (html) documents based on the specific data encountered by the xslt transform. I would like to...
0
by: Thomas Scheffler | last post by:
Hi, I runned in trouble using XALAN for XSL-Transformation. The following snipplet show what I mean: <a href="http://blah.com/?test=test&amp;test2=test2">Test1&amp;</a> <a...
6
by: petermichaux | last post by:
Hi, I have an XML document that I am transforming with XSLT. The XML is like this <departments> <department> <name>Dept1</name> <uri>http://www.domain.com/index.php?dept=1</uri>...
1
by: Ron Vecchi | last post by:
I'm pretty new to XSLT so bear with I have an XML file that contains Names and ID's of a bunch of widgets. Using XSLT I would like to output an <A> link with the Widget's ID as part of the query...
1
by: Thom Anderson | last post by:
Hi, I'm a newbee at XML so I need to ask this. I have an xml data like follows. <?xml version="1.0" encoding="utf-8" ?> <salesRep repnum="123" orgdate="16"> <fname>Joe</fname>...
4
by: Mario Vázquez | last post by:
Hi, I'm trying to put the links (href attribute of the <a> element) out of my XSLT files, in a XML file, and read it from the stylesheet. I suppose that I have to use the document() function to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.