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

RE: combining XML documents


combine xml documents
Reading files from a directory might be possible using the collection() function in XSLT 2.0 or XQuery, but it depends on the implementation since the mapping of collection URIs to filestore isn't defined in the spec.
 
With Saxon you can do something like
 
<xsl:for-each-group select="collection('file://c:/some-directory?select=*.xml;recurse=yes')" group-by="/doc/title">
  <xsl:value-of select="/doc/title"/>
  <xsl:value-of select="count(current-group())"/>
</xsl:for-each-group>
 
to give you a flavour of what's possible; for a more specific solution one would need to know more about your requirements.
 
As far as the choice between XSLT and XQuery is concerned, I'm tending to sum it up like this:
 
(a) if your data is in a database, you need XQuery
(b) copying a document with small changes is much easier in XSLT
(c) extracting a small amount of information from your documents is easier in XQuery
(d) XQuery is easier to learn and is simpler for small jobs
(e) XQuery is better for highly-structured data, XSLT for loosely-structured documents
(f) for large applications involving reusable components, use XSLT
 
I'd encourage you to learn both, since 80% of what you learn will be applicable to both languages.
 
Michael Kay
http://www.saxonica.com/


From: Tomaz Kastrun [mailto:tomaz@w...]
Sent: 23 November 2005 13:32
To: xml-dev@l...
Subject: combining XML documents

Hi,
 
Before going into development of application, i have to make a portion using XML standards. So the following situation is:
 
1. several XML documents (all using the same DTD schema ) are uploaded onto server.
2. using XSL stylesheet, several information are being showed from all the XML files.
3. combining different information from different XML documents, new XML document is produced.
 
for the 2. step should I also use JAVA API for easier and faster processing of information?
for step 3. i don't know what is the best solution? again java? XQuery? XSLT?
 
are there any learn-samples to do this?
 
Thank you in advance,
 
best  Tomaz

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.