You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Khlebnikov Alexei <AK...@belsoft.by> on 2005/06/17 11:01:59 UTC

EntityResolver

Hello.

I encounter problems with EntityResover (as well as with
XMLEntityResolver and DOMEntityResolver) in Xerces-C++ 2.5.0.
I've made my resolver that serves URIs from the local
filesystem, but not all entities are resolved through resolver!

For example, if I invoke XercesDOMParser::loadGrammar()
for loading
http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
schema, it tries to get http://www.w3.org/2001/XMLSchema.dtd
from the Net (and fails because I am behind the firewall).
If I try to load http://www.w3.org/2001/XMLSchema.dtd explicitly,
it is loaded through my resolver.

I am willing to make a patch for fixing this bug. Can anyone please
check this bug against Xerces 2.6?

Should I instead write to xerces-c-dev?

Regards.




Re: EntityResolver

Posted by Alexei Khlebnikov <AK...@belsoft.by>.
Thanks a lot, it helped. Of course I've also added the correspondent
declaration to XSDDOMParser.hpp.

Regards,
Alexei.



On Fri, 2005-06-17 at 19:12 +0200, Alberto Massari wrote:
> Hi Alexei,
> this should be fixed in Xerces 2.6 (rev. 1.13 of 
> validators/schema/XSDDOMParser.cpp). Just apply this patch to the 2.5 sources
> 
> 
> ===================================================================
> RCS file: 
> /home/cvspublic/xml-xerces/c/src/xercesc/validators/schema/XSDDOMParser.cpp,v
> retrieving revision 1.12
> retrieving revision 1.13
> diff -u -r1.12 -r1.13
> --- XSDDOMParser.cpp    2004/01/29 11:52:31     1.12
> +++ XSDDOMParser.cpp    2004/04/06 14:42:34     1.13
> @@ -55,7 +55,7 @@
>    */
> 
>   /**
> -  * $Id: XSDDOMParser.cpp,v 1.12 2004/01/29 11:52:31 cargilld Exp $
> +  * $Id: XSDDOMParser.cpp,v 1.13 2004/04/06 14:42:34 amassari Exp $
>     */
> 
> 
> @@ -553,6 +553,15 @@
>   {
>       if (fUserEntityHandler)
>           return fUserEntityHandler->resolveEntity(publicId, systemId, 
> baseURI);
> +
> +    return 0;
> +}
> +
> +InputSource*
> +XSDDOMParser::resolveEntity(XMLResourceIdentifier* resourceIdentifier)
> +{
> +    if (fUserEntityHandler)
> +        return fUserEntityHandler->resolveEntity(resourceIdentifier);
> 
>       return 0;
>   }
> 
> 
> AlbertoAt 12.01 17/06/2005 +0300, Khlebnikov Alexei wrote:
> >Hello.
> >
> >I encounter problems with EntityResover (as well as with
> >XMLEntityResolver and DOMEntityResolver) in Xerces-C++ 2.5.0.
> >I've made my resolver that serves URIs from the local
> >filesystem, but not all entities are resolved through resolver!
> >
> >For example, if I invoke XercesDOMParser::loadGrammar()
> >for loading
> >http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
> >schema, it tries to get http://www.w3.org/2001/XMLSchema.dtd
> >from the Net (and fails because I am behind the firewall).
> >If I try to load http://www.w3.org/2001/XMLSchema.dtd explicitly,
> >it is loaded through my resolver.
> >
> >I am willing to make a patch for fixing this bug. Can anyone please
> >check this bug against Xerces 2.6?
> >
> >Should I instead write to xerces-c-dev?
> >
> >Regards.
> 
> 

Re: EntityResolver

Posted by Khlebnikov Alexei <AK...@belsoft.by>.
Thanks a lot, it helped. Of course I've also added the correspondent
declaration to XSDDOMParser.hpp.

Regards,
Alexei.



