You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Dick Deneer (JIRA)" <xe...@xml.apache.org> on 2006/10/16 21:48:34 UTC
[jira] Created: (XERCESJ-1204) Can not set XMLEntityResolver for
LSParser
Can not set XMLEntityResolver for LSParser
------------------------------------------
Key: XERCESJ-1204
URL: http://issues.apache.org/jira/browse/XERCESJ-1204
Project: Xerces2-J
Issue Type: Bug
Components: DOM (Level 3 Core)
Affects Versions: 2.8.1
Reporter: Dick Deneer
Priority: Minor
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);
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.
I want to use the XMLEntityResolver but trying:
config.setParameter(
"http://apache.org/xml/properties/internal/entity-resolver", myXMLEntityResolver)
gives an org.w3c.dom.DOMException: FEATURE_NOT_FOUND: The parameter http://apache.org/xml/properties/internal/entity-resolver is not recognized.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] Updated: (XERCESJ-1204) Can not set XMLEntityResolver for
LSParser
Posted by "Dick Deneer (JIRA)" <xe...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XERCESJ-1204?page=all ]
Dick Deneer updated XERCESJ-1204:
---------------------------------
Attachment: DOMParserImpl.java
DOMConfigurationImpl.java
Patch for the reported bug
See my comment in the source by searching for "begin change"
> Can not set XMLEntityResolver for LSParser
> ------------------------------------------
>
> Key: XERCESJ-1204
> URL: http://issues.apache.org/jira/browse/XERCESJ-1204
> Project: Xerces2-J
> Issue Type: Bug
> Components: DOM (Level 3 Core)
> Affects Versions: 2.8.1
> Reporter: Dick Deneer
> Priority: Minor
> Attachments: DOMConfigurationImpl.java, DOMParserImpl.java
>
>
> 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);
> 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.
> I want to use the XMLEntityResolver but trying:
> config.setParameter(
> "http://apache.org/xml/properties/internal/entity-resolver", myXMLEntityResolver)
> gives an org.w3c.dom.DOMException: FEATURE_NOT_FOUND: The parameter http://apache.org/xml/properties/internal/entity-resolver is not recognized.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] Commented: (XERCESJ-1204) Can not set XMLEntityResolver for
LSParser
Posted by "Dick Deneer (JIRA)" <xe...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XERCESJ-1204?page=comments#action_12443758 ]
Dick Deneer commented on XERCESJ-1204:
--------------------------------------
With above patch there is still one minor issue:
During dom revalidation (normalizeDocumnet()) the getExternalSubset is not called when you would expect it:
- config.setParameter("schema-type",
"http://www.w3.org/TR/REC-xml");
- and there is no DOCTYPE in the document
Strange enough it is called when you first do a revalidation with :
- you have set config.setParameter("schema-type",
"http://www.w3.org/2001/XMLSchema");
and then switch back to
- config.setParameter("schema-type",
"http://www.w3.org/TR/REC-xml");
Maybe this all has something to do with the "schema-location" parameter with has kind of the same function?
> Can not set XMLEntityResolver for LSParser
> ------------------------------------------
>
> Key: XERCESJ-1204
> URL: http://issues.apache.org/jira/browse/XERCESJ-1204
> Project: Xerces2-J
> Issue Type: Bug
> Components: DOM (Level 3 Core)
> Affects Versions: 2.8.1
> Reporter: Dick Deneer
> Priority: Minor
> Attachments: DOMConfigurationImpl.java, DOMParserImpl.java
>
>
> 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);
> 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.
> I want to use the XMLEntityResolver but trying:
> config.setParameter(
> "http://apache.org/xml/properties/internal/entity-resolver", myXMLEntityResolver)
> gives an org.w3c.dom.DOMException: FEATURE_NOT_FOUND: The parameter http://apache.org/xml/properties/internal/entity-resolver is not recognized.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] Resolved: (XERCESJ-1204) Can not set XMLEntityResolver for
LSParser
Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XERCESJ-1204?page=all ]
Michael Glavassevich resolved XERCESJ-1204.
-------------------------------------------
Fix Version/s: 2.9.0
Resolution: Fixed
For the LSParser I went with a much more general solution than the one you were suggesting. In the future if you submit other fixes / improvements to Xerces can you please provide them in the form of a patch. Patches are much easier to review and can be applied to the codebase even if the files have been modified since the patch was made. This is the form in which most folks contribute changes. Also, I noticed that you do not have a Contributor License Agreement (CLA) on file [1] with Apache. This is required for accepting new features and improvements and saves us from having to ask a bunch of questions every time you post a bug fix. Have a look at section 7 of the Xerces Project Charter, available here [2] for more info.
[1] http://www.apache.org/~jim/committers.html
[2] http://xerces.apache.org/xerces2-j/charter.html
> Can not set XMLEntityResolver for LSParser
> ------------------------------------------
>
> Key: XERCESJ-1204
> URL: http://issues.apache.org/jira/browse/XERCESJ-1204
> Project: Xerces2-J
> Issue Type: Bug
> Components: DOM (Level 3 Core)
> Affects Versions: 2.8.1
> Reporter: Dick Deneer
> Assigned To: Michael Glavassevich
> Priority: Minor
> Fix For: 2.9.0
>
> Attachments: DOMConfigurationImpl.java, DOMConfigurationImpl.java, DOMParserImpl.java, DOMParserImpl.java, XMLParser.java
>
>
> 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);
> 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.
> I want to use the XMLEntityResolver but trying:
> config.setParameter(
> "http://apache.org/xml/properties/internal/entity-resolver", myXMLEntityResolver)
> gives an org.w3c.dom.DOMException: FEATURE_NOT_FOUND: The parameter http://apache.org/xml/properties/internal/entity-resolver is not recognized.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] Commented: (XERCESJ-1204) Can not set XMLEntityResolver for
LSParser
Posted by "Dick Deneer (JIRA)" <xe...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XERCESJ-1204?page=comments#action_12450458 ]
Dick Deneer commented on XERCESJ-1204:
--------------------------------------
On 20/Oct/06 I commented:
================================================
Strange enough it is called when you first do a revalidation with :
- you have set config.setParameter("schema-type",
"http://www.w3.org/2001/XMLSchema");
and then switch back to
- config.setParameter("schema-type",
"http://www.w3.org/TR/REC-xml");
=================================================
This comment can be ignored; it was caused by my program where I reread the xml into a Dom.
The Dom revalidation itself will never call getExternalSubset.
But personally this is not a problem for me.
You van use the set schema-location, and then the resolveEntity method will be called, with in the systemId the given location.
> Can not set XMLEntityResolver for LSParser
> ------------------------------------------
>
> Key: XERCESJ-1204
> URL: http://issues.apache.org/jira/browse/XERCESJ-1204
> Project: Xerces2-J
> Issue Type: Bug
> Components: DOM (Level 3 Core)
> Affects Versions: 2.8.1
> Reporter: Dick Deneer
> Assigned To: Michael Glavassevich
> Priority: Minor
> Attachments: DOMConfigurationImpl.java, DOMConfigurationImpl.java, DOMParserImpl.java, DOMParserImpl.java, XMLParser.java
>
>
> 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);
> 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.
> I want to use the XMLEntityResolver but trying:
> config.setParameter(
> "http://apache.org/xml/properties/internal/entity-resolver", myXMLEntityResolver)
> gives an org.w3c.dom.DOMException: FEATURE_NOT_FOUND: The parameter http://apache.org/xml/properties/internal/entity-resolver is not recognized.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] Assigned: (XERCESJ-1204) Can not set XMLEntityResolver for
LSParser
Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XERCESJ-1204?page=all ]
Michael Glavassevich reassigned XERCESJ-1204:
---------------------------------------------
Assignee: Michael Glavassevich
> Can not set XMLEntityResolver for LSParser
> ------------------------------------------
>
> Key: XERCESJ-1204
> URL: http://issues.apache.org/jira/browse/XERCESJ-1204
> Project: Xerces2-J
> Issue Type: Bug
> Components: DOM (Level 3 Core)
> Affects Versions: 2.8.1
> Reporter: Dick Deneer
> Assigned To: Michael Glavassevich
> Priority: Minor
> Attachments: DOMConfigurationImpl.java, DOMConfigurationImpl.java, DOMParserImpl.java, DOMParserImpl.java, XMLParser.java
>
>
> 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);
> 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.
> I want to use the XMLEntityResolver but trying:
> config.setParameter(
> "http://apache.org/xml/properties/internal/entity-resolver", myXMLEntityResolver)
> gives an org.w3c.dom.DOMException: FEATURE_NOT_FOUND: The parameter http://apache.org/xml/properties/internal/entity-resolver is not recognized.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] Commented: (XERCESJ-1204) Can not set XMLEntityResolver for
LSParser
Posted by "Dick Deneer (JIRA)" <xe...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XERCESJ-1204?page=comments#action_12443082 ]
Dick Deneer commented on XERCESJ-1204:
--------------------------------------
The attached source, with applied changes, are from release 2.8.0
> Can not set XMLEntityResolver for LSParser
> ------------------------------------------
>
> Key: XERCESJ-1204
> URL: http://issues.apache.org/jira/browse/XERCESJ-1204
> Project: Xerces2-J
> Issue Type: Bug
> Components: DOM (Level 3 Core)
> Affects Versions: 2.8.1
> Reporter: Dick Deneer
> Priority: Minor
> Attachments: DOMConfigurationImpl.java, DOMParserImpl.java
>
>
> 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);
> 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.
> I want to use the XMLEntityResolver but trying:
> config.setParameter(
> "http://apache.org/xml/properties/internal/entity-resolver", myXMLEntityResolver)
> gives an org.w3c.dom.DOMException: FEATURE_NOT_FOUND: The parameter http://apache.org/xml/properties/internal/entity-resolver is not recognized.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org