[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Including http:// as 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|