Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Parsing text with link from xml with XSLT [Thread Next] Re: Parsing text with link from xml with XSLTTo: NULL Date: 3/5/2008 2:07:00 AM On 5 Mar., 10:09, Johannes Koch <k...@w3development.de> wrote:
> 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.)
Thanks for you help Johannes, I only recently started working with xsl
and I hadn't really been able to figure out how apply template worked,
so I hadn't tried it much.
Appriciate your help, thank you!
Simon
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
