On Mon, 2003-09-29 at 13:20, Matthijs Wensveen wrote: > http://www.w3.org/TR/REC-xml#sec-pi says: > "PIs are not part of the document's character data > <http://www.w3.org/TR/REC-xml#dt-chardata>, 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 use-case. 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 PI. -Janek --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]