RE: Entities (was [libxml++] libxml++ future)



> From: Dan Dennedy [mailto:dan dennedy org] 
> No, I had a sudden change in my work and living arrangement. 
> Then, my main dev workstation has been acting crazy since the 
> move. So, I am just getting stable again.

I can't check it in right now but ...
I believe I have implemented the entity parsing for xmlpp::DomParser. There
is
- a new EntityReference class, derived from Node (I'm not 100% sure that
makes sense)
  EntityReferences are uses of entities, such as
&somethingIdeclaredearlier;.
  We might need an EntityDeclaration class (or methods) as well.
- a new Parser::substitute_entities() method, that works a bit like
Parser::set_validate(). 
  It sets the context->replaceEntitites flag.

Note that the parsing of the 5 predefined entities
  ( http://www.w3.org/TR/REC-xml#sec-predefined-ent )
is not affected. Those entities are always resolved to/from text.

I have changed the default to set_substitute_entities(true). I'm not sure
whether this is
a) the best thing to do, but it seems the most useful
b) in violation of any specifications.

I'm not sure what people might want to do with an EntityRefernce or
EntityDeclaration when they get it from the parser. I guess they might want
to just interpet it themselves, based on some application-specific
information. Or is there some extra information that they might want to get
from the parser?

I will try to look at the SaxParser too.

Murray Cumming
www.murrayc.com
murrayc usa net

> On Mon, 2003-10-13 at 08:43, Murray Cumming Comneon com wrote:
[snip]
> > > >  I need to anaylze the resultant node tree further to see if 
> > > > content is a list of text and entity reference nodes. Either, 
> > > > libxml2, encodes entity references from "&ref;" to 
> "&ref;" or 
> > > > I can set resolveEntities=1 in the libxml2 parser 
> context to make 
> > > > it expand. The SAX reference callback is never called upon.
> > > > 
> > > > Also, I still need to subclass Node as Entity in order 
> to prevent 
> > > > a
> > > > libxml2 xmlEntity* from being a part of the interface.
> > 
> > Dan, did you make any more progress on this?




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