|
From: Stefan K. <ste...@co...> - 2003-07-16 05:44:32
|
Jonathan,
if there is no veto from anybody else, please change the name as I have not
the newest version here in development.
Thanks, I really appreciate working with all of you guys.
Stefan
-----Ursprüngliche Nachricht-----
Von: Leech, Jonathan [mailto:jl...@vi...]
Gesendet: Dienstag, 15. Juli 2003 23:59
An: 'Stefan Krieger'; bab...@li...
Betreff: RE: [Babeldoc-devel] Splitting Document with Attributes
Stefan,
I implemented the "splitAttributes" option in PipelineStage.java, so any
PipelineStage that can split up documents can use it. I had the same
requirement for XPathSplitter... splitAttributes defaults to false. The
code I commited looks almost identical to your patch -- One difference and
something to watch out for is to not copy the DomifyPipelineStage.DOM_KEY --
this is used to cache the DOM representation of a document, to avoid
reparsing, and if you copy this attribute, you will get weird results down
the line if you use any of the XML parsing pipelines. They will be
effectively running against the XML document before you split it up...
I like the name "copyAttributes" better than "splitAttributes". Should I
change it?
I too had problem with the config files initially, but I think I've got a
handle on it now.
-Jonathan
-----Original Message-----
From: Stefan Krieger [mailto:ste...@co...]
Sent: Tuesday, July 15, 2003 2:41 PM
To: bab...@li...
Subject: [Babeldoc-devel] Splitting Document with Attributes
Hello,
I have seen that the new RouterPipelineStage has an option wether to copy
the attributes to the new document or not.
I think this should be done generally for all PipelineStage that can split
up documents.
I have the same requirement for XPathSpillter and fixed it into the base
PiplineStage method.
What do you think about introducing a new "standard" stage option, i.e.
"copyAttributes" ?
This could be defaulted to false, so it want break with the existing way.
BTW: During our project we have had tremendous trouble with your
configuration appending mechanism.
I can't give you any more details, I am just happy that we have it now
running.
We ended up with copies of some "config.properties" in our config dir and
removed some from the babeldoc JARs.
We are still on version 1.0, so I am not sure if this is already fixed.
Stefan
protected PipelineStageResult[] processHelper(String[] results)
throws PipelineException, JournalException {
IJournal journal = JournalFactory.getJournal();
PipelineStageResult[] psresults = new
PipelineStageResult[results.length];
String name = this.getNextPipelineStageName();
//Process each of the documents
for (int i = 0; i < results.length; ++i) {
IJournalTicket newTicket = journal.forkTicket(ticket);
PipelineDocument newDoc = new PipelineDocument(results[i].getBytes());
// PATCH: copy attributes
PipelineDocument doc = getDocument() ;
for ( Iterator it = doc.keys().iterator(); it.hasNext() ; ) {
String key = (String) it.next() ;
newDoc.put( key, doc.get( key ) ) ;
}
psresults[i] = new PipelineStageResult(name, newDoc, newTicket);
}
return psresults;
}
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Babeldoc-devel mailing list
Bab...@li...
https://lists.sourceforge.net/lists/listinfo/babeldoc-devel
|