Namespace (XmlDoc property): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (edits, tags and links) |
||
Line 1: | Line 1: | ||
{{Template:XmlDoc:Namespace subtitle}} | {{Template:XmlDoc:Namespace subtitle}} | ||
<var>Namespace</var> determines namespace handling in the <var>XmlDoc</var>, with the mapping of QName (qualified name) prefixes to namespace URIs. | |||
==Syntax== | ==Syntax== | ||
{{Template:XmlDoc:Namespace syntax}} | {{Template:XmlDoc:Namespace syntax}} | ||
Line 8: | Line 7: | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%currentXmlNamespaceSetting</th> | <tr><th>%currentXmlNamespaceSetting</th> | ||
<td>The <var>XmlNamespaceSetting</var> enumeration value of <var class="term">doc</var>'s <var>Namespace</var> property. Valid values are <code>On</code>, <code>Ignore</code>, and <code>None</code>, as described in "Usage Notes, | <td>The <var>XmlNamespaceSetting</var> enumeration value of <var class="term">doc</var>'s <var>Namespace</var> property. Valid values are <code>On</code>, <code>Ignore</code>, and <code>None</code>, as described in [[#Usage_Notes|"Usage Notes"]], below.</td></tr> | ||
<tr><th>doc</th> | <tr><th>doc</th> | ||
<td>An <var>XmlDoc</var> object expression. </td></tr> | <td>An <var>XmlDoc</var> object expression.</td></tr> | ||
<tr><th>newXmlNamespaceSetting</th> | <tr><th>newXmlNamespaceSetting</th> | ||
<td>The <var>XmlNamespaceSetting</var> enumeration value to assign to < | <td>The <var>XmlNamespaceSetting</var> enumeration value to assign to <var class="term">doc</var>'s <var>Namespace</var> property.</td></tr> | ||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul> | ||
<li>The <var>Namespace</var> property may not be changed if an <var>XmlDoc</var> contains an | <li>The <var>Namespace</var> property may not be changed if an <var>XmlDoc</var> contains an <var>Element</var> node. | ||
Element node. | <li>The values of the <var>Namespace</var> property are of type [[Enumeration]] <var>XmlNamespaceSetting</var>; these values, and their meanings, are shown below. | ||
<li>The values of the <var>Namespace</var> property are of type Enumeration <var>XmlNamespaceSetting</var>; | |||
these values, and their meanings, are shown below | |||
<dl> | <dl> | ||
<dt>On | <dt>On | ||
<dd>This is the initial value of the <var>Namespace</var> property. | <dd>This is the initial value of the <var>Namespace</var> property. With this setting, the requirements imposed by the XML Namespaces Recommendation are followed by <var class="product">[[Janus SOAP|"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. | ||
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. | |||
<dt>Ignore | <dt>Ignore | ||
<dd>With this setting, namespaces are not handled in any way | <dd>With this setting, namespaces are not handled in any way by <var class="product">[[Janus SOAP|"Janus Soap"]]</var>; specifically: | ||
by [[Janus SOAP]]; specifically: | |||
<ul> | <ul> | ||
<li>Every name in the document is treated as a character string, | <li>Every name in the document is treated as a character string, which may include a colon. | ||
which may include a colon. | <li>A namespace declaration during deserialization is simply treated as an attribute, whose name begins with the characters "xmlns". | ||
<li>A namespace declaration during deserialization is simply treated as an | <li>The request is cancelled if the URI argument is passed by an Element- or Attribute-adding method like <var>[[AddElement (XmlDoc/XmlNode function)|AddElement]]</var>, <var>[[AddAttribute (XmlNode function)|AddAttribute]]</var>, <var>[[InsertElementBefore (XmlNode function)|InsertElementBefore]]</var>, and so on. | ||
attribute, whose name begins with the characters "xmlns". | <li>Invoking the <var>[[SelectionNamespace_(XmlDoc_property)|SelectionNamespace]]</var> property causes a request cancellation. | ||
<li>The request is cancelled if the URI argument is passed by | <li>Invoking the <var>[[LocalName (XmlDoc/XmlNode function)|LocalName]]</var>, <var>[[Prefix (XmlDoc/XmlNode function)|Prefix]]</var>, or <var>[[URI (XmlDoc/XmlNode function)|URI]]</var> functions | ||
an Element- or Attribute-adding method like | |||
<var>[[AddElement (XmlDoc/XmlNode function)|AddElement]]</var>, [[AddAttribute (XmlNode function)|AddAttribute]], | |||
[[InsertElementBefore (XmlNode function)|InsertElementBefore]], and so on. | |||
<li>Invoking the <var>SelectionNamespace</var> property causes a request cancellation. | |||
<li>Invoking the <var>[[LocalName (XmlDoc/XmlNode function)|LocalName]]</var>, <var>[[Prefix (XmlDoc/XmlNode function)|Prefix]]</var>, or <var>[[URI (XmlDoc/XmlNode function)|URI]]</var> | |||
causes a request cancellation. | causes a request cancellation. | ||
<li>Invoking the <var>AddNamespace</var> subroutine causes a request cancellation. | <li>Invoking the <var>[[AddNamespace_(XmlNode_subroutine)|AddNamespace]]</var> subroutine causes a request cancellation. | ||
</ul> | </ul> | ||
<dt>None | <dt>None | ||
<dd>With this setting, namespaces are not allowed in a document; | <dd>With this setting, namespaces are not allowed in a document; specifically: | ||
specifically: | |||
<ul> | <ul> | ||
<li>Any name including a colon causes a request cancellation. | <li>Any name including a colon causes a request cancellation. | ||
<li>Any namespace declaration during deserialization causes a request cancellation | <li>Any namespace declaration during deserialization causes a request cancellation (prior to <var class="product">[[Sirius Mods|"Sirius Mods"]]</var> Version 7.7, default namespace declarations were deserialized as if they were attributes). | ||
(prior to | <li>The request is cancelled if the <var class="term">URI</var> argument is passed by an Element- or Attribute-adding method like <var>[[AddElement (XmlDoc/XmlNode function)|AddElement]]</var>, <var>[[AddAttribute (XmlNode function)|AddAttribute]]</var>, <var>[[InsertElementBefore (XmlNode function)|InsertElementBefore]]</var>, and so on. | ||
they were attributes). | |||
<li>The request is cancelled if the < | |||
an Element- or Attribute-adding method like | |||
<var>[[AddElement (XmlDoc/XmlNode function)|AddElement]]</var>, <var>[[AddAttribute (XmlNode function)|AddAttribute]]</var>, | |||
<var>[[InsertElementBefore (XmlNode function)|InsertElementBefore]]</var>, and so on. | |||
<li>Invoking the <var>SelectionNamespace</var> property causes a request cancellation. | <li>Invoking the <var>SelectionNamespace</var> property causes a request cancellation. | ||
<li>Invoking the <var>[[LocalName (XmlDoc/XmlNode function)|LocalName]]</var>, <var>[[Prefix (XmlDoc/XmlNode function)|Prefix]]</var>, or <var>[[URI (XmlDoc/XmlNode function)|URI]]</var> | <li>Invoking the <var>[[LocalName (XmlDoc/XmlNode function)|LocalName]]</var>, <var>[[Prefix (XmlDoc/XmlNode function)|Prefix]]</var>, or <var>[[URI (XmlDoc/XmlNode function)|URI]]</var> functions | ||
causes a request cancellation. | causes a request cancellation. | ||
<li>Invoking the <var>AddNamespace</var> subroutine causes a request cancellation. | <li>Invoking the <var>[[AddNamespace_(XmlNode_subroutine)|AddNamespace]]</var> subroutine causes a request cancellation. | ||
</ul> | </ul> | ||
</dl> | </dl> | ||
For more information about enumerations, see [[Enumerations]]. | |||
</ul> | </ul> | ||
=== | ==Examples== | ||
<ol><li> | |||
The following example obtains the string value of the <var>Namespace</var> property: | |||
<p class="code">%str = doc:namespace:toString | |||
</p></ol> | |||
==Request-Cancellation Errors (for set method)s== | |||
<ul> | <ul> | ||
<li><var>XmlDoc</var> contains an <var>Element</var> node. | <li><var>XmlDoc</var> contains an <var>Element</var> node. | ||
</ul> | </ul> | ||
==See also== | ==See also== | ||
{{Template:XmlDoc:Namespace footer}} | {{Template:XmlDoc:Namespace footer}} |
Revision as of 06:04, 7 May 2011
(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 in "Usage Notes", below. |
---|---|
doc | An XmlDoc object expression. |
newXmlNamespaceSetting | 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.
- 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.
For more information about enumerations, see Enumerations.
Examples
-
The following example obtains the string value of the Namespace property:
%str = doc:namespace:toString
Request-Cancellation Errors (for set method)s
- XmlDoc contains an Element node.