Skip to main content.
home | support | download

Back to List Archive

Re: Indexing xml files that has another included xml file

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Thu Sep 09 2004 - 07:05:35 GMT
On Wed, Sep 08, 2004 at 03:29:37PM -0700, Peter Karman wrote:
> I believe (Bill will correct me) that even using libxml2 as your parser 
> (XML2), entities and XIncludes are not followed in your XML.

I'm not quite sure.  The libxml2 docs provide a function to "expand"
those entities:

   http://www.xmlsoft.org/html/libxml-parser.html#xmlSubstituteEntitiesDefault

Which I thought might be an easy fix by just calling:

   xmlSubstituteEntitiesDefault(1);

But, I still get this error:

    include.xml:6: error: Entity 'xmlfrag' not defined
      &xmlfrag;
               ^

But things get more complex:  at the bottom of this page:

   http://www.xmlsoft.org/entities.html

it says:

    WARNING: handling entities on top of the libxml2 SAX interface is
    difficult!!! If you plan to use non-predefined entities in your
    documents, then the learning curve to handle then using the SAX
    API may be long. If you plan to use complex documents, I strongly
    suggest you consider using the DOM interface instead and let
    libxml deal with the complexity rather than trying to do it
    yourself.

Which, of course, we use the SAX interface.  I also see on

  http://www.xmlsoft.org/html/index.html

that our SAX usage of libxml2 is deprecated.  Looks like a trip to the
xml list might be in my future.

> The xmllint 
> tool that comes with libxml2 does resolve those (with correct 
> catalog/options),

Could you get xmllint to actually replace the text?  Mine just shows
"content=".

-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Thu Sep 9 00:05:57 2004