John,
>I haven't tried your example yet, but if your output is a cut
>and paste of what you do get, it shows what I mean:
>
> [startOfMarkupDecl]
> <!ELEMENT
> [startEntity "%ent"] e %ent;
> [endEntity "%ent"]
> [elementDecl]>
>
>In this case the startEntity/endEntity pair encloses not just
>the entity reference but also the element name.
There is no issue of "enclosing". I am just implementing the
specification of xml-string. As each event is delivered, there
is a "range" of the parsed entity text that was unparsed at the
previous event and has been parsed before the current event.
All I do is make this data available to the handler. There
is obviously work that the handler needs to perform to make
"sense" of the unparsed data, but a "stateful" handler can
do so without having to actually be as complicated as the XML
processor reading the DTD. The parser is making all the data
available "in context" without incurring any significant
overhead unless the handler is actually asking for the property.
(updating an int per event dispatch with a value that is already
available is "in the noise"...)
>How it would
>be different would be, for example, that the elementDecl
>callback would return me a series of literals, so that in the
>following (slightly simpler) example:
>
> <!ELEMENT %elementname; (%cmbit;)>
> elementDecl(String name, String contentModel)
>
>would give me name="%elementname;" and contentModel="%cmbit;"
And what would your proposed interface provide in this case?
<!ENTITY % elemDeclParams "e (foo|bar)">
<!ELEMENT %elemDeclParams;>
or this?
<!ENTITY % e1 "">
<!ENTITY % e2 "e">
<!ENTITY % e3 "foo|bar">
<!ENTITY % e4 "(%e3;)">
<!ELEMENT%e1;%e2;%e4;%e1;>
>I believe in this case, getProperty(...string) would give me:
>
> [startOfMarkupDecl]
> <!ELEMENT
> [startEntity "%elementname"]
> [startEntity "%cmbit"]
> %elementname; %cmbit;
> [endEntity "%cmbit"]
> [endEntity "%elementname"]
> [elementDecl]>
Close... You actually get:
[startOfElementDecl]
<!ELEMENT
[startEntity] %elementName;
[endEntity]
[startEntity] (%cmBit;
[endEntity]
[elementDecl])>
Regards,
Glenn
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]