You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Tobias Demuth <su...@cinebet.de> on 2008/12/19 14:33:59 UTC

[Digester] Including other files for parsing

Hi everybody,

I'm trying to implement an include-mechanism for XML-Files with 
Digester. In the XML are processing-instructions like

<?include xyz.xml ?>

which should Digester make to continue parsing with the contents of the 
referenced file and return afterwards for parsing the rest of the 
original file. I tried to manipulate the overgiven Reader-instance, but 
this leads to nowhere unless I pre-parse the XML myself to find those 
processing-instructions ...

So, any ideas?

thanks in advance
Tobias

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Digester] Including other files for parsing

Posted by Tobias Demuth <su...@cinebet.de>.
Thanks for all your help. A new version of digester sounds incredible well!

kind regards
Tobias

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Digester] Including other files for parsing

Posted by Rahul Akolkar <ra...@gmail.com>.
On Fri, Dec 19, 2008 at 5:11 PM, Tobias Demuth <su...@cinebet.de> wrote:
> Ok,
> sounds like "Does not work currently" ;( ... So I will skip this feature and
> move on until Digester supports XInclude (which I didn't know but it is
> exactly what I want to have).
>
<snip/>

I've floated the idea:

    http://markmail.org/message/lbfgtrgtlvmutgjj

Lets see. If all goes well, could be supported soon (in weeks, rather
than years :-).


> You said, XInclude was introduced in Java5 - can you tell me where to find
> information about that?
>
<snap/>

At the core of digester's parsing capabilities is the
javax.xml.parsers.SAXParserFactory class. Now compare and constrast:

  http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/SAXParserFactory.html

with:

  http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/parsers/SAXParserFactory.html

-Rahul


> thanks
> Tobias
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Digester] Including other files for parsing

Posted by Tobias Demuth <su...@cinebet.de>.
Ok,
sounds like "Does not work currently" ;( ... So I will skip this feature 
and move on until Digester supports XInclude (which I didn't know but it 
is exactly what I want to have).

You said, XInclude was introduced in Java5 - can you tell me where to 
find information about that?

thanks
Tobias

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Digester] Including other files for parsing

Posted by Rahul Akolkar <ra...@gmail.com>.
On Fri, Dec 19, 2008 at 3:18 PM, Tobias Demuth <su...@cinebet.de> wrote:
> Rahul Akolkar schrieb:
>>
>> <snip/>
>>
>> XML entities.
>>
>
> Ok, I thought about that way too, but I need my XML-authors to say what
> files should be included - that's no task that I can perform in general
> while writing the DTD. The mechanism is meant to work like the
> include-directive in PHP (or any other language), so I need a way to
> manipulate the contents of the read XML-Document at parse-time.
>
<snip/>

XInclude would be ideal (and far more flexible) -- unfortunately, I
don't think [digester] allows configuring the SAX parser to be
XInclude-aware since that was introduced in JDK 1.5.

IMO, that enhancement alone would warrant a JDK 1.5 [digester] release.

-Rahul


> Tobias
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Digester] Including other files for parsing

Posted by Tobias Demuth <su...@cinebet.de>.
Rahul Akolkar schrieb:
> <snip/>
>
> XML entities.
>   
Ok, I thought about that way too, but I need my XML-authors to say what 
files should be included - that's no task that I can perform in general 
while writing the DTD. The mechanism is meant to work like the 
include-directive in PHP (or any other language), so I need a way to 
manipulate the contents of the read XML-Document at parse-time.

Tobias

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Digester] Including other files for parsing

Posted by Rahul Akolkar <ra...@gmail.com>.
On Fri, Dec 19, 2008 at 8:33 AM, Tobias Demuth <su...@cinebet.de> wrote:
> Hi everybody,
>
> I'm trying to implement an include-mechanism for XML-Files with Digester. In
> the XML are processing-instructions like
>
> <?include xyz.xml ?>
>
> which should Digester make to continue parsing with the contents of the
> referenced file and return afterwards for parsing the rest of the original
> file. I tried to manipulate the overgiven Reader-instance, but this leads to
> nowhere unless I pre-parse the XML myself to find those
> processing-instructions ...
>
> So, any ideas?
>
<snip/>

XML entities.

-Rahul


> thanks in advance
> Tobias
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org