Subject: Re: Replace all occurrences From: Miloslav Nic <nicmila@xxxxxxxx> Date: Wed, 11 Aug 1999 15:33:58 +0200 |
XPath draft: http://www.w3.org/TR/xpath Henrik Andersson wrote: > > Thank you very much! > > The example really helped me. Just one more question. Where can I read > more about the "translate()"-function? > > Thanks again! > /Henrik > > Miloslav Nic wrote: > > > > look at example 28 of > > http://zvon.vscht.cz:/HTMLonly/XSLTutorial/Books/Book1/index.html > > for an example.(It is not general, but it should work in your case) > > > > Henrik Andersson wrote: > > > > > > Hi! > > > > > > I have some xml looking like this: > > > > > > <?xml version="1.0"?> > > > <citylist> > > > <distance city="A">1 HOURS</distance> > > > <distance city="B">2 HOURS</distance> > > > <distance city="C">30 MINUTES</distance> > > > <distance city="D">6 HOURS</distance> > > > </citylist> > > > > > > ...and some xsl looking like this: > > > > > > <xsl:stylesheet xmlns:xsl='http://www.w3.org/XSL/Transform/1.0'> > > > <xsl:template match="citylist"> > > > <xsl:for-each select="distance"> > > > <xsl:value-of select="@city"/> > > > <xsl:text>=</xsl:text> > > > <xsl:value-of select="."/> > > > <xsl:text> </xsl:text> > > > </xsl:for-each> > > > </xsl:template> > > > </xsl:stylesheet> > > > > > > Together this creates this: > > > > > > A=1 HOURS B=2 HOURS C=30 MINUTES D=6 HOURS > > > > > > This is the "result" I wan't besides that instead of the words "HOURS" > > > and "MINUTES" I wan't it to say "Hour" and "Minutes", with the first > > > letter as a capital and the rest as small letters. Is this possible to > > > do with xsl? > > > > > > Thanks! > > > /Henrik > > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > > -- > > *************************************************************** > > Dr. Miloslav Nic e-mail: nicmila@xxxxxxxx > > Department of Organic Chemistry TEL: +420 2 2435 5012 > > ICT Prague (VSCHT Praha) +420 2 2435 4118 > > FAX: +420 2 2435 4288 > > **************************************************************** > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list -- *************************************************************** Dr. Miloslav Nic e-mail: nicmila@xxxxxxxx Department of Organic Chemistry TEL: +420 2 2435 5012 ICT Prague (VSCHT Praha) +420 2 2435 4118 FAX: +420 2 2435 4288 **************************************************************** XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Replace all occurrences, Henrik Andersson | Thread | DocBook XSL Stylesheets V0.10 relea, Norman Walsh |
eval tags and IE5, John Gardner | Date | Re: integrate a special link, Miloslav Nic |
Month |