Namespace (XmlDoc property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
 
 
(One intermediate revision by the same user not shown)
Line 15: Line 15:
===XmlNamespaceSetting enumeration===
===XmlNamespaceSetting enumeration===
The values of the <var>Namespace</var> property are of type <var>[[Enumerations|Enumeration]]</var> <var>XmlNamespaceSetting</var>; these values and their meanings are shown below:
The values of the <var>Namespace</var> property are of type <var>[[Enumerations|Enumeration]]</var> <var>XmlNamespaceSetting</var>; these values and their meanings are shown below:
<table>
<table class="thJustBold">
<tr><th>On</th>
<tr><th>On</th>
<td>This is the initial value of the <var>Namespace</var> property.  With this setting, the requirements imposed by the [http://www.w3.org/TR/REC-xml-names/ XML Namespaces Recommendation] are followed by <var class="product">[[Janus SOAP]]</var>.  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.</td></tr>
<td>This is the initial value of the <var>Namespace</var> property.  With this setting, the requirements imposed by the [http://www.w3.org/TR/REC-xml-names/ XML Namespaces Recommendation] are followed by <var class="product">[[Janus SOAP]]</var>.  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.</td></tr>
Line 47: Line 47:
</ul></td></tr></table>
</ul></td></tr></table>


'''Note:''' As with all enumerations, the <var>ToString</var> method implicitly converts an enumeration value to a character string whose value is the name of the enumeration value. For more information about methods available to all enumerations, see [[Enumerations#Common enumeration methods|"Common enumeration methods"]].
<p class="note">'''Note:''' As with all enumerations, the <var>ToString</var> method implicitly converts an enumeration value to a character string whose value is the name of the enumeration value. For more information about methods available to all enumerations, see [[Enumerations#Common enumeration methods|Common enumeration methods]]. </p>


==Usage notes==
==Usage notes==
Line 63: Line 63:


==Request-cancellation errors (for set method)s==
==Request-cancellation errors (for set method)s==
This list is not exhaustive: it does <i>not</i> include all the errors that are request  cancelling.
<ul>
<ul>
<li><var>XmlDoc</var> contains an <var>Element</var> node.
<li><var>XmlDoc</var> contains an <var>Element</var> node.

Latest revision as of 19:47, 23 July 2014

(Dis)allow or disable prefix handling (XmlDoc class)

Namespace 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

%currentXmlNamespaceSetting The XmlNamespaceSetting enumeration value of doc's Namespace property. Valid values are On, Ignore, and None, as described below.
doc An XmlDoc object expression.
newXmlNamespaceSetting The XmlNamespaceSetting enumeration value to assign to doc's Namespace property.

XmlNamespaceSetting enumeration

The values of the Namespace property are of type Enumeration XmlNamespaceSetting; these values and their meanings are shown below:

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:
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.

Note: As with all enumerations, the ToString method implicitly converts an enumeration value to a character string whose value is the name of the enumeration value. For more information about methods available to all enumerations, see Common enumeration methods.

Usage notes

  • The Namespace property may not be changed if an XmlDoc contains an Element node.
  • 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.

Examples

The following example obtains the string value of the Namespace property:

%str = doc:namespace:toString

Request-cancellation errors (for set method)s

This list is not exhaustive: it does not include all the errors that are request cancelling.

  • XmlDoc contains an Element node.

See also