AppendValue (XmlNode subroutine): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (→Example) |
||
Line 33: | Line 33: | ||
<var>Stringlist</var> to an Element value: | <var>Stringlist</var> to an Element value: | ||
<p class="code">%n = %x:AddElement('a', 'begin value') | <p class="code">%n = %x:AddElement('a', 'begin value') | ||
%n: | %n:AppendValue('_some more_') | ||
Text To %sl | Text To %sl | ||
and more | and more | ||
and that's all | |||
End Text | End Text | ||
%n: | %n:AppendValue(%sl) | ||
%n:Print | %n:Print | ||
</p> | </p> |
Revision as of 18:10, 7 February 2011
Append to value of node (XmlNode class)
[Requires Janus SOAP]
This subroutine appends a
Unicode string or a Stringlist object to an XmlNode value.
AppendValue is new as of version 7.6 of the Sirius Mods.
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. |
---|---|
value | 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.
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
and that's all</a>
Request-Cancellation Errors
- nod 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.
- value violates the rules for XML Element content (that is, it contains an invalid character).
- Insufficient free space exists in CCATEMP.
See also
- Like AppendValue, AddText adds a string to and after a Text node, but only if the AdjacentText property is set to Combine.