Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

Digester : Parsing problem ...

Thread view: 
pgaleas - 14 Oct 2006 18:55 GMT
Hello All,

I have a set of XML files which contain an incorrect attribute
definition:
<F P=10> some text </F>

... quotes are not defined for the attribute P value.

When I try to parse the documents with Digester, I obtain the following
error message:

Exception in thread "main" org.xml.sax.SAXParseException: Open quote is
expected for attribute "P" associated with an  element type  "F".
    at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1631)
...
...

I don't need really the value of the attribute P. Only is important
the information contained between <F> and </F>.

Is there a way to ignore the attribute definition and parse these
documents without to fix the XML files?

Thank you in advance
Patricio
Mike Schilling - 14 Oct 2006 21:47 GMT
> Hello All,
>
[quoted text clipped - 21 lines]
> Is there a way to ignore the attribute definition and parse these
> documents without to fix the XML files?

I don't know of an XML parser that handles ill-formed XML other than by
throwing that sort of exception.  You might do better with an HTML parser,
since the quotes are optional is some dialects of HTML.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.