libxml-ruby 0.6.0-x86-mswin32-60 → 0.7.0-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +42 -0
- data/README +123 -117
- data/doc/classes/XML.html +226 -0
- data/doc/classes/XML/Attr.html +969 -0
- data/doc/classes/XML/Attributes.html +487 -0
- data/doc/classes/XML/Document.html +1423 -0
- data/doc/classes/XML/Dtd.html +159 -0
- data/doc/classes/XML/Error.html +111 -0
- data/doc/classes/XML/HTMLParser.html +330 -0
- data/doc/classes/XML/InputCallbacks.html +154 -0
- data/doc/classes/XML/NS.html +366 -0
- data/doc/classes/XML/Node.html +3292 -0
- data/doc/classes/XML/Node/FailedModify.html +111 -0
- data/doc/classes/XML/Node/Set.html +435 -0
- data/doc/classes/XML/Node/SetNamespace.html +111 -0
- data/doc/classes/XML/Node/UnknownType.html +111 -0
- data/doc/classes/XML/Parser.html +2178 -0
- data/doc/classes/XML/Parser/Context.html +1233 -0
- data/doc/classes/XML/Parser/ParseError.html +111 -0
- data/doc/classes/XML/Reader.html +2173 -0
- data/doc/classes/XML/SaxParser.html +396 -0
- data/doc/classes/XML/SiblingEnum.html +142 -0
- data/doc/classes/XML/State.html +118 -0
- data/doc/classes/XML/Tree.html +224 -0
- data/doc/classes/XML/XInclude.html +117 -0
- data/doc/classes/XML/XInclude/Error.html +111 -0
- data/doc/classes/XML/XMLParserOptions.html +198 -0
- data/doc/classes/XML/XPath.html +269 -0
- data/doc/classes/XML/XPath/Context.html +193 -0
- data/doc/classes/XML/XPath/InvalidPath.html +111 -0
- data/doc/classes/XML/XPath/Object.html +439 -0
- data/doc/classes/XML/XPointer.html +164 -0
- data/doc/classes/XML/XPointer/Context.html +117 -0
- data/doc/classes/XML/XPointer/Context/InvalidPath.html +111 -0
- data/doc/classes/XML/XPointer/InvalidExpression.html +111 -0
- data/doc/classes/singleton.html +114 -0
- data/doc/created.rid +1 -0
- data/doc/files/CHANGES.html +375 -0
- data/doc/files/LICENSE.html +133 -0
- data/doc/files/README.html +279 -0
- data/doc/files/VERSION.html +107 -0
- data/doc/files/ext/libxml/cbg_c.html +101 -0
- data/doc/files/ext/libxml/libxml_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_attr_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_attributes_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_document_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_dtd_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_html_parser_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_input_cbg_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_node_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_node_set_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_ns_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_parser_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_parser_context_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_reader_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_sax_parser_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_schema_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_state_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_tree_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_xinclude_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_xpath_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_xpath_context_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_xpath_object_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_xpointer_c.html +101 -0
- data/doc/files/ext/libxml/ruby_xml_xpointer_context_c.html +101 -0
- data/doc/files/lib/libxml_rb.html +115 -0
- data/doc/files/lib/xml/libxml_rb.html +114 -0
- data/doc/fr_class_index.html +60 -0
- data/doc/fr_file_index.html +56 -0
- data/doc/fr_method_index.html +373 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/ext/libxml/cbg.c +76 -76
- data/ext/libxml/extconf.rb +308 -308
- data/ext/libxml/libxml.c +58 -62
- data/ext/libxml/ruby_libxml.h +1 -0
- data/ext/libxml/ruby_xml_attr.c +201 -113
- data/ext/libxml/ruby_xml_attr.h +6 -9
- data/ext/libxml/ruby_xml_attributes.c +268 -0
- data/ext/libxml/ruby_xml_attributes.h +17 -0
- data/ext/libxml/ruby_xml_document.c +80 -66
- data/ext/libxml/ruby_xml_dtd.c +2 -2
- data/ext/libxml/ruby_xml_dtd.h +17 -17
- data/ext/libxml/ruby_xml_html_parser.c +18 -19
- data/ext/libxml/ruby_xml_html_parser.h +29 -29
- data/ext/libxml/ruby_xml_input_cbg.c +6 -0
- data/ext/libxml/ruby_xml_input_cbg.h +20 -20
- data/ext/libxml/ruby_xml_node.c +438 -536
- data/ext/libxml/ruby_xml_node.h +17 -27
- data/ext/libxml/ruby_xml_node_set.c +10 -9
- data/ext/libxml/ruby_xml_node_set.h +20 -20
- data/ext/libxml/ruby_xml_ns.c +60 -69
- data/ext/libxml/ruby_xml_ns.h +12 -21
- data/ext/libxml/ruby_xml_parser.c +54 -53
- data/ext/libxml/ruby_xml_parser.h +31 -31
- data/ext/libxml/ruby_xml_parser_context.c +37 -91
- data/ext/libxml/ruby_xml_parser_context.h +20 -22
- data/ext/libxml/ruby_xml_reader.h +14 -14
- data/ext/libxml/ruby_xml_sax_parser.c +55 -55
- data/ext/libxml/ruby_xml_sax_parser.h +56 -56
- data/ext/libxml/ruby_xml_schema.c +44 -51
- data/ext/libxml/ruby_xml_schema.h +16 -16
- data/ext/libxml/ruby_xml_state.c +35 -96
- data/ext/libxml/ruby_xml_state.h +2 -3
- data/ext/libxml/ruby_xml_tree.h +12 -12
- data/ext/libxml/ruby_xml_xinclude.h +13 -13
- data/ext/libxml/ruby_xml_xpath.c +57 -18
- data/ext/libxml/ruby_xml_xpath.h +23 -23
- data/ext/libxml/ruby_xml_xpath_context.c +11 -7
- data/ext/libxml/ruby_xml_xpath_context.h +20 -20
- data/ext/libxml/ruby_xml_xpath_object.c +9 -16
- data/ext/libxml/ruby_xml_xpath_object.h +4 -10
- data/ext/libxml/ruby_xml_xpointer.c +11 -11
- data/ext/libxml/ruby_xml_xpointer.h +27 -27
- data/ext/libxml/ruby_xml_xpointer_context.h +18 -18
- data/ext/libxml/version.h +2 -2
- data/lib/libxml.rb +134 -125
- data/lib/libxml_ruby.so +0 -0
- data/mingw/libiconv-2.dll +0 -0
- data/mingw/libxml2-2.dll +0 -0
- data/mingw/libxml_ruby.so +0 -0
- data/test/ets_copy_bug.rb +1 -1
- data/test/ets_copy_bug2.rb +16 -27
- data/test/ets_doc_to_s.rb +1 -1
- data/test/ets_gpx.rb +1 -1
- data/test/ets_node_gc.rb +1 -1
- data/test/ets_tsr.rb +1 -1
- data/test/tc_well_formed.rb +1 -1
- data/test/tc_xml_attributes.rb +106 -0
- data/test/tc_xml_document.rb +10 -10
- data/test/tc_xml_document_write3.rb +1 -1
- data/test/tc_xml_dtd.rb +49 -0
- data/test/tc_xml_html_parser.rb +3 -3
- data/test/tc_xml_node.rb +69 -33
- data/test/tc_xml_node_attr.rb +170 -0
- data/test/{tc_xml_node8.rb → tc_xml_node_cdata.rb} +2 -2
- data/test/{tc_xml_node9.rb → tc_xml_node_comment.rb} +3 -3
- data/test/tc_xml_node_edit.rb +91 -0
- data/test/tc_xml_parser.rb +97 -50
- data/test/tc_xml_parser_context.rb +61 -23
- data/test/tc_xml_schema.rb +39 -0
- data/test/tc_xml_xinclude.rb +5 -6
- data/test/tc_xml_xpath.rb +51 -27
- data/test/test_suite.rb +27 -0
- data/vc/{libxml.sln → libxml_ruby.sln} +5 -5
- data/vc/{libxml.vcproj → libxml_ruby.vcproj} +9 -1
- metadata +106 -54
- data/mingw/mingw.rake +0 -36
- data/test/dtd-test.rb +0 -24
- data/test/merge_bug.rb +0 -55
- data/test/schema-test.rb +0 -74
- data/test/tc_xml_node2.rb +0 -25
- data/test/tc_xml_node3.rb +0 -27
- data/test/tc_xml_node4.rb +0 -86
- data/test/tc_xml_node5.rb +0 -52
- data/test/tc_xml_node6.rb +0 -27
- data/test/tc_xml_node7.rb +0 -35
- data/test/tc_xml_parser2.rb +0 -16
- data/test/tc_xml_parser3.rb +0 -23
- data/test/tc_xml_parser4.rb +0 -33
- data/test/tc_xml_parser5.rb +0 -27
- data/test/tc_xml_parser6.rb +0 -23
- data/test/tc_xml_parser7.rb +0 -28
- data/test/tc_xml_parser8.rb +0 -32
- data/test/tc_xml_parser9.rb +0 -11
- data/test/tc_xml_xpath2.rb +0 -14
- data/work/vc/debug/libxml.exp +0 -0
- data/work/vc/debug/libxml.ilk +0 -0
- data/work/vc/debug/libxml.lib +0 -0
- data/work/vc/debug/libxml.pdb +0 -0
- data/work/vc/debug/libxml.so +0 -0
@@ -0,0 +1,133 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: LICENSE</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>LICENSE</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>LICENSE
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon Jul 07 00:26:58 Mountain Daylight Time 2008</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<p>
|
73
|
+
LibXML-Ruby
|
74
|
+
</p>
|
75
|
+
<pre>
|
76
|
+
Copyright (c) 2002-2006 Sean Chittenden <sean@chittenden.org> and contributors
|
77
|
+
Copyright (c) 2001 Wai-Sun "Squidster" Chia <waisun.chia@compaq.com>
|
78
|
+
</pre>
|
79
|
+
<p>
|
80
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
81
|
+
copy of this software and associated documentation files (the
|
82
|
+
"Software"), to deal in the Software without restriction,
|
83
|
+
including without limitation the rights to use, copy, modify, merge,
|
84
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
85
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
86
|
+
following conditions:
|
87
|
+
</p>
|
88
|
+
<p>
|
89
|
+
The above copyright notice and this permission notice shall be included in
|
90
|
+
all copies or substantial portions of the Software.
|
91
|
+
</p>
|
92
|
+
<p>
|
93
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
94
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
95
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
96
|
+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
97
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
98
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
99
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
100
|
+
</p>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
|
110
|
+
|
111
|
+
<!-- if includes -->
|
112
|
+
|
113
|
+
<div id="section">
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
<!-- if method_list -->
|
123
|
+
|
124
|
+
|
125
|
+
</div>
|
126
|
+
|
127
|
+
|
128
|
+
<div id="validator-badges">
|
129
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
</body>
|
133
|
+
</html>
|
@@ -0,0 +1,279 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: README</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>README</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>README
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Wed Jul 09 02:42:39 Mountain Daylight Time 2008</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<h1>libxml-ruby</h1>
|
73
|
+
<h2>Overview</h2>
|
74
|
+
<p>
|
75
|
+
The libxml gem provides Ruby language bindings for GNOME’s Libxml2 <a
|
76
|
+
href="../classes/XML.html">XML</a> toolkit. It is free software, released
|
77
|
+
under the MIT License.
|
78
|
+
</p>
|
79
|
+
<p>
|
80
|
+
libxml-ruby provides several advantages over REXML:
|
81
|
+
</p>
|
82
|
+
<ul>
|
83
|
+
<li>Speed - libxml is many times faster than REXML
|
84
|
+
|
85
|
+
</li>
|
86
|
+
<li>Features - libxml provides a number of additional features over REXML,
|
87
|
+
including <a href="../classes/XML.html">XML</a> Schema Validation, RelaxNg
|
88
|
+
validation, xslt (see libxslt-ruby)
|
89
|
+
|
90
|
+
</li>
|
91
|
+
<li>Correctness - libxml passes all 1800+ tests from the OASIS <a
|
92
|
+
href="../classes/XML.html">XML</a> Tests Suite
|
93
|
+
|
94
|
+
</li>
|
95
|
+
</ul>
|
96
|
+
<h2>Requirements</h2>
|
97
|
+
<p>
|
98
|
+
libxml-ruby requires Ruby 1.8.4 or higher. It is dependent on the following
|
99
|
+
libraries to function properly:
|
100
|
+
</p>
|
101
|
+
<ul>
|
102
|
+
<li>libm (math routines: very standard)
|
103
|
+
|
104
|
+
</li>
|
105
|
+
<li>libz (zlib)
|
106
|
+
|
107
|
+
</li>
|
108
|
+
<li>libiconv
|
109
|
+
|
110
|
+
</li>
|
111
|
+
<li>libxml2
|
112
|
+
|
113
|
+
</li>
|
114
|
+
</ul>
|
115
|
+
<p>
|
116
|
+
If you are running Linux or Unix you’ll need a C compiler so the
|
117
|
+
extension can be compiled when it is installed. If you are running Windows,
|
118
|
+
then install the Windows specific RubyGem which includes an already built
|
119
|
+
extension.
|
120
|
+
</p>
|
121
|
+
<h2>INSTALLATION</h2>
|
122
|
+
<p>
|
123
|
+
The easiest way to install ruby-prof is by using Ruby Gems. To install:
|
124
|
+
</p>
|
125
|
+
<p>
|
126
|
+
<tt>gem install libxml-ruby</tt>
|
127
|
+
</p>
|
128
|
+
<p>
|
129
|
+
If you are running Windows, make sure to install the Win32 RubyGem which
|
130
|
+
includes an already built binary file. The binary is built against libxml2
|
131
|
+
version 2.6.32 and iconv version 1.12. Both of these are also included as
|
132
|
+
pre-built binaries, and should be put either in the libxml/lib directory or
|
133
|
+
on the Windows path.
|
134
|
+
</p>
|
135
|
+
<p>
|
136
|
+
The Windows binaries are biult with MingW. The gem also includes a
|
137
|
+
Microsoft VC++ 2005 solution. If you wish to run a debug version of
|
138
|
+
libxml-ruby on Windows, then it is highly recommended you use VC++.
|
139
|
+
</p>
|
140
|
+
<h2>USAGE</h2>
|
141
|
+
<p>
|
142
|
+
Basic usage for reading and writing documents.
|
143
|
+
</p>
|
144
|
+
<h3>READING</h3>
|
145
|
+
<p>
|
146
|
+
There are several ways to read xml documents.
|
147
|
+
</p>
|
148
|
+
<pre>
|
149
|
+
require 'libxml'
|
150
|
+
doc = XML::Document.file('output.xml')
|
151
|
+
root = doc.root
|
152
|
+
|
153
|
+
puts "Root element name: #{root.name}"
|
154
|
+
|
155
|
+
elem3 = root.find('elem3').to_a.first
|
156
|
+
puts "Elem3: #{elem3['attr']}"
|
157
|
+
|
158
|
+
doc.find('//root_node/foo/bar').each do |node|
|
159
|
+
puts "Node path: #{node.path} \t Contents: #{node.content}"
|
160
|
+
end
|
161
|
+
</pre>
|
162
|
+
<p>
|
163
|
+
And your terminal should look like:
|
164
|
+
</p>
|
165
|
+
<pre>
|
166
|
+
Root element name: root_node
|
167
|
+
Elem3: baz
|
168
|
+
Node path: /root_node/foo/bar[1] Contents: 1
|
169
|
+
Node path: /root_node/foo/bar[2] Contents: 2
|
170
|
+
Node path: /root_node/foo/bar[3] Contents: 3
|
171
|
+
Node path: /root_node/foo/bar[4] Contents: 4
|
172
|
+
Node path: /root_node/foo/bar[5] Contents: 5
|
173
|
+
Node path: /root_node/foo/bar[6] Contents: 6
|
174
|
+
Node path: /root_node/foo/bar[7] Contents: 7
|
175
|
+
Node path: /root_node/foo/bar[8] Contents: 8
|
176
|
+
Node path: /root_node/foo/bar[9] Contents: 9
|
177
|
+
Node path: /root_node/foo/bar[10] Contents: 10
|
178
|
+
</pre>
|
179
|
+
<h3>WRITING</h3>
|
180
|
+
<p>
|
181
|
+
To write a simple document:
|
182
|
+
</p>
|
183
|
+
<pre>
|
184
|
+
require 'libxml'
|
185
|
+
|
186
|
+
doc = XML::Document.new()
|
187
|
+
doc.root = XML::Node.new('root_node')
|
188
|
+
root = doc.root
|
189
|
+
|
190
|
+
root << elem1 = XML::Node.new('elem1')
|
191
|
+
elem1['attr1'] = 'val1'
|
192
|
+
elem1['attr2'] = 'val2'
|
193
|
+
|
194
|
+
root << elem2 = XML::Node.new('elem2')
|
195
|
+
elem2['attr1'] = 'val1'
|
196
|
+
elem2['attr2'] = 'val2'
|
197
|
+
|
198
|
+
root << elem3 = XML::Node.new('elem3')
|
199
|
+
elem3 << elem4 = XML::Node.new('elem4')
|
200
|
+
elem3 << elem5 = XML::Node.new('elem5')
|
201
|
+
|
202
|
+
elem5 << elem6 = XML::Node.new('elem6')
|
203
|
+
elem6 << 'Content for element 6'
|
204
|
+
|
205
|
+
elem3['attr'] = 'baz'
|
206
|
+
|
207
|
+
format = true
|
208
|
+
doc.save('output.xml', format)
|
209
|
+
</pre>
|
210
|
+
<p>
|
211
|
+
The file output.xml contains:
|
212
|
+
</p>
|
213
|
+
<pre>
|
214
|
+
<?xml version="1.0"?>
|
215
|
+
<root_node>
|
216
|
+
<elem1 attr1="val1" attr2="val2"/>
|
217
|
+
<elem2 attr1="val1" attr2="val2"/>
|
218
|
+
<elem3 attr="baz">
|
219
|
+
<elem4/>
|
220
|
+
<elem5>
|
221
|
+
<elem6>Content for element 6</elem6>
|
222
|
+
</elem5>
|
223
|
+
</elem3>
|
224
|
+
<foo>
|
225
|
+
<bar>1</bar>
|
226
|
+
<bar>2</bar>
|
227
|
+
<bar>3</bar>
|
228
|
+
<bar>4</bar>
|
229
|
+
<bar>5</bar>
|
230
|
+
<bar>6</bar>
|
231
|
+
<bar>7</bar>
|
232
|
+
<bar>8</bar>
|
233
|
+
<bar>9</bar>
|
234
|
+
<bar>10</bar>
|
235
|
+
</foo>
|
236
|
+
</root_node>
|
237
|
+
</pre>
|
238
|
+
<h2>License</h2>
|
239
|
+
<p>
|
240
|
+
See LICENSE for license information.
|
241
|
+
</p>
|
242
|
+
<h2>MORE INFORMATION</h2>
|
243
|
+
<p>
|
244
|
+
For more information please refer to the documentation. If you have any
|
245
|
+
questions, please send email to libxml-devel@rubyforge.org.
|
246
|
+
</p>
|
247
|
+
|
248
|
+
</div>
|
249
|
+
|
250
|
+
|
251
|
+
</div>
|
252
|
+
|
253
|
+
|
254
|
+
</div>
|
255
|
+
|
256
|
+
|
257
|
+
<!-- if includes -->
|
258
|
+
|
259
|
+
<div id="section">
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
<!-- if method_list -->
|
269
|
+
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
<div id="validator-badges">
|
275
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
276
|
+
</div>
|
277
|
+
|
278
|
+
</body>
|
279
|
+
</html>
|
@@ -0,0 +1,107 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: VERSION</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>VERSION</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>VERSION
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon Jul 07 00:26:58 Mountain Daylight Time 2008</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<p>
|
73
|
+
0.5.3 stable (2008-02-01)
|
74
|
+
</p>
|
75
|
+
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
</div>
|
80
|
+
|
81
|
+
|
82
|
+
</div>
|
83
|
+
|
84
|
+
|
85
|
+
<!-- if includes -->
|
86
|
+
|
87
|
+
<div id="section">
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<!-- if method_list -->
|
97
|
+
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
<div id="validator-badges">
|
103
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
104
|
+
</div>
|
105
|
+
|
106
|
+
</body>
|
107
|
+
</html>
|