Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] can xom help with theses two problems

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Tatu Saloranta <cowtowncoder AT yahoo.com>
  • To: teknokrat <teknokrat AT yahoo.com>, xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] can xom help with theses two problems
  • Date: Wed, 21 Jun 2006 12:40:08 -0700 (PDT)

--- teknokrat <teknokrat AT yahoo.com> wrote:

> We are dealing with legacy xml feeds and have run
> across two problems
> that are making our lives difficult.
>
> 1. leading spaces before the <?xml declaration. Is
> it possible for xom
> to strip these out?
>
> 2. We get given DOCTYPE declarations that do not
> point to a correct DTD.
> This breaks XOM even though we ask for a non
> validating parser.

Others have already answered with most of the details,
but this last entry has one more related intricacy.
Unfortunately, even when not validating, XML spec
mandates couple of things to be done based on DTD, by
parsers capable of validation. Specifically, attribute
typing and value normalization. At least that's what
Xerces does, and as a result, what newer parsers tend
to do (since Xerces pretty much defines de facto
standard mode of processing in Java, IMO).

The easiest way to work around that is, like was
already said, by defining a custom entity resolver to
return something like empty content.

-+ Tatu +-


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com




Archive powered by MHonArc 2.6.24.

Top of Page