Re: [EPP-discuss] Draft EPP Specification rev. 1.0 and invitation to meeting/workshop

From: Teddy Hogeborn <teddy.h+dk-epp_at_nmugroup.com>
Date: Thu, 01 Nov 2012 15:09:10 +0100

"Jonas B. Nielsen" <jonasbn_at_dk-hostmaster.dk> writes:

> Thanks for your very insightful response. I have changed our XSD
> implementation to reflect your suggestions, I have however run into
> some minor issues.
>
> If you take an example of creating a host object:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <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">

Side note: you could skip the xsi:schemaLocation (and therefore also the
xmlns:xsi attribute); it's unnecessary for EPP clients.

> <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>ns2.eriktester.dk</host:name>
> <host:addr ip="v4">127.0.0.1</host:addr>
> <host:addr ip="v6">0:0:0:0:0:0:0:1</host:addr>
> </host:create>
> </create>
> <extension>
> <dkhm-host:responsible xmlns:dkhm-host="urn:dkhm:params:xml:ns:dkhm-host-1.0" xsi:schemaLocation="urn:dkhm:params:xml:ns:dkhm-host-1.0 dkhm-host-1.0.xsd">TEST1234-DK</dkhm-host:responsible>
> </extension>
> <clTRID>6d5367c0ac54b1be06d60e385866f8c9</clTRID>
> </command>
> </epp>
>
> Our extension is the dkhm-host:responsible specified in the extension
> segment.
>
> In your own (dkhm-host-1.0.xsd), do you specify a createType or do you
> specify and extension.

Don't try to modify the existing createType; just specify your own types
and elements, and then use them in the <epp:extension> element.

> I have seen examples of both, but our validator keeps complaining
> about the dkhm-host:responsible object.
>
> XML parsing failed xmlns:dkhm-host: 'urn:dkhm:params:xml:ns:dkhm-host-1.0 xsi:schemaLocation="urn:dkhm:params:xml:ns:dkhm-host-1.0 dkhm-host-1.0.xsd"' is not a valid URI

The problem of mapping URIs to schema file locations is up to the
validator, and should not be an issue for disussion here.

> Currently my XSD look as follows:
>
> <?xml version="1.0" encoding="utf-8"?>
> <schema targetNamespace="urn:dkhm:params:xml:ns:dkhm-host-1.0"
> xmlns:dkhm-host="urn:dkhm:params:xml:ns:dkhm-host-1.0"
> xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
> xmlns="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
[...]
> <!--
> Child elements found in EPP commands.
> -->
> <element name="create" type="dkhm-host:createType" />

Won't that specify a <dkhm-host:create> element? I don't see why you
would want to do that. If your aim was to alter the <host:create>
element, you:

1. Probably don't need to do that. Why do you want to?

2. Should probably be refering to its name in the correct namespace by
   writing name="host:create" and adding
   xmlns:host="urn:ietf:params:xml:ns:host-1.0" to the root element.

3. Probably must use the XML Schema <restriction> element.

> <!--<element name="extension">
> <complexType>
> <choice>
> <element name="responsible" type="dkhm-host:responsible" minOccurs="1" maxOccurs="1" />
> </choice> </complexType>
> </element>-->

I would think that this (commented out) section should be omitted
completely. As far as I know, the contents of <epp:extension> elements
should not be subject to validation.

[...]
> <!--
> Child elements of the <create> command.
> -->
> <complexType name="createType">
> <sequence>
> <element name="responsible" type="dkhm-host:responsible" minOccurs="1" maxOccurs="1" />
> </sequence>
> </complexType>
> <!--
> End of schema.
> -->
> </schema>

This type, as far as I can tell, is only used by the unused
<dkhm-host:create> element.

Anyway, I am far from an XML and XML Schema expert, and have probably
more than exhausted my expertise in this reply. I would be delighted to
have more people weigh in with more opinions.

/Teddy Hogeborn

-- 
System Administrator at Nordisk Media Utveckling AB
https://www.nmugroup.com/	tel:+46.40304770
Received on Thu Nov 01 2012 - 15:09:10 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 06 2015 - 11:39:05 CET