AppendValue (XmlNode subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (move footer template to actual end (otherwise subsequent intervening text gets omitted); edits, tags and links)
 
(4 intermediate revisions by 4 users not shown)
Line 23: Line 23:


==Example==
==Example==
<ol><li>The following fragment appends a <var>Unicode</var> string and then a <var>Stringlist</var> to an <var>Element</var> value:
The following fragment appends a <var>Unicode</var> string and then a <var>Stringlist</var> to an <var>Element</var> value:
<p class="code">%n = %x:[[AddElement_(XmlDoc/XmlNode_function)|addElement]]('a', 'begin value')
<p class="code">%n = %x:[[AddElement_(XmlDoc/XmlNode_function)|addElement]]('a', 'begin value')
%n:appendValue('_some more_')
%n:appendValue('_some more_')
[[Text_and_Html_statements#The_HTML_or_TEXT_statement|text to]] %sl
[[Text_and_Html_statements#toOption|text to]] %sl
   and more
   and more
   and that's all
   and that's all
Line 34: Line 34:
</p>
</p>
The result is:
The result is:
<p class="output"><a>begin value_some more_and more&amp;amp;#xA;and that's all</a>
<p class="output"><a>begin value_some more_and more&amp;#xA;and that's all</a>
</p></ol>
</p>


==Request-Cancellation Errors==
==Request-cancellation errors==
This list is not exhaustive: it does <i>not</i> include all the errors that are request cancelling.
<ul>
<ul>
<li><var class="term">nod</var> does not point to an <var>XmlNode</var>.
<li>The <var class="term">nod</var> argument does not point to an <var>XmlNode</var>.
<li><var class="term">nod</var> points to the <var>Root</var> node.
<li><var class="term">nod</var> points to the <var>Root</var> node.
<li><var class="term">nod</var> points to an <var>Element</var> node that has more than one child, or that has one, non-<var>Text</var> node child.
<li><var class="term">nod</var> points to an <var>Element</var> node that has more than one child, or that has one, non-<var>Text</var> node child.
<li><var class="term">appendValue</var> violates the rules for XML Element content (that is, it contains an invalid character).
<li>The <var class="term">appendedValue</var> argument violates the rules for XML Element content (that is, it contains an invalid character).
<li>Insufficient free space exists in CCATEMP.
<li>Insufficient free space exists in CCATEMP.
</ul>
</ul>

Latest revision as of 18:48, 1 September 2015

Append to value of node (XmlNode class)

[Requires Janus SOAP]

AppendValue appends a Unicode string or a Stringlist object to an XmlNode value.

Syntax

nod:AppendValue( appendedValue)

Syntax terms

nod An XmlNode that is not the Root node. If it is an Element node, it may have at most one child, and any such child must be a Text node.
appendedValue A Unicode string or a Stringlist object.

Usage notes

  • The method argument must be a Unicode string or a Stringlist object:
    • If a Unicode string, the value of the target node is set to its current value followed by the Unicode string.
    • If a Stringlist object, the value of the target node is set to its current value followed by the Stringlist items converted from EBCDIC to Unicode, with Unicode linefeed characters between the Stringlist items.
  • AppendValue is available in Sirius Mods Version 7.6 and later.

Example

The following fragment appends a Unicode string and then a Stringlist to an Element value:

%n = %x:addElement('a', 'begin value') %n:appendValue('_some more_') text to %sl and more and that's all end text %n:appendValue(%sl) %n:print

The result is:

<a>begin value_some more_and more&#xA;and that's all</a>

Request-cancellation errors

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

  • The nod argument does not point to an XmlNode.
  • nod points to the Root node.
  • nod points to an Element node that has more than one child, or that has one, non-Text node child.
  • The appendedValue argument violates the rules for XML Element content (that is, it contains an invalid character).
  • Insufficient free space exists in CCATEMP.

See also

  • AddText also adds a string to and after a Text node, but only if the AdjacentText property is set to Combine.