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

Re: can restructure xml??

Subject: Re: can restructure xml??
From: michael.h.kay@xxxxxxxxxxxx
Date: Wed, 15 Jan 2003 16:34:53 +0000
how to restructure xml
You want something like

<xsl:template match="title">
<item>
  <xsl:copy-of select=". |
         following-sibling::writer[1] |
         following-sibling::type[1] |
         following-sibling::remark[1]"/>
</item>
</xsl:template>

Michael Kay
         
> 
> From: "a847356549/mail.h7.dion.ne.jp" <motom@xxxxxxxxxxxxx>
> Date: 2003/01/15 Wed AM 11:32:02 GMT
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  can restructure xml??
> 
> hello.
> I just started putting my data into xml.
> now I only have a xml like ---
> 
> <root>
>   <list>
>     <title>aaa</title>
>     <writer>bbb</writer>
>     <type>ccc</type>
>     <remark>ddd</remark>
>     <title>eee</title>
>     <writer>fff</writer>
>     <type>ggg</type>
>     <remark>hhh</remark>
>     ...
>   </cd>
> </list>
> 
> my ideal structure is like ---
> 
> <root>
>   <list>
>    <item num="1">
>     <title>aaa</title>
>     <writer>bbb</writer>
>     <type>ccc</type>
>     <remark>ddd</remark>
>    </item>
>    <item num="2">
>     <title>eee</title>
>     <writer>fff</writer>
>     <type>ggg</type>
>     <remark>hhh</remark>
>    </item>
>     ...
>   </list>
> </root>
> 
> is there a way to do this throgh xsl?  any advice and hint will
>  be grateful. 
> 
> ttkaya
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


 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.