Re: custom XIncludeHandler

2010-08-25 Thread Michael Glavassevich
> > > > > So essentially we reference an external set of entities: > > > > http://anonsvn.jboss.org/repos/hibernate/core/trunk/documentation/ > > > > manual/src/main/docbook/en-US/HIBERNATE_- > > > > _Relational_Persistence_for_Idiomatic_Java.ent > >

Re: custom XIncludeHandler

2010-08-25 Thread Steve Ebersole
t; > > Note that if a document already has an external subset your > > instance > > > > of EntityResolver2 will get a call to resolveEntity() and you can > > tell > > > > by the entity name "[dtd]" that the parser is asking you to > >

Re: custom XIncludeHandler

2010-08-20 Thread Steve Ebersole
t the parser is asking you to > resolve > > > it. That's also an opportunity to inject whatever entity > declarations > > > you want to add and could include the DTD you were asked to > resolve > > > through a parameter entity. > > > > > > > Which ta

Re: custom XIncludeHandler

2010-08-20 Thread Michael Glavassevich
tityResolver2 will get a call to resolveEntity() and you can tell > > by the entity name "[dtd]" that the parser is asking you to resolve > > it. That's also an opportunity to inject whatever entity declarations > > you want to add and could include the DTD you were

Re: custom XIncludeHandler

2010-08-20 Thread Steve Ebersole
er entity. > > > Which takes me back to the question of a custom XIncludeHandler and > (a) > > whether that is a valid option and (b) how to properly make sure my > > custom XIncludeHandler gets used in the pipeline. > > There's no supported way of doing that. You w

Re: custom XIncludeHandler

2010-08-20 Thread Michael Glavassevich
at's also an opportunity to inject whatever entity declarations you want to add and could include the DTD you were asked to resolve through a parameter entity. > Which takes me back to the question of a custom XIncludeHandler and (a) > whether that is a valid option and (b) how to pro

Re: custom XIncludeHandler

2010-08-18 Thread Steve Ebersole
ntityResolver2.getExternalSubset approach is not going to work here. Which takes me back to the question of a custom XIncludeHandler and (a) whether that is a valid option and (b) how to properly make sure my custom XIncludeHandler gets used in the pipeline. -- Steve Ebersole http://hibernate.org

Re: custom XIncludeHandler

2010-08-17 Thread Steve Ebersole
On Tue, 2010-08-17 at 17:15 -0400, Michael Glavassevich wrote: > > Oh, I need this to happen even if there is already a DTD. It will > in > > all likelihood have a DTD declared. I just need to inject some > entities > > into it. > > Unless you've written your own XML parser how can you reliably

Re: custom XIncludeHandler

2010-08-17 Thread Michael Glavassevich
Steve Ebersole wrote on 08/17/2010 05:05:07 PM: > On Tue, 2010-08-17 at 16:55 -0400, Michael Glavassevich wrote: > > EntityResolver.resolveEntity() is called for any kind of external > > resource, not necessarily XML, that the parser is trying to load. > > Ok, good to know. Thanks! > > > I am su

Re: custom XIncludeHandler

2010-08-17 Thread Michael Glavassevich
Steve Ebersole 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,

Re: custom XIncludeHandler

2010-08-17 Thread Steve Ebersole
On Tue, 2010-08-17 at 16:55 -0400, Michael Glavassevich wrote: > EntityResolver.resolveEntity() is called for any kind of external > resource, not necessarily XML, that the parser is trying to load. Ok, good to know. Thanks! > I am suggesting that you use a different method which is only called

Re: custom XIncludeHandler

2010-08-17 Thread Steve Ebersole
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 calle

Re: custom XIncludeHandler

2010-08-17 Thread Michael Glavassevich
Steve Ebersole wrote on 08/17/2010 04:38:03 PM: > Steve Ebersole > > Please respond to j-users > > 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 > > EntityR

Re: custom XIncludeHandler

2010-08-17 Thread Steve Ebersole
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

Re: custom XIncludeHandler

2010-08-17 Thread Michael Glavassevich
Steve, Steve Ebersole wrote on 08/17/2010 04:00:37 PM: > Hey Michael. > > I'll look into that for sure as like you said it probably allows me to > apply the entities more easily. > > But I don't think that allows me to apply the DOCTYPE only to xincluded > documents only when the the xinclude pa

Re: custom XIncludeHandler

2010-08-17 Thread Steve Ebersole
Hey Michael. I'll look into that for sure as like you said it probably allows me to apply the entities more easily. But I don't think that allows me to apply the DOCTYPE only to xincluded documents only when the the xinclude parse type is xml. Thats the real problem I am facing. Imagine a do

Re: custom XIncludeHandler

2010-08-17 Thread Michael Glavassevich
Hi Steve, Have you tried EntityResolver2.getExternalSubset() [1]? This was designed for injecting a DTD external subset into an XML document which doesn't have one. It should be more reliable than the method you're using. Thanks. [1] http://xerces.apache.org/xerces2-j/javadocs/api/org/xml/sax/e

custom XIncludeHandler

2010-08-17 Thread Steve Ebersole
I have a requirement to inject custom DOCTYPE entity declarations into xincluded documents. Currently I am using an org.xml.sax.EntityResolver to accomplish this. When my EntityResolver[1] understands a request it creates and returns a special InputSource[2]. This however gives me problems with