This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Including http:// as value of href
- To: "xsl-list at mulberrytech dot com" <xsl-list at mulberrytech dot com>
- Subject: RE: Including http:// as value of href
- From: David Allouche <david at ansible dot xlii dot org>
- Date: Tue, 15 Aug 2000 22:56:18 -0200 (GMT+2)
- Reply-To: xsl-list at mulberrytech dot com
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