6.4. The "Declare Namespace" dialog box
Prev | 6. Dialog boxes | Next

### 6.4. The "Declare Namespace" dialog box

### Important

XXE is not namespace aware for a document using a DTD as its grammar.

Being not namespace aware means that `xmlns` attributes are treated as ordinary attributes with no special semantics. All element and attributes names (except `xml:space`, `xml:lang`, `xml:base` which belong to the "`http://www.w3.org/XML/1998/namespace`" namespace) have no namespace. Names like "`foo:bar`" are allowed.

A DTD is considered to be a grammar if it defines at least one element type. That is, a DTD only declaring entities is not considered to be a grammar.

This dialog box is not displayable for non-namespace aware documents.

This dialog box can be used

- To declare a namespace used by the name of an attribute or an element (it is required to do so before adding the element or the attribute) or used in the value of the attribute or in the textual content of the element (for example, when the document being edited is a schema).

  In practice, this is very rarely needed because document templates generally contain declarations for all the namespaces they might use.

- To change the ``prefix'' of a namespace.

  What is called a ``prefix'' here should be called the nickname or the mnemonic of the namespace. Without nickname "`xsi`" for namespace "`http://www.w3.org/2001/XMLSchema-instance`", an attribute name such as "`xsi:schemaLocation`" would be displayed as "`{http://www.w3.org/2001/XMLSchema-instance}schemaLocation`" by the GUI of XXE, which is quite unreadable.

  Real namespace prefixes only exist while the document is being loaded and while the document is being saved. Do not try to add `xmlns` attributes to elements to specify them. XXE does this automatically each time the document is saved, the nicknames declared using this dialog box being used preferably to automatically generated prefixes such as `ns`, `ns2`, `ns3`, etc.

- To make a namespace the ``default'' namespace, that is the namespace for which no prefix is displayed (for element names, not for attribute names).

  It is not recommended to mark a namespace as being ``default'' if some elements in the document have names without a namespace. In such case, it would be impossible to tell if name "`title`" is "`title`" with no namespace or is in fact "`{http://www.foo.com/namespace}title`", where "`http://www.foo.com/namespace`" has been marked as being the default namespace.

Procedure for declaring a namespace:

1. You may have to clear the form by clicking on the Cancel button

2. Specify the URI of the namespace in the Namespace field.

3. Specify the ``prefix'' of the namespace in the Prefix field.

   Specifying a prefix is mandatory even if the namespace is to be marked as ``default''.

4. Optionally mark it as being the `default'' namespace by checking the Default toggle.

5. Type Enter in any field or click on the OK button.

Procedure for changing the declaration of a namespace:

1. Select the namespace declaration to be edited by clicking on its row in the table.

2. Specify the ``prefix'' of the namespace in the Prefix field.

   Specifying a prefix is mandatory even if the namespace is to be marked as ``default''.

3. Optionally mark it as being the ``default'' namespace by checking the Default toggle.

4. Type Enter in any field or click on the OK button.

Prev | Up | Next
6.3. The "Find Element" dialog box | Home | 6.5. The spreadsheet formula editor