You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Julian <ce...@yahoo.com> on 2005/10/13 17:14:35 UTC

XML Merge Best Practices

Hi all, 

I have some (generally 2-4) XML documents (approx. 200
KB in size) that I would like to merge.   The
documents would have the same id attributes and tag
names.  The tags which share the same name and id
attribute should be merged into one node, and any
content within the original two nodes merged and
appended in the new node.  The resulting merge would
create one XML document.  Considering the size of the
documents, what is the most efficient
approach...Aggregation via the sitemap? XSLT?
SAX ala JAXP? DOM ala JAXP? or some other approach?

Thanks in Advance,
Julian

Live simply so others may simply live. 
 
-Ghandi 
 
Pluralitas non est ponenda sine neccesitate.
"Entities should not be multiplied unneccesarily" 
 
-William of Occam





	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XML Merge Best Practices

Posted by Julian <ce...@yahoo.com>.
Hi,,

Thanks for all the feedback.  As I thought more about
my requirements of counting nodes in the documents, I
realized that writing a SAX parser to do such a trick
would quite simple and more efficient than XSLT and
DOM afaik.  I thank you again for the info, which I
have found valuable in my analysis.

Regards,
Julian

--- Dan Durkin <dd...@scilearn.com> wrote:

> Julian,
> 
> You may want to look using the cinclude transformer
> and then some 
> additional xslt transformations for the merging
> logic.
> 
> HTH,
> 
> Dan
> 
> 
> Julian wrote:
> > Mark,
> > 
> > Does XSLT stream or does it use DOM via Cocoon
> > pipelines?  I plan on doing some further
> processing of
> > the merged document afterwards and thinking of
> using
> > XSLT there too.  If you want more details, I
> > summarized the overall process below.
> > 
> > Thanks,
> > Julian
> > 
> > 
> > *********
> > My goal is to count the number of given elements
> in
> > the original documents.  My plan is to merge the
> > documents and then pass the merged document
> through a
> > stylesheet that would give me a count of the
> number of
> > child nodes within certain parent nodes with given
> id
> > attributes.  The count would be placed into a new
> XML
> > doc. via XSLT that would be 10kb of less, and that
> > would be easily loaded into DOM and parsed.
> > 
> > 
> > 	
> > 		
> > __________________________________ 
> > Yahoo! Mail - PC Magazine Editors' Choice 2005 
> > http://mail.yahoo.com
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail:
> users-help@cocoon.apache.org
> 
> 


Live simply so others may simply live. 
 
-Ghandi 
 
Pluralitas non est ponenda sine neccesitate.
"Entities should not be multiplied unneccesarily" 
 
-William of Occam





		
__________________________________ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XML Merge Best Practices

Posted by Dan Durkin <dd...@scilearn.com>.
Julian,

You may want to look using the cinclude transformer and then some 
additional xslt transformations for the merging logic.

HTH,

Dan


Julian wrote:
> Mark,
> 
> Does XSLT stream or does it use DOM via Cocoon
> pipelines?  I plan on doing some further processing of
> the merged document afterwards and thinking of using
> XSLT there too.  If you want more details, I
> summarized the overall process below.
> 
> Thanks,
> Julian
> 
> 
> *********
> My goal is to count the number of given elements in
> the original documents.  My plan is to merge the
> documents and then pass the merged document through a
> stylesheet that would give me a count of the number of
> child nodes within certain parent nodes with given id
> attributes.  The count would be placed into a new XML
> doc. via XSLT that would be 10kb of less, and that
> would be easily loaded into DOM and parsed.
> 
> 
> 	
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XML Merge Best Practices

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 13 oct. 05, à 17:51, Julian a écrit :

> ...Does XSLT stream or does it use DOM via Cocoon
> pipelines?...

 From the Cocoon side of things (pipelines), processors would stream, 
but I *think* all current XSLT processors load the whole document in 
memory, as a DOM processor would do.

Nico Verwer's presentation of last week 
(http://www.cocoongt.org/Slides-and-recordings.html) contains some 
interesting info about this.

-Bertrand


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XML Merge Best Practices

Posted by Julian <ce...@yahoo.com>.
Mark,

Does XSLT stream or does it use DOM via Cocoon
pipelines?  I plan on doing some further processing of
the merged document afterwards and thinking of using
XSLT there too.  If you want more details, I
summarized the overall process below.

Thanks,
Julian


*********
My goal is to count the number of given elements in
the original documents.  My plan is to merge the
documents and then pass the merged document through a
stylesheet that would give me a count of the number of
child nodes within certain parent nodes with given id
attributes.  The count would be placed into a new XML
doc. via XSLT that would be 10kb of less, and that
would be easily loaded into DOM and parsed.


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XML Merge Best Practices

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Oct 13, 2005, at 8:14 AM, Julian wrote:

> I have some (generally 2-4) XML documents (approx. 200
> KB in size) that I would like to merge.   The
> documents would have the same id attributes and tag
> names.  The tags which share the same name and id
> attribute should be merged into one node, and any
> content within the original two nodes merged and
> appended in the new node.  The resulting merge would
> create one XML document.  Considering the size of the
> documents, what is the most efficient
> approach...Aggregation via the sitemap? XSLT?
> SAX ala JAXP? DOM ala JAXP? or some other approach?

Note, <map:aggregate> does not merge documents.  It aggregates :-).

I would lean toward XSLT.
—ml—




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org