commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Worley Kevin" <>
Subject [Digester] How can I 'shortcut' a parse?
Date Sun, 01 May 2005 17:27:44 GMT

I would like to know if anyone can tell me how to 'shortcut' a parse.

The XML file that I need to parse does not use Namespaces, but the rules
I need to use vary based on information in the "header" section.
Basically, the file is something like:

    <LineItem LineNumber="0">
        <Supplier>XYX Corp.</Supplier>
        <SupplierGroup>Group a</SupplierGroup>
        <EmployeeName>John Doe</EmployeeName>

The 'body' can consist of thousands of 'LineItem' elements which are
each much more extensive than shown here.  Currently, I use Digester
with rules to parse the header.  When complete, I can look at what was
returned and set the rules to correctly parse the 'body' of the file.
This works, but requires the digester to completely parse the file
twice.  I'd really like to avoid doing it this way.

Does anyone know of a way I can have the parser simply end after the
'header' section is parsed?  



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

View raw message