2
votes

I have found that the xmldsig-core-schema.xsd file that I was using in my application has a header that caused HTTP request to w3.org during marshaller instantiation, I removed this header and now I'm wondering if it can have any effect in the validation of XML documents. I'm familiar with the use of DOCTYPES on HTML or XML documents, but what is the purpose of it on an XSD file?

The xsd is available at: http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd

The snippet in question is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
   <!ATTLIST schema 
     xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
   <!ENTITY % p ''>
   <!ENTITY % s ''>
  ]>
<!-- Schema for XML Signatures ...
-->
<schema...
1

1 Answers

2
votes

An XSD file is just another XML file. As such, it does the same thing as in the other instances you mentioned you're familiar with.

Reading on, it expects:

  • the schema element to have the xmlns:ds attribute as defined, with a fixed value
  • A user defined entity, dsig, that should be replaced with http://www.w3.org/2000/09/xmldsig#
  • Two parameter entities, %p and %s, to be replaced with the empty string where encountered. For these two you have to take a look at the XMLSchema.dtd, and notice the use of the %p and %s entities, to define the namespace prefix as xs: in schema document; the authors preferred to use no prefix, in the dsig case.