This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Output a link in a transformation to html


Luare-

XSLT needs to be well-formed XML.  I'd suggest doing some reading on exactly
what that means.  http://www.w3.org/XML/ should provide you with a few links
for starters.  The reason that is not well-formed is because <xsl:value-of/>
is an element.  Since HREF is an attribute, it cannot have complex (element)
content.  It also must enclose its content in " or '.  The solution to your
problem would look something like this:
    <h3>Web: <a><xsl:attribute name="href" select="."/><xsl:value-of
select="."/></a></h3>

or (using an Attribute Value Template):

    <h3>Web: <a href="{.}"><xsl:value-of select="."/></a></h3>

Hope that helps,
Nate
naustin@idsgrp.com

>Date: Wed, 31 May 2000 21:37:07 +0200
>From: "Luare" <luare@wanadoo.es>
>Subject: [xsl] Output a link in a transformation to html
>
>    Hi,
>
>I am doing a transformation from xml to html.
>This example is not well-formed, why?
>
>    <H3>Web: <A HREF= <xsl:value-of select="."/>> <xsl:value-of
select="."/>
></A></H3>
>
>The expresion <xsl:value-of select="."/> return a string, doesn't it?
>
>If I put    "<xsl:value-of select="."/>"
>or     string(<xsl:value-of select="."/>)
>the error is the same.
>
>It seem a tipical error, but I am a beginner.
>
>Thanks

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]