Go directly to main content.

<attribute name="xmlns"> is a bug

Project:EPUB Maintenance
Component:Open Container Format (OCF)
Category:bug report
Priority:critical
Assigned:GConboy
Status:completed @ 2.0.1

<attribute name="xmlns">

 

in APPENDIX A: RELAX NG OCF Schema is clearly a bug, since 4.16 in the OASIS RELAX NG committee specification disallows "xmlns" here.

A name element that occurs as the first child of an attribute element or as the descendant of the first child of an attribute element and that has an ns attribute with value equal to the empty string must not have content equal to xmlns.

Description
Issue Id: 
43
Resolution: 

Insert resolution here.

Comments

#1

 What is an alternate (or correct) way to encode in RNG, that our <container> element, must have an "xmlns" attribute with a value of "urn:oasis:names:tc:opendocument:xmlns:container"?

#2

In RELAX NG, you can specify the namespace and local name of permissible elements, but cannot indicate any constraints on prefixes.

#3

 Can a resolution be proposed in form of "change XXX to YYY" in the RNG Schema?  No prefix constraints are being established -- the value of the xmlns attribute on the <container> is to be constrained (similarly for the <signatures> and <encryption> elements).

#4

This should work.

 

<?xml version="1.0" encoding="UTF-8"?>
<choice xmlns="http://relaxng.org/ns/structure/1.0"  ns="urn:oasis:names:tc:opendocument:xmlns:container">
  <element name="container">
    <attribute name="version">
      <value>1.0</value>
    </attribute>
    <element name="rootfiles">
      <oneOrMore>
        <element name="rootfile">
          <attribute name="full-path">
            <text/>
          </attribute>
          <attribute name="media-type">
            <text/>
          </attribute>
        </element>
      </oneOrMore>
    </element>
  </element>

  <element name="signatures">
    <oneOrMore>
      <element name="Signature" ns="http://www.w3.org/2001/04/xmldsig#">
        <externalRef
         href="http://www.w3.org/Signature/2002/07/xmldsig-core-schema.rng"/>
      </element>
    </oneOrMore>
  </element>

  <element name="encryption">
    <oneOrMore>
      <choice>
        <element name="EncryptedData" ns="http://www.w3.org/2001/04/xmlenc#">
          <externalRef
           href="http://www.w3.org/Encryption/2002/07/xenc-schema.rng"/>
        </element>
        <element name="EncryptedKey" ns="http://www.w3.org/2001/04/xmlenc#">
          <externalRef
           href="http://www.w3.org/Encryption/2002/07/xenc-schema.rng"/>
        </element>
      </choice>
    </oneOrMore>
  </element>

</choice>

 

#5

Assigned to:Anonymous» GConboy
Status:open» accepted

#6

Status:accepted» completed @ 2.0.1