[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Including http:// as value of href

Subject: RE: Including http:// as value of href
From: David Allouche <david@xxxxxxxxxxxxxxxx>
Date: Tue, 15 Aug 2000 22:56:18 -0200 (GMT+2)
xsl value of href
On Mon, 14 Aug 2000, Joshua Allen wrote:

> Try <xsl:value-of select="concat('http://',.)" />

> > I would like to
> > directly insert 'http://' into the beginning of the value of 
> > HREF.  I would
> > appreciate any instance. [...]
> > XSL [,,,]
> >         <xsl:attribute name="HREF">
> >         http://<xsl:value-of select="."/>
> >      </xsl:attribute>
> > [...]
> > HTML Output
> > <A HREF="
> >         http://www.ford.com">www.ford.com</A>


I find <value-of select="concat('string',XPath)"/> expression ugly -- just
my personal taste, inflenced by the default syntax hilighting in Emacs.

They can always be translated into something like:

  <xsl:text/>string<value-of select="XPath"/>

or 

  <xsl:text>string</xsl:text>
  <value-of select="XPath"/>

that in find more readable.

Whitespace handling in XSL/XML is a tricky issue.  What I keep I mind when
composing a stylesheet are the following rules:

1 - whitespace only nodes in the stylesheet are ignored
2 - any text node in the stylesheet that contains non-whitespace text is
    output literally
3 - use <xsl:text/> as a separator to put undesirable leading and trailing
    whitespaces in nodes of their own so that they are ignored
4 - when some leading/trailing whitespace is needed, use <xsl:text> with
    some content

In this case the attribute element in the stylesheet would become:

      <xsl:attribute name="href">
         <xsl:text/>http://<xsl:value-of select="."/>
      </xsl:attribute>


                             -- David --




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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.