[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


To: ietf-provreg@cafax.se
From: Otmar Lendl <lendl+provreg@nic.at>
Date: Mon, 19 May 2003 15:59:06 +0200
Content-Disposition: inline
Sender: owner-ietf-provreg@cafax.se
User-Agent: Mutt/1.5.3i
Subject: [ietf-provreg] XML namespace shortcuts


I've recently come across some issues concerning the use of XML
namespaces within EPP. I think the draft could be a bit more explicit here.

According to http://www.rpbourret.com/xml/NamespacesFAQ.htm#q3_2 ,
namespace definitions tie namespace Names to prefixes; in the case
of epp, this is done e.g. here:

   <host:create xmlns:host="urn:ietf:params:xml:ns:host-1.0">

which makes "host:" basically a shortcut for "urn:ietf:params:xml:ns:host-1.0".

The lastest draft says:

  The EPP <create> command provides a transform operation that allows a
  client to create a host object.  In addition to the standard EPP
  command elements, the <create> command MUST contain a <host:create>
  element that identifies the host namespace and the location of the
  host schema.  

This is IMHO ambiguous. As I read it, it requires that the <create>
tag must be put into the "urn:ietf:params:xml:ns:host-1.0" namespace.

But one could also read that paragraph as requiring that the prefix must
always be "host:". After all, in all the examples that is the case.


What are the real implications?

Example mod_epp:

	mod_epp parses the XML into a DOM-tree and then serializes the
	tree again when passing the command to the backend. The
	expat-light library included in Apache 2.0 uses simple 
	prefixes for all known namespaces when serializing, thus it turns:

	<?xml version="1.0" encoding="UTF-8" standalone="no"?>
	<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
	     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	     xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
	     epp-1.0.xsd">
	  <command>
	    <create>
	      <host:create
	       xmlns:host="urn:ietf:params:xml:ns:host-1.0"
	       xsi:schemaLocation="urn:ietf:params:xml:ns:host-1.0
	       host-1.0.xsd">
		<host:name>ns1.example.com</host:name>
		<host:addr ip="v4">192.0.2.2</host:addr>
		<host:addr ip="v4">192.0.2.29</host:addr>
		<host:addr ip="v6">1080:0:0:0:8:800:200C:417A</host:addr>
	      </host:create>
	    </create>
	    <clTRID>ABC-12345</clTRID>
	  </command>
	</epp>

	into

	<ns2:epp ns1:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
	epp-1.0.xsd" xmlns:ns3="urn:ietf:params:xml:ns:host-1.0"
	xmlns:ns2="urn:ietf:params:xml:ns:epp-1.0"
	xmlns:ns1="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="DAV:">
	  <ns2:command>
	    <ns2:create>
	      <ns3:create ns1:schemaLocation="urn:ietf:params:xml:ns:host-1.0
	host-1.0.xsd">
		<ns3:name>ns1.example.com</ns3:name>
		<ns3:addr ip="v4">192.0.2.2</ns3:addr>
		<ns3:addr ip="v4">192.0.2.29</ns3:addr>
		<ns3:addr ip="v6">1080:0:0:0:8:800:200C:417A</ns3:addr>
	      </ns3:create>
	    </ns2:create>
	    <ns2:clTRID>ABC-12345</ns2:clTRID>
	  </ns2:command>
	</ns2:epp> 

	(the xmlns:ns0="DAV:" is leftover from the webDAV implementation
	which caused expat to be included in Apache.)

	As I understand XML namespaces, these two paragraphs define
	the same XML object.

	Is the seconds paragraph RFC-draft-compliant?

Example OpenReg

	OpenReg 1.0.1 completely ignores the namespace definition and
	only relies on the tag's name as encountered between < and >. 
	Thus it would choke on the second paragraph from above.

	Is that ok?

	[I've sent the ISC people a patch which solves this, btw. That
	was only about ~20 lines of diff.]

-=-=-=

I think the correct solution is to allow arbitrary namespace prefixes.

Comments?

/ol
-- 
< Otmar Lendl <lendl@nic.at>  | nic.at Systems Engineer >

Home | Date list | Subject list