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

RE: How does one go about extracting HTML anchors from

Subject: RE: How does one go about extracting HTML anchors from an XML file?
From: "Swen Thuemmler" <Swen.Thuemmler@xxxxxxxxxxxx>
Date: Tue, 18 Sep 2001 10:09:32 +0200 (CEST)
RE:  How does one go about extracting HTML anchors from
On Mon, 17 Sep 2001, Liat Jacob wrote:

[...]

> Here's the XML file:
>
> <article>
>    <summary>
>       <p>blah blah blah blah blah blah
>          blah <href link='www.yahoo.com'> some link text here</href>blah
> 	 blah blah <a mailto="jacob_liat@xxxxxxxxxxx>some text here</a>
> 	 blah blah.</p>
>       <p>second paragraph with additional anchors embedded
>          throughout the paragraph text.</p>
>    </summary>
> </article>
>
> I want the HTML to look like this:
>
> <P>blah blah blah blah blah blah blah <A HREF="http://www.yahoo.com"> some
> link text here</A> blah blah blah <A HREF="mailto:jacob_liat@xxxxxxxxxxx";>
> some text here</A> blah blah blah.</P>
>
> <P>second paragraph with additional anchors embedded throughout the
> paragraph text.</P>

How about:

<xsl:template match="p">
  <P><xsl:apply-templates/></P>
</xsl:template>

<xsl:template match="href">
  <A HREF="{@link}"><xsl:apply-templates/></A>
</xsl:template>

<xsl:template match="a">
  <A HREF="mailto:{@mailto}";><xsl:apply-templates/></A>
</xsl:template>

(this is untested, but Should Work(TM))

Hope this helps.

--Swen



 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.