Steve Ebersole <steven.ebers...@gmail.com> wrote on 08/17/2010 05:03:09 PM:

> On Tue, 2010-08-17 at 15:38 -0500, Steve Ebersole wrote:
> > On Tue, 2010-08-17 at 16:24 -0400, Michael Glavassevich wrote:
> > > Sure but the second one is a text include. This is not processed as
an
> > > XML document, even if it looks like one, so
> > > EntityResolver2.getExternalSubset() won't be called for it.
> >
> > Even though EntityResolver is called?  I'll try, but a bit surprised
> > EntityResolver would be called though EntityResolver2 would not.
> >
>
> I am little unclear about these terms, so I apologize.  I think what
> I used to build was an internal subset.  Basically, I'd define the
> entities inside the DOCTYPE:
> <!DOCTYPE ... [
> <!ENTITY version "1.2.3">
> <!ENTITY today "August 17, 2010">
> ]>

Sure. That's one way of doing it. Alternatively you could have written:

<!DOCTYPE xyz SYSTEM "my.dtd">

where my.dtd contains:
<!ENTITY version "1.2.3">
<!ENTITY today "August 17, 2010">

and that is what getExternalSubset() gives you the opportunity to inject.

> Specifically, the <!ENTITY> stuff is what I need to define.  So I'd just
> have EntityResolver2.getExternalSubset() return an InputSource that
> wraps the <!ENTITY>s I need?
>
> StringBuilder buffer = new StringBuilder();
> buffer.append( "<!ENTITY version \"1.2.3\">\n" );
> buffer.append( "<!ENTITY today \"August 17, 2010\">\n" );
> // wrap this up as an InputSource

Yes. That's right.

> --
> Steve Ebersole <st...@hibernate.org>
> http://hibernate.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
> For additional commands, e-mail: j-users-h...@xerces.apache.org;

Thanks.>

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Reply via email to