[digester] The element type ... must be terminated by the matching end-tag

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[digester] The element type ... must be terminated by the matching end-tag

Patrick Diviacco
I get the following error:

May 3, 2011 6:41:25 PM org.apache.commons.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 2336608 column 3: The element type "user"
must be terminated by the matching end-tag "</user>".
org.xml.sax.SAXParseException: The element type "user" must be terminated by
the matching end-tag "</user>".

However 2336608 is the last line of my text file. I guess I'm opening a tag
</user> and I never close it. Do you know how can I find it and fix it, in
big text files ?

thanks
Reply | Threaded
Open this post in threaded view
|

Re: [digester] The element type ... must be terminated by the matching end-tag

Rahul Akolkar
On Tue, May 3, 2011 at 12:48 PM, Patrick Diviacco
<[hidden email]> wrote:

> I get the following error:
>
> May 3, 2011 6:41:25 PM org.apache.commons.digester.Digester fatalError
> SEVERE: Parse Fatal Error at line 2336608 column 3: The element type "user"
> must be terminated by the matching end-tag "</user>".
> org.xml.sax.SAXParseException: The element type "user" must be terminated by
> the matching end-tag "</user>".
>
> However 2336608 is the last line of my text file. I guess I'm opening a tag
> </user> and I never close it. Do you know how can I find it and fix it, in
> big text files ?
>
> thanks
<snip/>

I'm assuming there are far too many <user> tags to do simple text
searches -- most editors or even web browsers (when instructed to
treat as XML) provide some help in matching start and end tags by
collapsing element bodies etc., you'd have to inspect by opening in
one of those.

-Rahul

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [digester] The element type ... must be terminated by the matching end-tag

Patrick Diviacco
Ok, however browsers have the same problem my editor has in displaying and
matching tags in big files.

On 3 May 2011 20:04, Rahul Akolkar <[hidden email]> wrote:

> On Tue, May 3, 2011 at 12:48 PM, Patrick Diviacco
> <[hidden email]> wrote:
> > I get the following error:
> >
> > May 3, 2011 6:41:25 PM org.apache.commons.digester.Digester fatalError
> > SEVERE: Parse Fatal Error at line 2336608 column 3: The element type
> "user"
> > must be terminated by the matching end-tag "</user>".
> > org.xml.sax.SAXParseException: The element type "user" must be terminated
> by
> > the matching end-tag "</user>".
> >
> > However 2336608 is the last line of my text file. I guess I'm opening a
> tag
> > </user> and I never close it. Do you know how can I find it and fix it,
> in
> > big text files ?
> >
> > thanks
> <snip/>
>
> I'm assuming there are far too many <user> tags to do simple text
> searches -- most editors or even web browsers (when instructed to
> treat as XML) provide some help in matching start and end tags by
> collapsing element bodies etc., you'd have to inspect by opening in
> one of those.
>
> -Rahul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [digester] The element type ... must be terminated by the matching end-tag

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Patrick,

On 5/4/2011 4:18 AM, Patrick Diviacco wrote:
> Ok, however browsers have the same problem my editor has in displaying and
> matching tags in big files.

We use a custom handler called a TracingSAXHandler which extends
DefaultHandler, overrides the setDocumentLocator method to capture the
Locator object, and then uses a stack to observe the start/end element
events.

Anytime something goes wrong, you can consult the Locator to see where
you are.

Try using something like that and just do a SAXParser.parse() using that
handler: it should be able to tell you where the start of that element
is, line and column.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3NoqoACgkQ9CaO5/Lv0PDyjACghiIeYtAQ7aWxIpf3ptC06Xxi
KccAn1uiW8JrsUnkWgdp8wBp86GADoAf
=6Gfe
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]