HTTP/2 302
server: nginx
date: Fri, 18 Jul 2025 04:35:47 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20080226014535
location: https://web.archive.org/web/20080226014535/https://java.sun.com/developer/codesamples/xml.html
server-timing: captures_list;dur=0.642760, exclusion.robots;dur=0.022392, exclusion.robots.policy;dur=0.009827, esindex;dur=0.011968, cdx.remote;dur=39.102562, LoadShardBlock;dur=153.704571, PetaboxLoader3.datanode;dur=77.215580, PetaboxLoader3.resolve;dur=51.021657
x-app-server: wwwb-app212
x-ts: 302
x-tr: 223
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app212; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Fri, 18 Jul 2025 04:35:48 GMT
content-type: text/html
x-archive-orig-server: Sun-Java-System-Web-Server-6.1
x-archive-orig-date: Tue, 26 Feb 2008 01:45:31 GMT
x-archive-orig-last-modified: Mon, 17 Dec 2007 23:44:47 GMT
x-archive-orig-accept-ranges: bytes
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: iso-8859-1
memento-datetime: Tue, 26 Feb 2008 01:45:35 GMT
link:
; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Wed, 17 Dec 2003 17:58:48 GMT", ; rel="prev memento"; datetime="Thu, 17 Jan 2008 06:58:08 GMT", ; rel="memento"; datetime="Tue, 26 Feb 2008 01:45:35 GMT", ; rel="next memento"; datetime="Sun, 02 Mar 2008 01:16:33 GMT", ; rel="last memento"; datetime="Wed, 10 Jul 2024 02:13:08 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 51_2_20080225201412_crawl105-c/51_2_20080226013029_crawl104.arc.gz
server-timing: captures_list;dur=0.537705, exclusion.robots;dur=0.018386, exclusion.robots.policy;dur=0.009076, esindex;dur=0.011431, cdx.remote;dur=71.007105, LoadShardBlock;dur=69.236891, PetaboxLoader3.datanode;dur=112.596681, load_resource;dur=210.266142, PetaboxLoader3.resolve;dur=90.113729
x-app-server: wwwb-app212
x-ts: 200
x-tr: 408
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
Java API for XML Code Samples
Index of Code Samples
Java API for XML Code Samples
Java API for XML processing (JAXP) lets you access XML documents
either serially (SAX) or in random access mode (DOM).
DOM Examples
SAX Examples
ChessBoardSAXPrinter.java
outputs the averaged elapsed time to process a document.
For more information see
Java Technology and XML - Part 2 .
Echo01.java
echoes SAX parser events to System.out
.
slideSample01.xml is the XML file the code operates on, and
slideSample01-xml.html is the browsable version.
For more information see
The XML Tutorial .
Echo02.java
is another version of the
Echo1.java
program that displays an XML file, but the output is not that readable.
slideSample01.xml is
the XML file the code operates on, and
slideSample01-xml.html
is the browsable version.
For more information see
The XML Tutorial .
Echo03.java
is a version of the
Echo2.java
with more readable output.
slideSample01.xml is
the XML file the code operates on, and
slideSample01-xml.html
is the browsable version.
For more information see
The XML Tutorial .
Echo04.java
gets the document locator and uses it to echo the document's system ID.
slideSample01.xml is
the XML file the code operates on, and
slideSample01-xml.html
is the browsable version.
For more information see
The XML Tutorial .
Echo05.java
adds a processing instruction to
slideSample02.xml .
slideSample02-xml.html
is the browsable version.
For more information see
The XML Tutorial .
Echo06.java
handles a fatal error.
For more information see
The XML Tutorial .
Echo07.java
handles a non-fatal error.
For more information see
The XML Tutorial .
Echo08.java
processes and echoes ignorable white space.
For more information see
The XML Tutorial .
Echo09.java
is a version of Echo08.java
with the code for processing and echoing ignorable white space removed.
For more information see
The XML Tutorial .
Echo10.java
uses a validating parser.
For more information see
The XML Tutorial .
Echo11.java
has a lexical handler.
For more information see
The XML Tutorial .
EntityCache.java
shows a simple cache implementation for external entities.
For more information see
Java Technology and XML: Performance Improvement Tips .
JDBCSAXParser.java
iterates over database table rows and columns and generates SAX events along the way.
For supporting information see,
XML APIs for
Databases
JDBCInputSource.java
extends the org.xml.sax.InputSource
class to implement a parser that operates on a JDBC
data source, iterates over each row and column, and generates appropriate SAX events while iterating.
For supporting information see,
XML APIs for
Databases
MySAXParserBean.java
invokes the startElement
method at the beginning of every element in the XML document, and
the characters
method to report each chunk of character data, and finally,
the endElement
method at the end of every element in the XML document.
For more information see
Web Application Development
with JSP Technology and XML. .
XML Style Sheet language (XSLT)