[XML-SIG] Draft PEP for Using None in Namespace URIs

Thomas B. Passin tpassin@home.com
Tue, 30 Jan 2001 01:43:57 -0500


Here is a first draft of a PEP about the value for the namespace uri when it
is "empty".  I modeled the PEP after the Python PEP guidelines.  Of course,
the main Python PEPs are written in ascii and there is a python script to
convert them to html.  But for fun, I created an xml format.  A stylesheet
will follow as I get time.  Other XML PEPs could be written in ascii if the
author wants.

Please comment - all useful material will find its way into the PEP.
Especially, would someone please give the main arguments for using the empty
string instead of None, and also if there are casees where one or the other
shuld be used, please identify them.

We need to have a home for these things - someone want to start a cvs branch,
or should be just have it in the files section of the SF pyxml pages?  Until
there is a home, we can just keep including it in emails, I think.

If anyone wants to take this one over, feel free, and add your name to the
author list.  Let's try to keep the discussion so that it can fit into the PEP
(as extended, of course).  The idea is that when stabilized, the PEP will be a
permanent record of whatever pyxml has decided and why.

We also need to figure out typical copyright statements (the Python PEP
gudelines call for copyright statements).

Finally, I invite everyone to suggest more topics for other PEPs we may find
helpful.

Cheers,

Tom P

=======================================================================
<?xml version='1.0'?>
<xmlpep>
 <headers>
  <pep_number>xmlpep-1</pep_number>
  <pep_title>Values for Null Or Empty Namespace URIs</pep_title>
  <pep_version>0.10</pep_version>
  <cvs_version_string/>
  <list_of_authors>
   <author name='Thomas B. Passin' email='tpassin@home.com'/>
  </list_of_authors>
  <status>Draft</status>
  <type>Standards Track</type>
  <created>29-Jan-2001</created>
  <history>
   <post date='29-Jan-2001'/>
  </history>
 </headers>
 <abstract>
  This PEP specifies the proper values of the Namespace URI property
  when its value might appear to be either "null", "None", or the
  empty string.

  The XMLPEP, when approved, will apply to all namespace-aware software
  maintained by the pyxml interest group.
 </abstract>
 <specification>
  <para title='Namespace-aware applications'>
   When no namespace has been declared whose scope applies to a
   particular element or attribute, the application MUST report the
   URI of the namespace of the element or attribute as None.

   When a namespace applies but its URI value is empty or null or None,
   the application MUST report the URI of the namespace value as None.
  </para>
  <para title='Namespace-ignorant applications'>
   This requirement does not apply for applications that are not
   namespace-aware.
  </para>
  <para title='Applicability'>
   Applies to all XML processing software maintained by the pyxml
   interest group.
  </para>
 </specification>
 <rationale>
  <para title='Definitive Treatment Needed'>
  This PEP is needed because of continued uncertainty among varous pyxml
  developers as to the proper values to use, and because of inconsistency
  among various pyxml products.  Differences between Python, IDL, and Java
  make it difficult to interpret existing W3C Recommendations
  unambiguously in this regard.

  A definitive and consistent treatment is needed so that all the pyxml
  software may be brought into agreement.
  </para>

  <para title='Arguments for "None"'>
   Most references in the Recommendations to the cases in question
   refer to "null" values.  Python offers a data object well adapted to
   indicate such values.  It is the None object.  The None object can
   be tested for exactly as for an empty string:

    <code>if uri:
                          doYourThing()
    </code>

   Alternatively, None can be tested for explicitely, as in:

    <code>if uri is not None:
                          doYourThing()
    </code>

   Thus, None is flexible enough to be useful in this application.
   Should there be some situation in which the use of an empty string
   would be logical or advantageous, it would be clearly distinguishable
   from the normal case where the value is None.

   Future versions of this PEP should specifify clearly in what
   situations, if any, an empty string should be used in lieu of
   the None object.
  </para>

 </rationale>
 <reference_implementation>[Should there be a reference here to one
  particular processor, such as xmlproc?]
 </reference_implementation>
 <notes></notes>
 <references></references>
 <copyright>This PEP may be used by anyone.</copyright>
</xmlpep>