Skip to main content.
home | support | download

Back to List Archive

Re: Indexing xml files that has another included xml

From: Peter Karman <karman(at)not-real.cray.com>
Date: Thu Sep 09 2004 - 16:26:09 GMT
Bill Moseley wrote on 09/09/2004 02:04 AM:
> 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;
>                ^


I'm guessing that's because without an <!ENTITY> declaration or some
external cataloging, libxml2 has nothing to substitute.



>>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=".
> 

xmllint --noent

should resolve entities that are either declared in the XML header, or 
are available with catalogs.

-- 
Peter Karman - 651-605-9009 - karman@cray.com
Received on Thu Sep 9 09:26:54 2004