Namespace (XmlDoc property): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Template:XmlDoc:Namespace subtitle}} | |||
[[Category:XmlDoc methods|Namespace property]] | [[Category:XmlDoc methods|Namespace property]] | ||
[[Category:XmlDoc API methods]] | [[Category:XmlDoc API methods]] | ||
Line 11: | Line 11: | ||
This property determines namespace handling in the XmlDoc, with the mapping | This property determines namespace handling in the XmlDoc, with the mapping | ||
of QName (qualified name) prefixes to namespace URIs. | of QName (qualified name) prefixes to namespace URIs. | ||
==Syntax== | |||
{{Template:XmlDoc:Namespace syntax}} | |||
===Syntax terms=== | |||
<dl> | <dl> | ||
<dt>%curr | <dt>%curr | ||
Line 22: | Line 19: | ||
<i>doc</i>'s Namespace property. | <i>doc</i>'s Namespace property. | ||
Valid values are <tt>On</tt>, <tt>Ignore</tt>, and <tt>None</tt>, | Valid values are <tt>On</tt>, <tt>Ignore</tt>, and <tt>None</tt>, | ||
as described in | as described in "Usage Notes," below. | ||
<dt>doc | <dt>doc | ||
<dd>An XmlDoc object expression. | <dd>An XmlDoc object expression. | ||
Line 31: | Line 28: | ||
</dl> | </dl> | ||
==Usage notes== | |||
<ul> | <ul> | ||
Line 55: | Line 52: | ||
which may include a colon. | which may include a colon. | ||
<li>A namespace declaration during deserialization is simply treated as an | <li>A namespace declaration during deserialization is simply treated as an | ||
attribute, whose name begins with the characters | attribute, whose name begins with the characters "xmlns". | ||
<li>The request is cancelled if the <i>URI</i> argument is passed by | <li>The request is cancelled if the <i>URI</i> argument is passed by | ||
an Element- or Attribute-adding method like | an Element- or Attribute-adding method like |
Revision as of 16:58, 22 January 2011
(Dis)allow or disable prefix handling (XmlDoc class)
Namespace is a member of the XmlDoc class.
This property determines namespace handling in the XmlDoc, with the mapping of QName (qualified name) prefixes to namespace URIs.
Syntax
%currentXmlNamespaceSetting = doc:Namespace doc:Namespace = newXmlNamespaceSetting
Syntax terms
- %curr
- The XmlNamespaceSetting enumeration value of doc's Namespace property. Valid values are On, Ignore, and None, as described in "Usage Notes," below.
- doc
- An XmlDoc object expression.
- newvalue
- The XmlNamespaceSetting enumeration value to assign to doc's Namespace property.
Usage notes
- The Namespace property may not be changed if an XmlDoc contains an Element node.
- The values of the Namespace property are of type Enumeration XmlNamespaceSetting;
these values, and their meanings, are shown below.
For more information about enumerations, see Enumerations.
- On
- This is the initial value of the Namespace property. With this setting, the requirements imposed by the XML Namespaces Recommendation are followed by Janus SOAP. That is, wherever a prefix occurs in the name of an element or attribute in the document, a namespace declaration must be in effect for that prefix.
- Ignore
- With this setting, namespaces are not handled in any way
by Janus SOAP; specifically:
- Every name in the document is treated as a character string, which may include a colon.
- A namespace declaration during deserialization is simply treated as an attribute, whose name begins with the characters "xmlns".
- The request is cancelled if the URI argument is passed by an Element- or Attribute-adding method like AddElement, AddAttribute, InsertElementBefore, and so on.
- Invoking the SelectionNamespace property causes a request cancellation.
- Invoking the LocalName, Prefix, or URI functions causes a request cancellation.
- Invoking the AddNamespace subroutine causes a request cancellation.
- None
- With this setting, namespaces are not allowed in a document;
specifically:
- Any name including a colon causes a request cancellation.
- Any namespace declaration during deserialization causes a request cancellation (prior to Sirius Mods version 7.7, default namespace declarations were deserialized as if they were attributes).
- The request is cancelled if the URI argument is passed by an Element- or Attribute-adding method like AddElement, AddAttribute, InsertElementBefore, and so on.
- Invoking the SelectionNamespace property causes a request cancellation.
- Invoking the LocalName, Prefix, or URI functions causes a request cancellation.
- Invoking the AddNamespace subroutine causes a request cancellation.
Example
The following example obtains the string value of the Namespace property:
%str = doc:Namespace:ToString
Request-Cancellation Errors (for set method)
- XmlDoc contains an Element node.