1. VTD Records
In this section, the sample XML file
is tokenized according the VTD specification.
Before parsing, VTD-XML reads the
following file into the buffer.
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/">
<channel rdf:about="http://www.xml.com/xml/news.rss">
<title>XML.com</title>
<description>
XML.com features a rich mix of information and
services
for the XML community.
</description>
</channel>
<item rdf:about="http://xml.com/pub/2000/08/09/xslt/xslt.html">
<title>Processing Inclusions with XSLT</title>
<description>
This article proposes a way of preserving inclusion
information through SAX-based processing.
</description>
</item>
<item rdf:about="http://xml.com/pub/2000/08/09/rdfdb/index.html">
<title>Putting RDF to Work</title>
<link>http://xml.com/pub/2000/08/09/rdfdb/index.html</link>
<description>
Tool and API support for the Resource Description
Framework
is slowly coming of age.
</description>
</item>
</rdf:RDF>
|
After parsing, VTD records, shown in
the table below, are produced. Notice that end tags' VTD records are
discarded.
Index |
Token Value |
Token Type |
Nesting Depth |
Offset:Length
Offset: prefix length: Qname length |
0 |
Version |
9 |
-1 |
6:7 |
1 |
1.0 |
10 |
-1 |
15:3 |
2 |
rdf:RDF |
0 |
0 |
23:3:7 |
3 |
xmlns:rdf |
3 |
0 |
34:5:9 |
4 |
http://www.w3.org/1999/02/22-rdf-syntax-ns#
|
4 |
0 |
45:43 |
5 |
xmlns |
3 |
0 |
92:0:5 |
6 |
http://purl.org/rss/1.0/ |
4 |
0 |
99:24 |
7 |
channel |
0 |
1 |
130:0:7 |
8 |
rdf:about |
2 |
1 |
138:3:9 |
9 |
http://www.xml.com/xml/news.rss |
4 |
1 |
149:31 |
10 |
title |
0 |
2 |
188:0:5 |
11 |
XML.com |
5 |
2 |
194:7 |
12 |
description |
0 |
2 |
215:11 |
13 |
XML.com features a rich mix of
information and services for the XML community. |
5 |
2 |
227:95 |
14 |
item |
0 |
1 |
358:0:4 |
15 |
rdf:about |
2 |
1 |
363:3:9 |
16 |
http://xml.com/pub/2000/08/09/xslt/xslt.html |
4 |
1 |
374:44 |
17 |
title |
0 |
2 |
426:0:5 |
18 |
Processing Inclusions with XSLT |
5 |
2 |
432:29 |
19 |
description |
0 |
2 |
477:0:11 |
20 |
This article proposes a way of preserving
inclusion information through SAX-based processing. |
5 |
2 |
489:105 |
21 |
item |
0 |
1 |
630:0:4 |
22 |
rdf:about |
2 |
1 |
635:3:9 |
23 |
http://xml.com/pub/2000/08/09/rdfdb/index.html |
4 |
1 |
646:46 |
24 |
title |
0 |
2 |
700:0:5 |
25 |
Putting RDF to Work |
5 |
2 |
706:19 |
26 |
link |
0 |
2 |
739:0:4 |
27 |
http://xml.com/pub/2000/08/09/rdfdb/index.html |
5 |
2 |
744:42 |
28 |
description |
0 |
2 |
803:0:11 |
29 |
Tool and API support for the Resource
Description Framework is slowly coming of age. |
5 |
2 |
815:94 |