[CCSDK-28] populated the seed code for dgbuilder
[ccsdk/distribution.git] / dgbuilder / core_nodes / parsers / 70-XML.html
1 <!--
2   Copyright 2014 IBM Corp.
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8   http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15 -->
16
17 <script type="text/x-red" data-template-name="xml">
18     <div class="form-row">
19         <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
20         <input type="text" id="node-input-name" placeholder="Name">
21     </div>
22 </script>
23
24 <script type="text/x-red" data-help-name="xml">
25     <p>A function that parses the <b>msg.payload</b> to convert xml to/from a javascript object. Places the result in the payload.</p>
26     <p>If the input is a string it tries to parse it as XML and creates a javascript object.</p>
27     <p>If the input is a javascript object it tries to build an XML string.</p>
28     <p>See <a href="https://github.com/Leonidas-from-XIV/node-xml2js/blob/master/README.md" target="_new">the xml2js docs <i>here</i></a> for more information.</p>
29 </script>
30
31 <script type="text/javascript">
32     RED.nodes.registerType('xml',{
33         category: 'function',
34         color:"#DEBD5C",
35         defaults: {
36             name: {value:""}
37         },
38         inputs:1,
39         outputs:1,
40         icon: "arrow-in.png",
41         label: function() {
42             return this.name||"xml";
43         },
44         labelStyle: function() {
45             return this.name?"node_label_italic":"";
46         }
47     });
48 </script>