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

53 lines
2.4 KiB
HTML
Raw Normal View History

2018-12-22 09:22:25 +01:00
<!--
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/x-red" data-help-name="xml">
<p>Konvertiert zwischen einem XML-String und seiner JavaScript-Objektdarstellung - in beiden Richtungen.</p>
<h3>Eingaben</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">Objekt | String</span></dt>
<dd>Ein JavaScript Objekt oder ein XML String.</dd>
2018-12-22 09:22:25 +01:00
</dl>
<h3>Ausgaben</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">Objekt | String</span></dt>
2018-12-22 09:22:25 +01:00
<dd>
<ul>
<li>Wenn die Eingabe ein String ist, wird versucht sie als XML zu analysieren und daraus ein JavaScript-Objekt zu erstellen.</li>
<li>Wenn die Eingabe ein JavaScript-Objekt ist, wird versucht ein XML-String zu erstellen.</li>
2018-12-22 09:22:25 +01:00
</ul>
</dd>
<dt class="optional">Optionen <span class="property-type">Objekt</span></dt>
<dd>This optional property can be used to pass in any of the options supported by the underlying
library used to convert to and from XML. See <a href="https://github.com/Leonidas-from-XIV/node-xml2js/blob/master/README.md#options" target="_blank">the xml2js docs</a>
for more information.</dd>
</dl>
<h3>Details</h3>
<p>Bei der Konvertierung zwischen XML und einem Objekt werden standardmäßig alle XML-Attribute als Eigenschaft namens <code>$</code> hinzugefügt.
Jeder Textinhalt wird als Eigenschaft namens <code>_</code> hinzugefügt.
Diese Eigenschaftsnamen können in der Node-Konfiguration angegeben werden.</p>
2018-12-22 09:22:25 +01:00
<p>Zum Beispiel wird das folgende XML wie dargestellt konvertiert:</p>
<pre>&lt;p class="tag"&gt;Hello World&lt;/p&gt;</pre>
<pre>{
"p": {
"$": {
"class": "tag"
},
"_": "Hello World"
}
}</pre>
</script>