~ubuntu-branches/ubuntu/raring/maas/raring-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/docs/datatype/datatype-xmlparse.html

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html>
2
 
<html lang="en">
3
 
<head>
4
 
    <meta charset="utf-8">
5
 
    <title>Example: DataType.XML.parse()</title>
6
 
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.4.0pr3/build/cssgrids/grids-min.css">
7
 
    <link rel="stylesheet" href="../assets/css/main.css">
8
 
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
9
 
    <script src="../../build/yui/yui-min.js"></script>
10
 
</head>
11
 
<body>
12
 
 
13
 
<div id="doc">
14
 
    <h1>Example: DataType.XML.parse()</h1>
15
 
 
16
 
    
17
 
 
18
 
    <div class="yui3-g">
19
 
        <div id="main" class="yui3-u">
20
 
            <div class="content"><style scoped>
21
 
/* custom styles for this example */
22
 
#demo input, #demo label {display:block;}
23
 
#demo fieldset {margin:1em;}
24
 
#demo textarea {width:40em;height:8em;}
25
 
</style>
26
 
 
27
 
<div class="intro">
28
 
    <p>The XML module of the DataType Utility allows you to take a string and convert it to an XML document.</p>
29
 
</div>
30
 
 
31
 
<div class="example yui3-skin-sam">
32
 
    <form id="demo">
33
 
    <fieldset>
34
 
        <label for="demo_input">String to parse:</label>
35
 
        <textarea type="text" id="demo_input"><myroot><item type='foo'><name>Abc</name><rank>1</rank></item><item type='bar'><name>Def</name><rank>2</rank></item><item type='bat'><name>Ghi</name><rank>3</rank></item></myroot></textarea>
36
 
        <input type="button" id="demo_btn" value="Alert node type of parsed output">
37
 
    </fieldset>
38
 
</form>
39
 
 
40
 
<script>
41
 
YUI().use("node", "datatype-xml", function (Y) {
42
 
    Y.on("click", function(e){
43
 
        var input = Y.one("#demo_input").get("value"),
44
 
            output = Y.DataType.XML.parse(input);
45
 
                
46
 
        if(output === "") {
47
 
            output += "(Invalid value)"
48
 
        }
49
 
        
50
 
        alert("node type: " + output.nodeType);
51
 
    }, "#demo_btn");
52
 
});
53
 
</script>
54
 
 
55
 
</div>
56
 
 
57
 
<p>To convert a string to an XML document, simply call the <code>parse()</code> function of the DataType.XML class:</p>
58
 
 
59
 
<pre class="code prettyprint">YUI().use(&quot;datatype-xml&quot;, function(Y) {
60
 
    var output = Y.DataType.XML.parse(&quot;&lt;myroot&gt;&lt;item type=&#x27;foo&#x27;&gt;&lt;name&gt;Abc&lt;&#x2F;name&gt;&lt;rank&gt;1&lt;&#x2F;rank&gt;&lt;&#x2F;item&gt;&lt;item type=&#x27;bar&#x27;&gt;&lt;name&gt;Def&lt;&#x2F;name&gt;&lt;rank&gt;2&lt;&#x2F;rank&gt;&lt;&#x2F;item&gt;&lt;item type=&#x27;bat&#x27;&gt;&lt;name&gt;Ghi&lt;&#x2F;name&gt;&lt;rank&gt;3&lt;&#x2F;rank&gt;&lt;&#x2F;item&gt;&lt;&#x2F;myroot&gt;&quot;);
61
 
    &#x2F;&#x2F; output is an XML document
62
 
});</pre>
63
 
 
64
 
 
65
 
 
66
 
</div>
67
 
        </div>
68
 
 
69
 
        <div id="sidebar" class="yui3-u">
70
 
            
71
 
 
72
 
            
73
 
                <div class="sidebox">
74
 
                    <div class="hd">
75
 
                        <h2 class="no-toc">Examples</h2>
76
 
                    </div>
77
 
 
78
 
                    <div class="bd">
79
 
                        <ul class="examples">
80
 
                            
81
 
                                
82
 
                                    <li data-description="Formatting dates into strings.">
83
 
                                        <a href="datatype-dateformat.html">DataType.Date.format()</a>
84
 
                                    </li>
85
 
                                
86
 
                            
87
 
                                
88
 
                                    <li data-description="Formatting dates into strings using pre-packaged language resource bundles.">
89
 
                                        <a href="datatype-dateformat-lang.html">Formatting Dates Using Language Resource Bundles</a>
90
 
                                    </li>
91
 
                                
92
 
                            
93
 
                                
94
 
                                    <li data-description="Parsing data into dates.">
95
 
                                        <a href="datatype-dateparse.html">DataType.Date.parse()</a>
96
 
                                    </li>
97
 
                                
98
 
                            
99
 
                                
100
 
                                    <li data-description="Formatting numbers into strings.">
101
 
                                        <a href="datatype-numberformat.html">DataType.Number.format()</a>
102
 
                                    </li>
103
 
                                
104
 
                            
105
 
                                
106
 
                                    <li data-description="Parsing data into numbers.">
107
 
                                        <a href="datatype-numberparse.html">DataType.Number.parse()</a>
108
 
                                    </li>
109
 
                                
110
 
                            
111
 
                                
112
 
                                    <li data-description="Formatting XML documents into strings.">
113
 
                                        <a href="datatype-xmlformat.html">DataType.XML.format()</a>
114
 
                                    </li>
115
 
                                
116
 
                            
117
 
                                
118
 
                                    <li data-description="Parsing strings into XML documents.">
119
 
                                        <a href="datatype-xmlparse.html">DataType.XML.parse()</a>
120
 
                                    </li>
121
 
                                
122
 
                            
123
 
                        </ul>
124
 
                    </div>
125
 
                </div>
126
 
            
127
 
 
128
 
            
129
 
        </div>
130
 
    </div>
131
 
</div>
132
 
 
133
 
<script src="../assets/vendor/prettify/prettify-min.js"></script>
134
 
<script>prettyPrint();</script>
135
 
 
136
 
</body>
137
 
</html>