I was going to suggest that you set the "
http://apache.org/xml/properties/internal/entity-resolver" property on the
DOMConfiguration but just noticed that isn't possible. It will throw an
exception without first attempting to set the property on the internal
XMLParserConfiguration. Could you please open a JIRA issue?
Thanks.
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]
Dick Deneer <[EMAIL PROTECTED]> wrote on 10/14/2006
07:26:38 AM:
> Hi,
>
> I am using the DOM level 3 api to create a DOM using :
>
> DOMImplementationRegistry registry =
> DOMImplementationRegistry.newInstance();
> DOMImplementationLS domImpl = (DOMImplementationLS)
> registry.getDOMImplementation("LS 3.0");
>
> LSParser parser = domImpl
> .createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS,
> XMLConstants.W3C_XML_SCHEMA_NS_URI);
>
> org.w3c.dom.DOMConfiguration config = parser.getDomConfig();
> config.setParameter("resource-resolver", resolver); //where
> resolver is an LSResolver
>
> Document doc = parser.parseURI(sourceURI);
>
> Afterwards I am using the DOM Validation api to validate the DOM
> when it is modified.
>
> The LSResolver has the resolveResoure method:
>
> public LSInput resolveResource(String type, String namespaceURI,
> String publicId, String systemId, String baseURI)
>
> My problem is that I need much more information about the resource
> than what is passed to this method.
> For instance I can not distinguish a DTD grammar from an
> XMLEntityDescription because from the "type" parameter passed.
> From the debugger I saw that one level higher in the stack the
> DOMEntityResolverWrapper has all the information I need in
> the XMLResourceIdentifier interface object.
> Is there anyway to get acces to this.
>
> By the way, at the "sax-side" of my program I do not have this
> issue, by using the XMLEntityResolver() with has this method:
> public XMLInputSource resolveEntity(XMLResourceIdentifier
> arg0) throws XNIException, IOException)
>
> Dick Deneer
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]