Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Creating links using XSLT

Reply
Thread Tools

Creating links using XSLT

 
 
carlosramirez
Guest
Posts: n/a
 
      11-11-2005
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>(E-Mail Removed)</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
 
Reply With Quote
 
 
 
 
Stephane Roux (HAbeTT)
Guest
Posts: n/a
 
      11-11-2005
In <kJVcf.80079$An6.78148@trnddc08>, carlosramirez wrote:

> <users>
> <user>
> <name>User1</name>
> <email>(E-Mail Removed)</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
 
Reply With Quote
 
 
 
 
Stephane Roux (HAbeTT)
Guest
Posts: n/a
 
      11-11-2005
In <(E-Mail Removed)>, Stephane Roux (HAbeTT)
wrote:

> In <kJVcf.80079$An6.78148@trnddc08>, carlosramirez wrote:
>
>> <users>
>> <user>
>> <name>User1</name>
>> <email>(E-Mail Removed)</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
 
Reply With Quote
 
carlosramirez
Guest
Posts: n/a
 
      11-11-2005
Stephane Roux (HAbeTT) wrote:
> In <kJVcf.80079$An6.78148@trnddc08>, carlosramirez wrote:
>
>
>><users>
>><user>
>><name>User1</name>
>><email>(E-Mail Removed)</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!
 
Reply With Quote
 
JAPISoft
Guest
Posts: n/a
 
      11-12-2005
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>(E-Mail Removed)</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>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple XSLT Transforms using a Controller XSLT sneill@mxlogic.com XML 2 10-19-2005 11:00 AM
ANN: New low-cost XML Editor, XSLT Editor, XSLT Debugger, DTD/Schema Editor Stylus Studio Java 0 08-03-2004 03:53 PM
weird links in PDF from XML and xslt using FOP Jurrie XML 0 10-06-2003 08:26 AM
[XSLT]Passing values from Javascript to a XSLT variable Benjamin Hillsley XML 3 09-25-2003 04:50 AM
Links/ampersands in HTML tags using XML/XSLT SDM XML 2 09-22-2003 02:01 PM



Advertisments