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

Split files with XSLT2.0 xsl:result-document

Subject: Split files with XSLT2.0 xsl:result-document
From: "Robert Soesemann" <rsoesemann@xxxxxxxxxxx>
Date: Mon, 6 Dec 2004 15:46:39 +0100
xml split file
Hello,

I am sure that <xsl:result-document> is perfect for my purpose. But I
still struggle with the following task. I have a (deep) folder structure
${in_dir} with xml files. Each file might hold multiple elements of type
contentitem
e.g. the fictious file bar.xml.

<root>
  <contentitem>
	...
  </contentitem>
  <contentitem>
	...
  </contentitem>
  <contentitem>
	<anchor name="xyz"/>	<--- NOT ALL CONTENTITEM HAVE A <anchor>
	...
  </contentitem>
</root>

I need to split this in a way that I get one file per <contentitem>. But
I need to preserve the folder structure plus modify the resulting
filename based on node values.

E.g. the input file:

\in_dir
	\foo
		\bar.xml

Needs to be splitted to

\out_dir
	\foo
		\bar1.xml		<-- number unnamed fragments
		\bar2.xml		<-- number unnamed fragments
		\bar#xyz.xml	<-- use /anchor/@name for name extension

Can anybody help me to solve this? Thanks in advance!

Robert

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.