Subject: [KEYPROV] XSD "import" question

From: "Rundgren, Anders" <[email-masked]>
Date: Sun, 21 Oct 2007 09:13:57 +0100

Hi,
The following is by no means a showstopper but may anyway be worth a
considerations.  Having looked around quite a bit regarding the "true"
way of writing XML Schemas I have come to the conclusion that the unity
is fairly limited.   One thing that really differs is the declaration of
XSD "import" as shown below.

XKMS2:
<import namespace="http://www.w3.org/2000/09/xmldsig#"
schemaLocation="xmldsig-core-schema.xsd" />

DSKPP:
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
schemaLocation="http://www.w3.org/TR/2002/
   REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>

XKMS' import declaration refers to a non-normative local file-name which
does not appear to be entirely optimal for a strict definition.

DSKPP's import declaration refers to a "live" URL which may be
authoritative but even if it is, few real-world systems actually read
schemas on-the-fly.  In fact, this would probably be a bad thing from a
security-point of view.

Since the majority of XML processors[1,2] in use today support the
concept of preloaded schemas (the ones that you intend to process, no
more, no less), it seems that the leanest and cleanest import
declaration is also the most suited for contemporary security protocols
like DSKPP:

<import namespace="http://www.w3.org/2000/09/xmldsig#"/>

For the presumably rare cases where you use dated XML processors or XSD
design tools, you may indeed have to edit import declarations to fit
local requirements.  This typically involves ugly stuff like
"C:\myxml\xmldsig-core-schema.xsd" but that is something XSD designers
IMHO should not bother about.

Regards
Anders Rundgren

1]Xerces2:
java -cp xercesSamples.jar xni.XMLGrammarBuilder -F -a
xmldsig-core-schema.xsd myprotocol.xsd -i myrequest.xml

2]MSXML6:
var cache = new ActiveXObject("Msxml2.XMLSchemaCache.6.0");
cache.add("http://www.w3.org/2000/09/xmldsig#",
"xmldsig-core-schema.xsd");
cache.add("http://myprot.org/schema", "myprotocol.xsd");
var xmldoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
xmldoc.schemas = cache;
xmldoc.setProperty ("SelectionLanguage", "XPath");
xmldoc.setProperty ("SelectionNamespaces",
"xmlns:ms='urn:schemas-microsoft-com:xslt'");

xmldoc.async = false;
xmldoc.load("myrequest.xml");
	
if(xmldoc.parseError.errorCode != 0)
    WScript.Echo("Houston, we have a problem: " +
xmldoc.parseError.errorCode + " " + xmldoc.parseError.reason);
else
    WScript.Echo("no problems!");

_______________________________________________
KEYPROV mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/keyprov