On Fri, 2005-06-17 at 19:12 +0200, Alberto Massari wrote:
> Hi Alexei,
> this should be fixed in Xerces 2.6 (rev. 1.13 of 
> validators/schema/XSDDOMParser.cpp). Just apply this patch to the 2.5 sources
> 
> 
> ===================================================================
> RCS file: 
> /home/cvspublic/xml-xerces/c/src/xercesc/validators/schema/XSDDOMParser.cpp,v
> retrieving revision 1.12
> retrieving revision 1.13
> diff -u -r1.12 -r1.13
> --- XSDDOMParser.cpp    2004/01/29 11:52:31     1.12
> +++ XSDDOMParser.cpp    2004/04/06 14:42:34     1.13
> @@ -55,7 +55,7 @@
>    */
> 
>   /**
> -  * $Id: XSDDOMParser.cpp,v 1.12 2004/01/29 11:52:31 cargilld Exp $
> +  * $Id: XSDDOMParser.cpp,v 1.13 2004/04/06 14:42:34 amassari Exp $
>     */
> 
> 
> @@ -553,6 +553,15 @@
>   {
>       if (fUserEntityHandler)
>           return fUserEntityHandler->resolveEntity(publicId, systemId, 
> baseURI);
> +
> +    return 0;
> +}
> +
> +InputSource*
> +XSDDOMParser::resolveEntity(XMLResourceIdentifier* resourceIdentifier)
> +{
> +    if (fUserEntityHandler)
> +        return fUserEntityHandler->resolveEntity(resourceIdentifier);
> 
>       return 0;
>   }
> 
> 
> AlbertoAt 12.01 17/06/2005 +0300, Khlebnikov Alexei wrote:
> >Hello.
> >
> >I encounter problems with EntityResover (as well as with
> >XMLEntityResolver and DOMEntityResolver) in Xerces-C++ 2.5.0.
> >I've made my resolver that serves URIs from the local
> >filesystem, but not all entities are resolved through resolver!
> >
> >For example, if I invoke XercesDOMParser::loadGrammar()
> >for loading
> >http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
> >schema, it tries to get http://www.w3.org/2001/XMLSchema.dtd
> >from the Net (and fails because I am behind the firewall).
> >If I try to load http://www.w3.org/2001/XMLSchema.dtd explicitly,
> >it is loaded through my resolver.
> >
> >I am willing to make a patch for fixing this bug. Can anyone please
> >check this bug against Xerces 2.6?
> >
> >Should I instead write to xerces-c-dev?
> >
> >Regards.
> 
> 



Re: EntityResolver

Posted by Alberto Massari <am...@datadirect.com>.
Hi Alexei,
this should be fixed in Xerces 2.6 (rev. 1.13 of 
validators/schema/XSDDOMParser.cpp). Just apply this patch to the 2.5 sources


===================================================================
RCS file: 
/home/cvspublic/xml-xerces/c/src/xercesc/validators/schema/XSDDOMParser.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XSDDOMParser.cpp    2004/01/29 11:52:31     1.12
+++ XSDDOMParser.cpp    2004/04/06 14:42:34     1.13
@@ -55,7 +55,7 @@
   */

  /**
-  * $Id: XSDDOMParser.cpp,v 1.12 2004/01/29 11:52:31 cargilld Exp $
+  * $Id: XSDDOMParser.cpp,v 1.13 2004/04/06 14:42:34 amassari Exp $
    */


@@ -553,6 +553,15 @@
  {
      if (fUserEntityHandler)
          return fUserEntityHandler->resolveEntity(publicId, systemId, 
baseURI);
+
+    return 0;
+}
+
+InputSource*
+XSDDOMParser::resolveEntity(XMLResourceIdentifier* resourceIdentifier)
+{
+    if (fUserEntityHandler)
+        return fUserEntityHandler->resolveEntity(resourceIdentifier);

      return 0;
  }


AlbertoAt 12.01 17/06/2005 +0300, Khlebnikov Alexei wrote:
>Hello.
>
>I encounter problems with EntityResover (as well as with
>XMLEntityResolver and DOMEntityResolver) in Xerces-C++ 2.5.0.
>I've made my resolver that serves URIs from the local
>filesystem, but not all entities are resolved through resolver!
>
>For example, if I invoke XercesDOMParser::loadGrammar()
>for loading
>http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
>schema, it tries to get http://www.w3.org/2001/XMLSchema.dtd
>from the Net (and fails because I am behind the firewall).
>If I try to load http://www.w3.org/2001/XMLSchema.dtd explicitly,
>it is loaded through my resolver.
>
>I am willing to make a patch for fixing this bug. Can anyone please
>check this bug against Xerces 2.6?
>
>Should I instead write to xerces-c-dev?
>
>Regards.