@@ -539,14 +539,27 @@ set the following properties:
<dd>Decodes the given HTML text value.
<p>HTML Character Entities such as <codeclass="highlighter-rouge">&amp;</code>, <codeclass="highlighter-rouge">&lt;</code>, <codeclass="highlighter-rouge">&gt;</code>, <codeclass="highlighter-rouge">&apos;</code>, and <codeclass="highlighter-rouge">&quot;</code> are
changed to &, <, >, ‘, and “.
changed to <codeclass="highlighter-rouge">&</code>, <codeclass="highlighter-rouge"><</code>, <codeclass="highlighter-rouge">></code>, <codeclass="highlighter-rouge">'</code>, and <codeclass="highlighter-rouge">"</code>.
Entities such as <codeclass="highlighter-rouge">&#xhhhh;</code>, and <codeclass="highlighter-rouge">&#nnnn;</code> are changed to the appropriate characters.</p>
<dd>Decodes the given JSON encoded value to produce a corresponding AppInventor value.
A JSON list <codeclass="highlighter-rouge">[x, y, z]</code> decodes to a list <codeclass="highlighter-rouge">(x y z)</code>, A JSON object with key A and value B,
(denoted as <codeclass="highlighter-rouge">{A:B}</code>) decodes to a list <codeclass="highlighter-rouge">((A B))</code>, that is, a list containing the two-element
list <codeclass="highlighter-rouge">(A B)</code>.</dd>
list <codeclass="highlighter-rouge">(A B)</code>.
<p>Use the method <ahref="#Web.JsonTextDecodeWithDictionaries">JsonTextDecodeWithDictionaries</a> if you
would prefer to get back dictionary objects rather than lists-of-lists in the result.</p>
<dd>Performs an HTTP POST request using the Url property and data from the specified file.
...
...
@@ -618,19 +631,54 @@ set the following properties:
a list that contains a pair of tag and string. More generally, if obj1, obj2, …
are tag-delimited XML strings, then <codeclass="highlighter-rouge"><tag>obj1 obj2 ...</tag></code> decodes to a list
that contains a pair whose first element is tag and whose second element is the
list of the decoded obj’s, ordered alphabetically by tags. Examples:
<codeclass="highlighter-rouge"><foo>123</foo></code> decodes to a one-item list containing the pair (foo, 123)
<codeclass="highlighter-rouge"><foo>1 2 3</foo></code> decodes to a one-item list containing the pair (foo,”1 2 3”)
<codeclass="highlighter-rouge"><a><foo>1 2 3</foo><bar>456</bar></a></code> decodes to a list containing the pair
(a,X) where X is a 2-item list that contains the pair (bar,123) and the pair (foo,”1 2 3”).
If the sequence of obj’s mixes tag-delimited and non-tag-delimited
items, then the non-tag-delimited items are pulled out of the sequence and wrapped
with a “content” tag. For example, decoding <codeclass="highlighter-rouge"><a><bar>456</bar>many<foo>1 2 3</foo>apples</a></code>
list of the decoded obj’s, ordered alphabetically by tags.
<p>Examples:</p>
<ul>
<li><codeclass="highlighter-rouge"><foo><123/foo></code> decodes to a one-item list containing the pair <codeclass="highlighter-rouge">(foo 123)</code></li>
<li><codeclass="highlighter-rouge"><foo>1 2 3</foo></code> decodes to a one-item list containing the pair <codeclass="highlighter-rouge">(foo "1 2 3")</code></li>
<li><codeclass="highlighter-rouge"><a><foo>1 2 3</foo><bar>456</bar></a></code> decodes to a list containing the pair <codeclass="highlighter-rouge">(a X)</code>
where X is a 2-item list that contains the pair <codeclass="highlighter-rouge">(bar 123)</code> and the pair <codeclass="highlighter-rouge">(foo "1 2 3")</code>.</li>
</ul>
<p>If the sequence of obj’s mixes tag-delimited and non-tag-delimited items, then the
non-tag-delimited items are pulled out of the sequence and wrapped with a “content” tag.
For example, decoding <codeclass="highlighter-rouge"><a><bar>456</bar>many<foo>1 2 3</foo>apples<a></code></code>
is similar to above, except that the list X is a 3-item list that contains the additional pair
whose first item is the string “content”, and whose second item is the list (many, apples).
This method signals an error and returns the empty list if the result is not well-formed XML.
<p>See <ahref="../other/xml.html">“Working with XML and Web Services”</a> for more details.</p>
This method signals an error and returns the empty list if the result is not well-formed XML.</p>
<dd>Decodes the given XML string to produce a dictionary structure. The dictionary includes the
special keys <codeclass="highlighter-rouge">$tag</code>, <codeclass="highlighter-rouge">$localName</code>, <codeclass="highlighter-rouge">$namespace</code>, <codeclass="highlighter-rouge">$namespaceUri</code>, <codeclass="highlighter-rouge">$attributes</code>, and <codeclass="highlighter-rouge">$content</code>,
as well as a key for each unique tag for every node, which points to a list of elements of
the same structure as described here.
<p>The <codeclass="highlighter-rouge">$tag</code> key is the full tag name, e.g., foo:bar. The <codeclass="highlighter-rouge">$localName</code> is the local portion of
the name (everything after the colon <codeclass="highlighter-rouge">:</code> character). If a namespace is given (everything before
the colon <codeclass="highlighter-rouge">:</code> character), it is provided in <codeclass="highlighter-rouge">$namespace</code> and the corresponding URI is given
in <codeclass="highlighter-rouge">$namespaceUri</code>. The attributes are stored in a dictionary in <codeclass="highlighter-rouge">$attributes</code> and the
child nodes are given as a list under <codeclass="highlighter-rouge">$content</code>.</p>
<p><strong>More Information on Special Keys</strong></p>
<spanclass="nt"><ex:title</span><spanclass="na">xml:lang=</span><spanclass="s">"en"</span><spanclass="nt">></span>On the Origin of Species<spanclass="nt"></ex:title></span>
<p>When parsed, the <codeclass="highlighter-rouge">$tag</code> key will be <codeclass="highlighter-rouge">"ex:Book"</code>, the <codeclass="highlighter-rouge">$localName</code> key will be <codeclass="highlighter-rouge">"Book"</code>, the
<codeclass="highlighter-rouge">$namespace</code> key will be <codeclass="highlighter-rouge">"ex"</code>, <codeclass="highlighter-rouge">$namespaceUri</code> will be <codeclass="highlighter-rouge">"http://example.com/"</code>, the
<codeclass="highlighter-rouge">$attributes</code> key will be a dictionary <codeclass="highlighter-rouge">{}</code> (xmlns is removed for the namespace), and the
<codeclass="highlighter-rouge">$content</code> will be a list of two items representing the decoded <codeclass="highlighter-rouge"><ex:title></code> and <codeclass="highlighter-rouge"><ex:author></code>
elements. The first item, which corresponds to the <codeclass="highlighter-rouge"><ex:title></code> element, will have an
<codeclass="highlighter-rouge">$attributes</code> key containing the dictionary <codeclass="highlighter-rouge">{"xml:lang": "en"}</code>. For each <codeclass="highlighter-rouge">name=value</code>
attribute on an element, a key-value pair mapping <codeclass="highlighter-rouge">name</code> to <codeclass="highlighter-rouge">value</code> will exist in the
<codeclass="highlighter-rouge">$attributes</code> dictionary. In addition to these special keys, there will also be <codeclass="highlighter-rouge">"ex:title"</code>
and <codeclass="highlighter-rouge">"ex:author"</code> to allow lookups faster than having to traverse the <codeclass="highlighter-rouge">$content</code> list.</p>