Re: [xml] Handling minor errors in XML and continuing



I'd have to agree with the previous posters that what you're trying to
do is outside the scope of XML and should not be supported by libxml. I
suggest you take a look at SGML which has _many_ (in my opinion too
many) features for dealing with these kinds of situations. SGML was
designed to alleviate the problem of converting human entered input from
a variety of formats to the rigor needed by a typesetting machine (circa
1986).  You'll find its features will help you deal with these kinds of
problems. In particular the shortref syntax might be useful.

Reid.

On Sun, 2004-01-04 at 03:40, Aaron Optimizer Digulla wrote:
On Sun, Jan 04, 2004 at 01:38:22AM -0700, stephen wrote:

I appreciate that in an ideal world the buggy clients would be fixed,
but that's just not an option for me.  What can I do?

I had a similar problem: I have to process documents which
contain additional markup (like "* heading" instead of 
"<h1>heading</h1>").

My solution was to put a preprocessor before the XML parser.
Since I'm using Java, I just wrote a class which implements
Reader and pass that to SAXBuilder.build(). Now, my 
preprocessor filters the input and the XML parser sees
only valid XML and I don't have to create a temporary
file.

Maybe something similar is possible with libxml?

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]