smile-xml 1.0.0-jruby → 1.0.2-jruby
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/smile-xml.jar +0 -0
- data/src/main/java/smile/xml/AttrJ.java +160 -0
- data/src/main/java/smile/xml/AttributesJ.java +212 -0
- data/src/main/java/smile/xml/BaseJ.java +60 -0
- data/src/main/java/smile/xml/DocumentJ.java +435 -0
- data/src/main/java/smile/xml/EncodingJ.java +94 -0
- data/src/main/java/smile/xml/ErrorJ.java +162 -0
- data/src/main/java/smile/xml/NamespaceJ.java +67 -0
- data/src/main/java/smile/xml/NamespacesJ.java +62 -0
- data/src/main/java/smile/xml/NodeJ.java +1029 -0
- data/src/main/java/smile/xml/NodeSetJ.java +90 -0
- data/src/main/java/smile/xml/ParserContextJ.java +44 -0
- data/src/main/java/smile/xml/ParserJ.java +196 -0
- data/src/main/java/smile/xml/ParserOptionsJ.java +58 -0
- data/src/main/java/smile/xml/ReaderJ.java +34 -0
- data/src/main/java/smile/xml/SchemaJ.java +66 -0
- data/src/main/java/smile/xml/SmileXML.java +65 -0
- data/src/main/java/smile/xml/XmlJ.java +58 -0
- data/src/main/java/smile/xml/sax/CallbackHandler.java +113 -0
- data/src/main/java/smile/xml/sax/SaxParserCallbacksJ.java +71 -0
- data/src/main/java/smile/xml/sax/SaxParserJ.java +153 -0
- data/src/main/java/smile/xml/util/UtilJ.java +424 -0
- data/src/main/java/smile/xml/xpath/CustomNamespaceContext.java +59 -0
- data/src/main/java/smile/xml/xpath/XPathContextJ.java +154 -0
- data/src/main/java/smile/xml/xpath/XPathExpressionJ.java +62 -0
- data/src/main/java/smile/xml/xpath/XPathJ.java +36 -0
- data/src/main/java/smile/xml/xpath/XPathObjectJ.java +196 -0
- data/src/main/java/smile/xml/xpath/XPointerJ.java +32 -0
- data/src/main/ruby/xml/libxml.rb +1 -0
- data/src/main/ruby/xml.rb +5 -0
- data/src/test/ruby/etc_doc_to_s.rb +21 -0
- data/src/test/ruby/ets_doc_file.rb +17 -0
- data/src/test/ruby/ets_doc_to_s.rb +23 -0
- data/src/test/ruby/ets_gpx.rb +28 -0
- data/src/test/ruby/ets_node_gc.rb +23 -0
- data/src/test/ruby/ets_test.xml +2 -0
- data/src/test/ruby/ets_tsr.rb +11 -0
- data/src/test/ruby/model/atom.xml +13 -0
- data/src/test/ruby/model/bands.iso-8859-1.xml +5 -0
- data/src/test/ruby/model/bands.utf-8.xml +5 -0
- data/src/test/ruby/model/bands.xml +5 -0
- data/src/test/ruby/model/books.xml +146 -0
- data/src/test/ruby/model/merge_bug_data.xml +58 -0
- data/src/test/ruby/model/ruby-lang.html +238 -0
- data/src/test/ruby/model/rubynet.xml +79 -0
- data/src/test/ruby/model/shiporder.rnc +28 -0
- data/src/test/ruby/model/shiporder.rng +86 -0
- data/src/test/ruby/model/shiporder.xml +23 -0
- data/src/test/ruby/model/shiporder.xsd +31 -0
- data/src/test/ruby/model/soap.xml +27 -0
- data/src/test/ruby/model/xinclude.xml +5 -0
- data/src/test/ruby/smile_xml_test.rb +64 -0
- data/src/test/ruby/tc_attr.rb +191 -0
- data/src/test/ruby/tc_attr_decl.rb +133 -0
- data/src/test/ruby/tc_attributes.rb +135 -0
- data/src/test/ruby/tc_deprecated_require.rb +13 -0
- data/src/test/ruby/tc_document.rb +162 -0
- data/src/test/ruby/tc_document_write.rb +212 -0
- data/src/test/ruby/tc_dtd.rb +125 -0
- data/src/test/ruby/tc_error.rb +150 -0
- data/src/test/ruby/tc_html_parser.rb +140 -0
- data/src/test/ruby/tc_namespace.rb +62 -0
- data/src/test/ruby/tc_namespaces.rb +210 -0
- data/src/test/ruby/tc_node.rb +273 -0
- data/src/test/ruby/tc_node_cdata.rb +51 -0
- data/src/test/ruby/tc_node_comment.rb +33 -0
- data/src/test/ruby/tc_node_copy.rb +42 -0
- data/src/test/ruby/tc_node_edit.rb +178 -0
- data/src/test/ruby/tc_node_text.rb +73 -0
- data/src/test/ruby/tc_node_write.rb +108 -0
- data/src/test/ruby/tc_node_xlink.rb +29 -0
- data/src/test/ruby/tc_parser.rb +371 -0
- data/src/test/ruby/tc_parser_context.rb +189 -0
- data/src/test/ruby/tc_properties.rb +40 -0
- data/src/test/ruby/tc_reader.rb +306 -0
- data/src/test/ruby/tc_relaxng.rb +54 -0
- data/src/test/ruby/tc_sax_parser.rb +340 -0
- data/src/test/ruby/tc_schema.rb +59 -0
- data/src/test/ruby/tc_traversal.rb +222 -0
- data/src/test/ruby/tc_xinclude.rb +21 -0
- data/src/test/ruby/tc_xml.rb +226 -0
- data/src/test/ruby/tc_xpath.rb +210 -0
- data/src/test/ruby/tc_xpath_context.rb +80 -0
- data/src/test/ruby/tc_xpath_expression.rb +38 -0
- data/src/test/ruby/tc_xpointer.rb +74 -0
- data/src/test/ruby/test_helper.rb +23 -0
- data/src/test/ruby/test_suite.rb +41 -0
- metadata +91 -5
@@ -0,0 +1,36 @@
|
|
1
|
+
package smile.xml.xpath;
|
2
|
+
|
3
|
+
import javax.xml.namespace.QName;
|
4
|
+
import javax.xml.xpath.XPathConstants;
|
5
|
+
import org.jruby.Ruby;
|
6
|
+
import org.jruby.RubyModule;
|
7
|
+
import org.jruby.anno.JRubyConstant;
|
8
|
+
import smile.xml.util.UtilJ;
|
9
|
+
|
10
|
+
public class XPathJ
|
11
|
+
{
|
12
|
+
|
13
|
+
@JRubyConstant
|
14
|
+
public static final QName UNDEFINED = null;
|
15
|
+
|
16
|
+
@JRubyConstant
|
17
|
+
public static final QName NODESET = XPathConstants.NODESET;
|
18
|
+
|
19
|
+
@JRubyConstant
|
20
|
+
public static final QName BOOLEAN = XPathConstants.BOOLEAN;
|
21
|
+
|
22
|
+
@JRubyConstant
|
23
|
+
public static final QName NUMBER = XPathConstants.NUMBER;
|
24
|
+
|
25
|
+
@JRubyConstant
|
26
|
+
public static final QName STRING = XPathConstants.STRING;
|
27
|
+
|
28
|
+
public static RubyModule define(Ruby runtime)
|
29
|
+
{
|
30
|
+
RubyModule parent = UtilJ.getModule(runtime, new String[] { "LibXML", "XML" });
|
31
|
+
RubyModule result = parent.defineModuleUnder("XPath");
|
32
|
+
result.defineAnnotatedMethods(XPathJ.class);
|
33
|
+
result.defineAnnotatedConstants(XPathJ.class);
|
34
|
+
return result;
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,196 @@
|
|
1
|
+
package smile.xml.xpath;
|
2
|
+
|
3
|
+
import java.util.ArrayList;
|
4
|
+
import java.util.Arrays;
|
5
|
+
import java.util.List;
|
6
|
+
|
7
|
+
import javax.xml.xpath.XPath;
|
8
|
+
import javax.xml.xpath.XPathExpressionException;
|
9
|
+
|
10
|
+
import org.jruby.Ruby;
|
11
|
+
import org.jruby.RubyArray;
|
12
|
+
import org.jruby.RubyBoolean;
|
13
|
+
import org.jruby.RubyClass;
|
14
|
+
import org.jruby.RubyFixnum;
|
15
|
+
import org.jruby.RubyNumeric;
|
16
|
+
import org.jruby.RubyObject;
|
17
|
+
import org.jruby.RubyString;
|
18
|
+
import org.jruby.anno.JRubyClass;
|
19
|
+
import org.jruby.anno.JRubyMethod;
|
20
|
+
import org.jruby.runtime.Block;
|
21
|
+
import org.jruby.runtime.ObjectAllocator;
|
22
|
+
import org.jruby.runtime.ThreadContext;
|
23
|
+
import org.jruby.runtime.builtin.IRubyObject;
|
24
|
+
import org.w3c.dom.Document;
|
25
|
+
import org.w3c.dom.Node;
|
26
|
+
import org.w3c.dom.NodeList;
|
27
|
+
|
28
|
+
import smile.xml.BaseJ;
|
29
|
+
import smile.xml.NodeJ;
|
30
|
+
import smile.xml.NodeSetJ;
|
31
|
+
import smile.xml.util.UtilJ;
|
32
|
+
|
33
|
+
@JRubyClass( name="LibXML::XML::XPath::Object", include="Enumerable" )
|
34
|
+
public class XPathObjectJ extends RubyObject {
|
35
|
+
|
36
|
+
private static final long serialVersionUID = 4673137342270845475L;
|
37
|
+
|
38
|
+
private static final ObjectAllocator ALLOCATOR = new ObjectAllocator() {
|
39
|
+
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
|
40
|
+
return new XPathObjectJ(runtime, klass);
|
41
|
+
}
|
42
|
+
};
|
43
|
+
|
44
|
+
|
45
|
+
public static RubyClass define(Ruby runtime) {
|
46
|
+
return UtilJ.defineClass( runtime,XPathObjectJ.class, ALLOCATOR );
|
47
|
+
}
|
48
|
+
|
49
|
+
private static RubyClass getRubyClass(Ruby runtime) {
|
50
|
+
return UtilJ.getClass(runtime, XPathObjectJ.class );
|
51
|
+
}
|
52
|
+
|
53
|
+
public static XPathObjectJ newInstance(
|
54
|
+
ThreadContext context,
|
55
|
+
IRubyObject expression,
|
56
|
+
IRubyObject document,
|
57
|
+
IRubyObject[] namespaces) {
|
58
|
+
List<IRubyObject> args = new ArrayList<IRubyObject>();
|
59
|
+
args.add(expression);
|
60
|
+
args.add(document);
|
61
|
+
args.addAll(Arrays.asList(namespaces));
|
62
|
+
return (XPathObjectJ) getRubyClass(context.getRuntime()).newInstance(
|
63
|
+
context,
|
64
|
+
(IRubyObject[]) args.toArray(new IRubyObject[args.size()]),
|
65
|
+
null);
|
66
|
+
}
|
67
|
+
|
68
|
+
private String[] namespaces;
|
69
|
+
private RubyString expression;
|
70
|
+
private Node node;
|
71
|
+
private RubyArray result;
|
72
|
+
|
73
|
+
private XPathObjectJ(Ruby runtime, RubyClass metaClass) {
|
74
|
+
super(runtime, metaClass);
|
75
|
+
}
|
76
|
+
|
77
|
+
@JRubyMethod(name = "initialize", rest = true )
|
78
|
+
public void initialize(ThreadContext context, IRubyObject[] args) {
|
79
|
+
|
80
|
+
if( args[0] instanceof RubyString ) {
|
81
|
+
this.expression = (RubyString) args[0];
|
82
|
+
} else {
|
83
|
+
this.expression = ((XPathExpressionJ)args[0]).getExpression();
|
84
|
+
}
|
85
|
+
|
86
|
+
this.node = (Node) ((BaseJ<?>) args[1]).getJavaObject();
|
87
|
+
|
88
|
+
this.namespaces = new String[args.length - 2];
|
89
|
+
for (int i = 2; i < args.length; i++)
|
90
|
+
this.namespaces[(i - 2)] = args[i].asJavaString();
|
91
|
+
|
92
|
+
// System.out.println( Arrays.toString(namespaces));
|
93
|
+
}
|
94
|
+
|
95
|
+
@JRubyMethod(name = { "each" })
|
96
|
+
public void iterateOver(ThreadContext context, Block block)
|
97
|
+
throws Exception {
|
98
|
+
RubyArray array = getResult(context);
|
99
|
+
for (Object obj : array ) {
|
100
|
+
IRubyObject o = (IRubyObject) obj;
|
101
|
+
block.yield(context, o);
|
102
|
+
if (block.isEscaped())
|
103
|
+
break;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
@JRubyMethod(name = { "length" }, alias = { "size" })
|
108
|
+
public RubyFixnum getLength(ThreadContext context) throws Exception {
|
109
|
+
return context.getRuntime().newFixnum(getResult(context).getLength());
|
110
|
+
}
|
111
|
+
|
112
|
+
@JRubyMethod(name ="string")
|
113
|
+
public RubyString getString(ThreadContext context) throws Exception {
|
114
|
+
return this.expression;
|
115
|
+
}
|
116
|
+
|
117
|
+
@JRubyMethod(name = { "first" })
|
118
|
+
public IRubyObject getFirst(ThreadContext context) throws Exception {
|
119
|
+
if (getResult(context).isEmpty())
|
120
|
+
return context.getRuntime().getNil();
|
121
|
+
return (NodeJ) getResult(context).get(0);
|
122
|
+
}
|
123
|
+
|
124
|
+
@JRubyMethod(name = "last" )
|
125
|
+
public IRubyObject getLast(ThreadContext context) throws Exception {
|
126
|
+
if (getResult(context).isEmpty())
|
127
|
+
return context.getRuntime().getNil();
|
128
|
+
return (NodeJ) getResult(context).last();
|
129
|
+
}
|
130
|
+
|
131
|
+
@JRubyMethod(name = { "xpath_type" })
|
132
|
+
public IRubyObject getXpathType(ThreadContext context) throws Exception {
|
133
|
+
return context.getRuntime().getNil();
|
134
|
+
}
|
135
|
+
|
136
|
+
@JRubyMethod(name = { "empty?" })
|
137
|
+
public RubyBoolean isEmpty(ThreadContext context) throws Exception {
|
138
|
+
return UtilJ.toBool(context, getResult(context).isEmpty());
|
139
|
+
}
|
140
|
+
|
141
|
+
@JRubyMethod(name = { "set" })
|
142
|
+
public IRubyObject getSet(ThreadContext context) throws Exception {
|
143
|
+
return NodeSetJ.newInstance(context, getResult(context));
|
144
|
+
}
|
145
|
+
|
146
|
+
@JRubyMethod(name = { "to_a" })
|
147
|
+
public IRubyObject toArray(ThreadContext context) throws Exception {
|
148
|
+
return getResult(context);
|
149
|
+
}
|
150
|
+
|
151
|
+
private RubyArray getResult(ThreadContext context) throws Exception {
|
152
|
+
if (this.result == null)
|
153
|
+
this.result = evaluateExpression(context);
|
154
|
+
return this.result;
|
155
|
+
}
|
156
|
+
|
157
|
+
@JRubyMethod(name = { "[]" })
|
158
|
+
public IRubyObject get(ThreadContext context, IRubyObject pIndex)
|
159
|
+
throws Exception {
|
160
|
+
RubyNumeric index = (RubyNumeric) pIndex;
|
161
|
+
RubyArray result = getResult(context);
|
162
|
+
return (IRubyObject) result.at( index );
|
163
|
+
}
|
164
|
+
|
165
|
+
@JRubyMethod(name = { "context" })
|
166
|
+
public IRubyObject getContext(ThreadContext context) {
|
167
|
+
return context.getRuntime().getNil();
|
168
|
+
}
|
169
|
+
|
170
|
+
private RubyArray evaluateExpression(ThreadContext context) throws Exception {
|
171
|
+
XPath xpath = UtilJ.newXPath();
|
172
|
+
|
173
|
+
Node nn = (this.node instanceof Document) ? ((Document) this.node)
|
174
|
+
.getDocumentElement() : this.node.getOwnerDocument();
|
175
|
+
|
176
|
+
xpath.setNamespaceContext( new CustomNamespaceContext( nn, this.namespaces) );
|
177
|
+
NodeList list;
|
178
|
+
try {
|
179
|
+
list = (NodeList) xpath.evaluate(this.expression.asJavaString(), this.node, XPathJ.NODESET);
|
180
|
+
} catch (XPathExpressionException e) {
|
181
|
+
if ((e.getCause() instanceof Exception))
|
182
|
+
throw ((Exception) e.getCause());
|
183
|
+
throw e;
|
184
|
+
}
|
185
|
+
|
186
|
+
List<IRubyObject> array = new ArrayList<IRubyObject>();
|
187
|
+
for (int i = 0; i < list.getLength(); i++) {
|
188
|
+
NodeJ node = NodeJ.newInstance(context);
|
189
|
+
//node.setDocPresent( this.node instanceof Document ? true : ((Node)).isDocPresent() );
|
190
|
+
node.setJavaObject(list.item(i));
|
191
|
+
array.add(node);
|
192
|
+
}
|
193
|
+
|
194
|
+
return context.getRuntime().newArray(array);
|
195
|
+
}
|
196
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
package smile.xml.xpath;
|
2
|
+
|
3
|
+
import org.jruby.Ruby;
|
4
|
+
import org.jruby.RubyClass;
|
5
|
+
import org.jruby.RubyObject;
|
6
|
+
import org.jruby.anno.JRubyClass;
|
7
|
+
import org.jruby.runtime.ObjectAllocator;
|
8
|
+
import org.jruby.runtime.builtin.IRubyObject;
|
9
|
+
|
10
|
+
import smile.xml.util.UtilJ;
|
11
|
+
|
12
|
+
@JRubyClass(name = "LibXML::XML::XPath::XPointer")
|
13
|
+
public class XPointerJ extends RubyObject {
|
14
|
+
|
15
|
+
private static final long serialVersionUID = -7924934418493439093L;
|
16
|
+
|
17
|
+
private static final ObjectAllocator ALLOCATOR = new ObjectAllocator() {
|
18
|
+
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
|
19
|
+
return new XPointerJ(runtime, klass);
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
public static RubyClass define(Ruby runtime) {
|
24
|
+
return UtilJ.defineClass( runtime, XPointerJ.class, ALLOCATOR );
|
25
|
+
}
|
26
|
+
|
27
|
+
private XPointerJ(Ruby runtime, RubyClass metaClass) {
|
28
|
+
super(runtime, metaClass);
|
29
|
+
}
|
30
|
+
|
31
|
+
|
32
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'xml'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require './test_helper'
|
4
|
+
|
5
|
+
1.times do |count|
|
6
|
+
|
7
|
+
xml_doc = XML::Document.new()
|
8
|
+
xml_doc.encoding = "UTF-8"
|
9
|
+
xml_doc.root = XML::Node.new("Request")
|
10
|
+
|
11
|
+
1000.times do |index|
|
12
|
+
xml_doc.root << node = XML::Node.new("row")
|
13
|
+
node["user_id"] = index.to_s
|
14
|
+
node << "600445"
|
15
|
+
end
|
16
|
+
|
17
|
+
xml_str = xml_doc.to_s
|
18
|
+
print "\r#{count}"
|
19
|
+
$stdout.flush
|
20
|
+
end
|
21
|
+
puts "\n"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require './test_helper'
|
4
|
+
|
5
|
+
# This is related to bug 8337, complaint is on amd64/fbsd
|
6
|
+
# unknown if it happens on other amd64/os combos
|
7
|
+
|
8
|
+
Process.setrlimit(Process::RLIMIT_NOFILE,10005)
|
9
|
+
|
10
|
+
(1..10000).each{|time|
|
11
|
+
XML::Document.file(File.join(File.dirname(__FILE__),'ets_test.xml'))
|
12
|
+
if time % 100 == 0
|
13
|
+
print "\r#{time}"
|
14
|
+
$stdout.flush
|
15
|
+
end
|
16
|
+
}
|
17
|
+
puts "\n"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require './test_helper'
|
4
|
+
|
5
|
+
100.times do |count|
|
6
|
+
|
7
|
+
xml_doc = XML::Document.new()
|
8
|
+
xml_doc.encoding = "UTF-8"
|
9
|
+
xml_doc.root = XML::Node.new("Request")
|
10
|
+
|
11
|
+
1000.times do |index|
|
12
|
+
|
13
|
+
xml_doc.root << node = XML::Node.new("row")
|
14
|
+
node["user_id"] = index.to_s
|
15
|
+
node << "600445"
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
xml_str = xml_doc.to_s
|
20
|
+
print "\r#{count}"
|
21
|
+
$stdout.flush
|
22
|
+
end
|
23
|
+
puts "\n"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'libxml'
|
4
|
+
|
5
|
+
100.times do
|
6
|
+
doc = XML::Document.new
|
7
|
+
doc.encoding = 'UTF-8'
|
8
|
+
|
9
|
+
root = XML::Node.new 'gpx'
|
10
|
+
root['version'] = '1.0'
|
11
|
+
root['creator'] = 'OpenStreetMap.org'
|
12
|
+
root['xmlns'] = "http://www.topografix.com/GPX/1/0/"
|
13
|
+
|
14
|
+
doc.root = root
|
15
|
+
|
16
|
+
track = XML::Node.new 'trk'
|
17
|
+
doc.root << track
|
18
|
+
|
19
|
+
trkseg = XML::Node.new 'trkseg'
|
20
|
+
track << trkseg
|
21
|
+
|
22
|
+
1.upto(1000) do |n|
|
23
|
+
trkpt = XML::Node.new 'trkpt'
|
24
|
+
trkpt['lat'] = n.to_s
|
25
|
+
trkpt['lon'] = n.to_s
|
26
|
+
trkseg << trkpt
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require './test_helper'
|
4
|
+
|
5
|
+
# test of bug 13310, clears MEM2
|
6
|
+
|
7
|
+
include GC
|
8
|
+
|
9
|
+
inner = XML::Node.new('inner')
|
10
|
+
save = nil
|
11
|
+
1.times do
|
12
|
+
outer = XML::Node.new('outer')
|
13
|
+
outer.child = inner
|
14
|
+
1.times do
|
15
|
+
doc = XML::Document.new
|
16
|
+
doc.root = outer
|
17
|
+
# Uncomment the following line and it won't crash
|
18
|
+
save = doc
|
19
|
+
end
|
20
|
+
garbage_collect
|
21
|
+
end
|
22
|
+
garbage_collect
|
23
|
+
puts inner
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<?xml-stylesheet type="text/xsl" href="my_stylesheet.xsl"?>
|
3
|
+
<feed xmlns="http://www.w3.org/2005/Atom">
|
4
|
+
<!-- Not a valid atom entry -->
|
5
|
+
<entry>
|
6
|
+
<title type="html"><![CDATA[<<strong>>]]></title>
|
7
|
+
<content type="xhtml">
|
8
|
+
<xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
9
|
+
<xhtml:p>hi there</xhtml:p>
|
10
|
+
</xhtml:div>
|
11
|
+
</content>
|
12
|
+
</entry>
|
13
|
+
</feed>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<bands genre="metal">
|
3
|
+
<m�tley_cr�e country="us">M�tley Cr�e is an American heavy metal band formed in Los Angeles, California in 1981.</m�tley_cr�e>
|
4
|
+
<iron_maiden country="uk">Iron Maiden is a British heavy metal band formed in 1975.</iron_maiden>
|
5
|
+
</bands>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<bands genre="metal">
|
3
|
+
<mötley_crüe country="us">Mötley Crüe is an American heavy metal band formed in Los Angeles, California in 1981.</mötley_crüe>
|
4
|
+
<iron_maiden country="uk">Iron Maiden is a British heavy metal band formed in 1975.</iron_maiden>
|
5
|
+
</bands>
|
@@ -0,0 +1,146 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<!-- Sample xml file from Microsoft.
|
3
|
+
See http://msdn.microsoft.com/en-us/library/ms762271(VS.85).aspx -->
|
4
|
+
<catalog>
|
5
|
+
<book id="bk101">
|
6
|
+
<author>Gambardella, Matthew</author>
|
7
|
+
<title>XML Developer's Guide</title>
|
8
|
+
<genre>Computer</genre>
|
9
|
+
<price>44.95</price>
|
10
|
+
<publish_date>2000-10-01</publish_date>
|
11
|
+
<description>
|
12
|
+
An in-depth look at creating applications
|
13
|
+
with XML.
|
14
|
+
</description>
|
15
|
+
</book>
|
16
|
+
<book id="bk102">
|
17
|
+
<author>Ralls, Kim</author>
|
18
|
+
<title>Midnight Rain</title>
|
19
|
+
<genre>Fantasy</genre>
|
20
|
+
<price>5.95</price>
|
21
|
+
<publish_date>2000-12-16</publish_date>
|
22
|
+
<description>
|
23
|
+
A former architect battles corporate zombies,
|
24
|
+
an evil sorceress, and her own childhood to become queen
|
25
|
+
of the world.
|
26
|
+
</description>
|
27
|
+
</book>
|
28
|
+
<book id="bk103">
|
29
|
+
<author>Corets, Eva</author>
|
30
|
+
<title>Maeve Ascendant</title>
|
31
|
+
<genre>Fantasy</genre>
|
32
|
+
<price>5.95</price>
|
33
|
+
<publish_date>2000-11-17</publish_date>
|
34
|
+
<description>
|
35
|
+
After the collapse of a nanotechnology
|
36
|
+
society in England, the young survivors lay the
|
37
|
+
foundation for a new society.
|
38
|
+
</description>
|
39
|
+
</book>
|
40
|
+
<book id="bk104">
|
41
|
+
<author>Corets, Eva</author>
|
42
|
+
<title>Oberon's Legacy</title>
|
43
|
+
<genre>Fantasy</genre>
|
44
|
+
<price>5.95</price>
|
45
|
+
<publish_date>2001-03-10</publish_date>
|
46
|
+
<description>
|
47
|
+
In post-apocalypse England, the mysterious
|
48
|
+
agent known only as Oberon helps to create a new life
|
49
|
+
for the inhabitants of London. Sequel to Maeve
|
50
|
+
Ascendant.
|
51
|
+
</description>
|
52
|
+
</book>
|
53
|
+
<book id="bk105">
|
54
|
+
<author>Corets, Eva</author>
|
55
|
+
<title>The Sundered Grail</title>
|
56
|
+
<genre>Fantasy</genre>
|
57
|
+
<price>5.95</price>
|
58
|
+
<publish_date>2001-09-10</publish_date>
|
59
|
+
<description>
|
60
|
+
The two daughters of Maeve, half-sisters,
|
61
|
+
battle one another for control of England. Sequel to
|
62
|
+
Oberon's Legacy.
|
63
|
+
</description>
|
64
|
+
</book>
|
65
|
+
<book id="bk106">
|
66
|
+
<author>Randall, Cynthia</author>
|
67
|
+
<title>Lover Birds</title>
|
68
|
+
<genre>Romance</genre>
|
69
|
+
<price>4.95</price>
|
70
|
+
<publish_date>2000-09-02</publish_date>
|
71
|
+
<description>
|
72
|
+
When Carla meets Paul at an ornithology
|
73
|
+
conference, tempers fly as feathers get ruffled.
|
74
|
+
</description>
|
75
|
+
</book>
|
76
|
+
<book id="bk107">
|
77
|
+
<author>Thurman, Paula</author>
|
78
|
+
<title>Splish Splash</title>
|
79
|
+
<genre>Romance</genre>
|
80
|
+
<price>4.95</price>
|
81
|
+
<publish_date>2000-11-02</publish_date>
|
82
|
+
<description>
|
83
|
+
A deep sea diver finds true love twenty
|
84
|
+
thousand leagues beneath the sea.
|
85
|
+
</description>
|
86
|
+
</book>
|
87
|
+
<book id="bk108">
|
88
|
+
<author>Knorr, Stefan</author>
|
89
|
+
<title>Creepy Crawlies</title>
|
90
|
+
<genre>Horror</genre>
|
91
|
+
<price>4.95</price>
|
92
|
+
<publish_date>2000-12-06</publish_date>
|
93
|
+
<description>
|
94
|
+
An anthology of horror stories about roaches,
|
95
|
+
centipedes, scorpions and other insects.
|
96
|
+
</description>
|
97
|
+
</book>
|
98
|
+
<book id="bk109">
|
99
|
+
<author>Kress, Peter</author>
|
100
|
+
<title>Paradox Lost</title>
|
101
|
+
<genre>Science Fiction</genre>
|
102
|
+
<price>6.95</price>
|
103
|
+
<publish_date>2000-11-02</publish_date>
|
104
|
+
<description>
|
105
|
+
After an inadvertant trip through a Heisenberg
|
106
|
+
Uncertainty Device, James Salway discovers the problems
|
107
|
+
of being quantum.
|
108
|
+
</description>
|
109
|
+
</book>
|
110
|
+
<book id="bk110">
|
111
|
+
<author>O'Brien, Tim</author>
|
112
|
+
<title>Microsoft .NET: The Programming Bible</title>
|
113
|
+
<genre>Computer</genre>
|
114
|
+
<price>36.95</price>
|
115
|
+
<publish_date>2000-12-09</publish_date>
|
116
|
+
<description>
|
117
|
+
Microsoft's .NET initiative is explored in
|
118
|
+
detail in this deep programmer's reference.
|
119
|
+
</description>
|
120
|
+
</book>
|
121
|
+
<book id="bk111">
|
122
|
+
<author>O'Brien, Tim</author>
|
123
|
+
<title>MSXML3: A Comprehensive Guide</title>
|
124
|
+
<genre>Computer</genre>
|
125
|
+
<price>36.95</price>
|
126
|
+
<publish_date>2000-12-01</publish_date>
|
127
|
+
<description>
|
128
|
+
The Microsoft MSXML3 parser is covered in
|
129
|
+
detail, with attention to XML DOM interfaces, XSLT processing,
|
130
|
+
SAX and more.
|
131
|
+
</description>
|
132
|
+
</book>
|
133
|
+
<book id="bk112">
|
134
|
+
<author>Galos, Mike</author>
|
135
|
+
<title>Visual Studio 7: A Comprehensive Guide</title>
|
136
|
+
<genre>Computer</genre>
|
137
|
+
<price>49.95</price>
|
138
|
+
<publish_date>2001-04-16</publish_date>
|
139
|
+
<description>
|
140
|
+
Microsoft Visual Studio 7 is explored in depth,
|
141
|
+
looking at how Visual Basic, Visual C++, C#, and ASP+ are
|
142
|
+
integrated into a comprehensive development
|
143
|
+
environment.
|
144
|
+
</description>
|
145
|
+
</book>
|
146
|
+
</catalog>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<template>
|
3
|
+
<body>
|
4
|
+
<section>
|
5
|
+
<txt>Some Preset Data Here</txt>
|
6
|
+
<txt>Some Preset Data Here</txt>
|
7
|
+
<txt>name: quack!</txt>
|
8
|
+
<txt>Some Preset Data Here</txt>
|
9
|
+
<txt>Some Preset Data Here</txt>
|
10
|
+
<txt>Some Preset Data Here</txt>
|
11
|
+
<txt>Some Preset Data Here</txt>
|
12
|
+
<txt>city: quack!</txt>
|
13
|
+
<txt>Some Preset Data Here</txt>
|
14
|
+
<txt>Some Preset Data Here</txt>
|
15
|
+
<txt>Some Preset Data Here</txt>
|
16
|
+
<txt>Some Preset Data Here</txt>
|
17
|
+
<txt>state: quack!</txt>
|
18
|
+
<txt>Some Preset Data Here</txt>
|
19
|
+
<txt>Some Preset Data Here</txt>
|
20
|
+
<txt>Some Preset Data Here</txt>
|
21
|
+
<txt>Some Preset Data Here</txt>
|
22
|
+
<row>
|
23
|
+
<txt>year: Vroom!</txt>
|
24
|
+
<txt>make: Vroom!</txt>
|
25
|
+
<txt>model: Vroom!</txt>
|
26
|
+
</row>
|
27
|
+
<row>
|
28
|
+
<txt>year: Vroom!</txt>
|
29
|
+
<txt>make: Vroom!</txt>
|
30
|
+
<txt>model: Vroom!</txt>
|
31
|
+
</row>
|
32
|
+
<row>
|
33
|
+
<txt>year: Vroom!</txt>
|
34
|
+
<txt>make: Vroom!</txt>
|
35
|
+
<txt>model: Vroom!</txt>
|
36
|
+
</row>
|
37
|
+
<txt>Some Preset Data Here</txt>
|
38
|
+
<txt>Some Preset Data Here</txt>
|
39
|
+
<row>
|
40
|
+
<txt>year: Vroom!</txt>
|
41
|
+
<txt>make: Vroom!</txt>
|
42
|
+
<txt>model: Vroom!</txt>
|
43
|
+
</row>
|
44
|
+
<row>
|
45
|
+
<txt>year: Vroom!</txt>
|
46
|
+
<txt>make: Vroom!</txt>
|
47
|
+
<txt>model: Vroom!</txt>
|
48
|
+
</row>
|
49
|
+
<row>
|
50
|
+
<txt>year: Vroom!</txt>
|
51
|
+
<txt>make: Vroom!</txt>
|
52
|
+
<txt>model: Vroom!</txt>
|
53
|
+
</row>
|
54
|
+
<txt>Some Preset Data Here</txt>
|
55
|
+
<txt>Some Preset Data Here</txt>
|
56
|
+
</section>
|
57
|
+
</body>
|
58
|
+
</template>
|