Scott Boag/CAM/Lotus wrote:
> 
> To tell you the truth, startEntity/endEntity is a bit of a mystery to me.
> For the xerces parser, near as I can tell, they seem to be used to flag the
> start and end of expanded entity references, as you said.  The question for
> the serializer is, if the parser can not expand the entity for whatever
> reason, how does it tell if it should output the entity reference (which I
> think it should)?

I believe in the case of Xerces, if it cannot expand the entity
reference it will throw an exception, not go on with the document.

It appears that the DOM only supports EntityReference for unparsed
external entities in attribute values. You're not supposed to place it
in the document to signify an entity that is not resolved. If an entity
does appear in the DOM, it's only to support lazy expansion, but it
should expand as you read the document.

Which means, specification wise, there is no way to print a document
which has entity references and not expansions, unless you turn entity
expansion off for the entire document printing. And you cannot just add
an entity reference to the DOM without providing expansion.

Megginson likes to follow the specifications to the letter, so that's
why the interface was modeled like that. I'm more practical, I expect
people to create documents with entity references that can only be
resolved by the reader and was looking for a way to support this.


> 
> See org.apache.xerces.parsers.SAXParser around 1131 to see what xerces
> does.
> 
> I wonder if this is one of the aspects of SAX2 which is not fully baked
> yet?  I haven't really been involved in the SAX2 stuff... I probably know
> as much about it or less than you do.  We really need to work on fully
> baking SAX2... I'm not sure where Megginson is with this stuff, but I hear
> he's not working on it at all at this point.
> 
> For right now, I wouldn't do anything for these methods, and send out your
> question to the xerces list to see if someone can fully explain it, and
> what the serializer's behavior should be.   An alternative behavior might
> be to output an entity ref if no events occur between startEntity and
> endEntity... but this probably isn't too safe.
> 
> -scott
> 
> 
>                     Assaf Arkin
>                     <[EMAIL PROTECTED]        To:     Scott Boag/CAM/Lotus 
> <Scott_Boag/CAM/[EMAIL PROTECTED]>
>                     e.com>                cc:
>                     Sent by:              Subject:     Re: [Proposal] Printer 
> package
>                     [EMAIL PROTECTED]
>                     office.com
> 
> 
>                     11/22/99 09:46
>                     PM
> 
> 
> 
> I can't get into CVS, the server rejects me. I've mailed Brian about it,
> but I'll probably get to commit only tomorrow.
> 
> I have a question for you, in the SAX2 LexicalHandler what is the
> function of startEntity/endEntity? Do they just flag where an expanded
> entity is printed in the document? Should the printer be configured to
> either print the contents or just the entity name?
> 
> arkin
> 
> Scott Boag/CAM/Lotus wrote:
> >
> > Assaf, I think almost everyone voted +1 for org.apache.xml.serialize, and
> > nobody (?) voted for org.apache.xerces.serialize.
> >
> > I am very eager to get going on the Xalan integration for this (i.e. drop
> > the Xalan FormatterListeners and call your serializer classes).
> >
> > -scott
> >
> >
> >                     Assaf Arkin
> >                     <[EMAIL PROTECTED]        To:
> [EMAIL PROTECTED]
> >                     e.com>                cc:     (bcc: Scott
> Boag/CAM/Lotus)
> >                     Sent by:              Subject:     Re: [Proposal]
> Printer package
> >                     [EMAIL PROTECTED]
> >                     office.com
> >
> >
> >                     11/22/99 03:37
> >                     PM
> >                     Please respond
> >                     to xerces-dev
> >
> >
> >
> > > So, do we have an agreement on these "XML serializing" classes? I think
> > > so.
> > >
> > > And I think Assaf can go ahead and drop them in. Anyone against this?
> >
> > Is that org.apache.xerces.serialize or org.apache.xml.serialize?
> >
> > arkin
> >
> > >
> > > --
> > > Stefano Mazzocchi      One must still have chaos in oneself to be
> > >                           able to give birth to a dancing star.
> > > <[EMAIL PROTECTED]>                             Friedrich Nietzsche
> >
> > --
> > ____________________________________________________________
> > Assaf Arkin                               [EMAIL PROTECTED]
> > CTO                                  http://www.exoffice.com
> > Exoffice, The ExoLab Company             tel: (650) 259-9796
> 
> --
> ____________________________________________________________
> Assaf Arkin                               [EMAIL PROTECTED]
> CTO                                  http://www.exoffice.com
> Exoffice, The ExoLab Company             tel: (650) 259-9796

-- 
____________________________________________________________
Assaf Arkin                               [EMAIL PROTECTED]
CTO                                  http://www.exoffice.com
Exoffice, The ExoLab Company             tel: (650) 259-9796

Reply via email to