AppendValue (XmlNode subroutine): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
mNo edit summary |
||
Line 23: | Line 23: | ||
==Example== | ==Example== | ||
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_') | ||
Line 34: | Line 34: | ||
</p> | </p> | ||
The result is: | The result is: | ||
<p class="output"><a>begin value_some more_and more& | <p class="output"><a>begin value_some more_and more&#xA;and that's all</a> | ||
</p | </p> | ||
==Request- | ==Request-cancellation errors== | ||
<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"> | <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> |
Revision as of 21:05, 31 May 2011
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
and that's all</a>
Request-cancellation errors
- 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
.