This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: xml2xml problem!


>
> ********************* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]