Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Parsing text with link from xml with XSLT >Thread Next - Re: Parsing text with link from xml with XSLT Re: Parsing text with link from xml with XSLTTo: NULL Date: 3/5/2008 10:09:00 AM
Simon Skov Boisen schrieb:
> I have an xml document like this:
>
> <paragraph>hello what are you doing? searching on <link url="http://
> www.google.com">google</link>?</paragraph>
>
> how can I extract data to xhtml from it so that it will be formatted
> as
>
> hello what are you doing? searching on <a href="http://
> www.google.com">google</a>?
>
> I've tried various different methods but I can't seem to combine the
> text in the <paragraph> with the <link> so either I select the text:
> "hello what are you doing? searching on google?" or I get the link <a
> href="http://www.google.com">google</a>
So you didn't try the most obvious one: xsl.apply-templates.
<xsl:template match="paragraph">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="link">
<a href="{@url}">
<xsl:apply-templates/>
</a>
</xsl:template>
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
