commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Janek Bogucki <>
Subject Re: [digester] Rule for processing instruction?
Date Mon, 29 Sep 2003 16:04:25 GMT
On Mon, 2003-09-29 at 13:20, Matthijs Wensveen wrote:
> says:
> "PIs are not part of the document's character data 
> <>, but must be passed through 
> to the application."
> To me this means that you shouldn't catch PI's but send them directly to 
> 'the application'. So PI's aren't context sensitive?
> I don't really understand what you can do with processing instructions 
> that you can't do with 'normal' xml. Sending instructions to the tea 
> machine can be done by subclassing Digester and overriding the 
> processingInstruction method. Or by adding a CallMethod rule if the 
> instruction is context sensitive.

In my case I needed to associate a set of properties with each XML
document without changing the DTD. After parsing the document the code
examined the properties and made some decisions about

	1. Which parts of the resultant object model to discard
	2. Whether to merge or replace the data into the database

Both of these decisions were based on meta-data about the document and
contextless PIs were a good fit. This is covered by Robert's first

If Digester had allowed access to the PIs without subclassing I could
have got by with one fewer class but having said that subclassing
Digester was straightforward enough.

Maybe the original poster could supply his real-world use-case. I liked
Craig's idea of building up a set of Attributes from the value of the


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message