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

RE: Restructure via grouping

Subject: RE: Restructure via grouping
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 9 Feb 2005 13:40:55 -0000
RE:  Restructure via grouping
This isn't grouping, it's ungrouping.

<xsl:template match="root">
<doc>
  <fragments>
    <xsl:copy-of select=".//fragment"> 
  </fragments>
</doc>
</xsl:template>

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: Robert Soesemann [mailto:rsoesemann@xxxxxxxxxxx] 
> Sent: 09 February 2005 12:49
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Restructure via grouping
> 
> How can I do the following restructuring? Do I need to use grouping?
> 
> Inside and outside of my <doc> node there are <fragment> nodes. I want
> to collect them all and place them insde a new <fragments> tag. 
> 
> So for this input:
> 
> <root>
> 	<doc>
> 		<fragment pos="1"/>
> 		<fragment pos="2"/>
> 		<fragment pos="3"/>
> 	</doc>
> 	<fragment pos="4"/>
> 	<fragment pos="5"/>
> </root>
> 
> I would need the following output:
> <root>
> 	<doc>
> 		<fragments>
> 			<fragment pos="1"/>
> 			<fragment pos="2"/>
> 			<fragment pos="3"/>
> 			<fragment pos="4"/>
> 			<fragment pos="5"/>
> 		</fragments>		
> 	</doc>
> </root>
> 
> I played around with generate-key() a little bit, but could 
> not make it.
> Can you help.
> 
> Thanks in advance.

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.