[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Converting XML <link> to HTML anchor
Like this: <xsl:template match="*"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="text"> <xsl:apply-templates/> </xsl:template> <xsl:template match="link"> <a href="{@href}"> <xsl:apply-templates/> </a> </xsl:template> Mike Kay > -----Original Message----- > From: Michael Teigman [mailto:michael.teigman@xxxxxxxxxxx] > Sent: 08 December 1999 22:49 > To: xsl-list@xxxxxxxxxxxxxxxx > Subject: Converting XML <link> to HTML anchor > > > I have an xml like this: > > <text> > <p>Text1</p> > <p>Text2 <link href="link1">label1</link></p> > <p><link href="link2">label2</link></p> > <p>Text3 <link href="link3">label3</link> text4 <link > href="link4">label4</link> text 5</p> > </text> > > You get the idea ... there might be any of the possible > variations of these - > including an unlimited(!!??) number of links within a paragraph. > > I want to output an HTML which will replace all the <link> > elements with > anchors. > For example I want from the above: > > <p> > <p>Text1</p> > <p>Text2 <a href="link1">label1</a></p> > <p><a href="link2">label2</a></p> > <p>Text3 <a href="link3">label3</a> text4 <a > href="link4">label4</a> text > 5</p> > </p> > > I am using XT. How do I write an XSL Transform to handle all > the variations? > > mike > > > ----------------------------------------------------------------- > Visit our Internet site at http://www.reuters.com > > Any views expressed in this message are those of the individual > sender, except where the sender specifically states them to be > the views of Reuters Ltd. > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > 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
|