This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xml2xml problem!
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] xml2xml problem!
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Wed, 8 Aug 2001 09:38:42 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
>
> ********************* source xml ************************
> ...
> <para>
> <mediaobject>
> <imageobject>
> <imagedata fileref="Title00.png" format="PNG"/>
> </imageobject>
> </mediaobject>
> <ulink url="http://www.hotmail.com/"></ulink></para>
> <para>
> ...
> ***************** end source xml ************************
>
> ********************* Output xml ************************
> ...
> <para>
> <ulink url="http://www.hotmail.com/">
> <imagedata fileref="Title00.png" format="PNG"/>
> </ulink>
> </para>
> <para>
> ...
> ***************** end Output xml ************************
>
>
> How is the XSL look like if i want to convert the part of
> source xml to the output xml like above ?
<xsl:template match="para">
<para>
<ulink url="{ulink/@url}">
<imagedata fileref="{mediaobject/imageobject/imagedata/@fileref}"
format="{mediaobject/imageobject/imagedata/@fileref}"/>
</ulink>
</para>
</xsl:template>
This will transform the paragraph you've shown us correctly. Of course I
have no idea if it will do anything useful with any other <para> elements,
since I've no idea what those look like.
Mike Kay
Software AG
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list