node-red/packages/node_modules/@node-red/nodes/locales/ru/parsers/70-XML.html

61 lines
2.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/html" data-help-name="xml">
<p>
Выполняет преобразования между строкой в XML формате и ее представлением в JavaScript-объекте, в любом направлении.
</p>
<h3>Принимает</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">объект | строка</span></dt>
<dd>JavaScript объект или XML-строка.</dd>
<dt class="optional">options <span class="property-type">объект</span></dt>
<dd>Это необязательное свойство может использоваться для передачи любых параметров, поддерживаемых библиотекой, которая используется для преобразования в/из XML. См. <a href="https://github.com/Leonidas-from-XIV/node-xml2js/blob/master/README.md#options" target="_blank">документацию xml2js</a> для получения дополнительной информации.</dd>
</dl>
<h3>Выводит</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">объект | строка</span></dt>
<dd>
<ul>
<li>Если на входе значение строкового типа, узел пытается проанализировать его как XML и создает объект JavaScript.</li>
<li>Если на входе JavaScript объект, узел пытается построить XML-строку.</li>
</ul>
</dd>
</dl>
<h3>Подробности</h3>
<p>
При преобразовании между XML и объектом любые XML-атрибуты по умолчанию добавляются как свойство с именем <code>$</code>. Любое текстовое содержимое добавляется как свойство с именем <code>_</code>. Эти имена свойств могут быть указаны в конфигурации узла.
</p>
<p>
Например, следующий XML:
</p>
<pre>&lt;p class="tag"&gt;Hello World&lt;/p&gt;</pre>
<p>
будет преобразован в:
</p>
<pre>{
"p": {
"$": {
"class": "tag"
},
"_": "Hello World"
}
}</pre>
</script>