nu.xom.samples

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » xom » nu.xom.samples 
nu.xom.samples

nu.xom.samples includes several dozen example programs that demonstrate different parts of the XOM API. These are intended for tutorial purposes. They are not designed as reusable code for the most part. Most of the examples are adapted from Processing XML with Java by Elliotte Rusty Harold. Please consult that book (available in its entirety online) if you'd like more information about what particular samples are intended to show. That book provides SAX, DOM, and/or JDOM implementations of most of these samples.

These classes are not officially part of the XOM API. They have not been extensively tested, and I make no promises that they will be part of any future XOM release; or, if they are, that their APIs will remain compatible. Should you find any of them useful and wish to use them in your own code, I recommend you copy the source code, and place it in your own package. It probably wouldn't hurt to add a lot of unit tests as well.

@since 1.0
Java Source File NameTypeComment
Account.javaClass

Demonstrates building a structured XML document, from flat, tabular data.

Agency.javaClass

Demonstrates building a structured XML document, from flat, tabular data.

AttributesToElements.javaClass

A filter that converts attributes to child elements.

AttributesXMLBudget.javaClass

Demonstrates building a structured XML document, from flat, tabular data.

Budget.javaClass

Demonstrates the building of a structured XML document, from flat, tabular data.

BudgetData.javaClass

Demonstrates building a structured XML document, from flat, tabular data.

Bureau.javaClass

Demonstrates building a structured XML document, from flat, tabular data.

CanonicalizerDriver.javaClass

Demonstrates use of the Canonicalizer class.

CommentReader.javaClass

Demonstrates extracting of comments from an XML document and reading their contents.

CrimsonPrinter.javaClass

Demonstrates specifying the SAX parser class to use.

DatabaseBuilder.javaClass
DatabaseConverter.javaClass

Demonstrates the building of a structured XML document, from a relational database using JDBC.

DocumentMerger.javaClass

Demonstrates parsing a document and reserializing it so as to resolve all entity references.

DTDGenerator.javaClass

Demonstrates walking the tree while collecting element and attribute names and types.

ElementLister.javaClass

Demonstrates walking the element hierarchy of an XML document.

EncodingDemo.javaClass
ExampleExtractor.javaClass

Demonstrates extracting the content of particular named elements from one XML document, and storing them into new files.

ExampleLister.javaClass

Demonstrates extracting the content of particular named elements in a particular context from an XML document.

EZSerializer.javaClass

A collection of static methods for serializing documents in one method call.

FibonacciAttributes.javaClass

Demonstrates the creation of a simple document with basic nested element structure and some attributes on the elements.

FibonacciEBCDIC.javaClass

Demonstrates the creation of a simple document with basic nested element structure using EBCDIC encoding.

FibonacciFile.javaClass

Demonstrates the creation of a simple document in memory and saving it to a file.

FibonacciLatin1.javaClass

Demonstrates the creation of a simple document with basic nested element structure and the serialization of that document in a specified encoding.

FibonacciServlet.javaClass

Demonstrates a servlet that processes XML-RPC requests.

FibonacciSOAPClient.javaClass

Demonstrates communication with a SOAP server via the creation of an XML document, transmission of that document over the network, and reception and parsing of the server's response document.

FibonacciXML.javaClass

Demonstrates the creation of a simple document with basic nested element structure.

FibonacciXMLRPCClient.javaClass

Demonstrates communication with an XML-RPC server via the creation of a simple document, transmission of that document over the network, and reception and parsing of the server's response.

FibonacciXOMSOAPServlet.javaClass

Demonstrates a servlet that receives and responds to SOAP requests.

FibonacciXOMXMLRPCServlet.javaClass

Demonstrates a servlet that receives and responds to XML-RPC requests.

FilterDriver.javaClass
FlatXMLBudget.javaClass

Demonstrates building a structured XML document, from flat, tabular data.

HelloNamespaces.javaClass
HelloWorld.javaClass

Demonstrates the creation and serialization of a very simple "Hello World" document.

HelloXMLBase.javaClass

Demonstrates interaction of actual base URI with xml:base attributes.

HierarchicalXMLBudget.javaClass

Demonstrates building a structured XML document, from flat, tabular data.

IDFilter.javaClass

Demonstrates a custom NodeFactory that adds ID attributes to all elements that don't already have one.

IDTagger.javaClass

Demonstrates recursive descent through a document, and reading and setting of attributes on elements.

Linkset.javaClass

Demonstrates extracting elements from one document and inserting them into another document.

MathMLFibonacci.javaClass

Demonstrates the creation and serialization of a MathML document that uses namespaces and namespace prefixes.

MinimalNodeFactory.javaClass

Demonstrates a NodeFactory that builds the minimum structures possible, just the document and the root element.

NodeLister.javaClass

Demonstrates recursive descent through a document using the Node class.

NonRecursiveSerializer.javaClass

Demonstrates a serializer which, unlike nu.xom.Serializer, is not limited by the Java stack size and can process arbitrarily deep documents.

NormalizingFactory.javaClass

Demonstrates a custom NodeFactory that normalizes all white space in text nodes and attribute values. Normalization involves stripping all leading and trailing white space, converting all tabs, carriage returns, and line feeds to a single space each, and then converting all remaining runs of white space to a single space.

PoliteSpider.javaClass

Demonstrates the reading of attributes in namespaces, searching for particular processing instructions in the document prolog, and maintaining a stack of hierarchy-based state during document traversal.

PrettyFibonacci.javaClass

Demonstrates using a Serializer object to insert indents and line breaks in XML.

PrettyPrinter.javaClass

Demonstrates using a Serializer object to modify an input document by inserting indents and line breaks.

ProcessingInstructionLister.javaClass

Demonstrates recursive descent through an XML document, and the ProcessingInstruction class.

PropertyPrinter.javaClass

Demonstrates recursive descent through an XML document, and the getter methods of the Element and Attribute classes.

PseudoAttributes.javaClass

A utility class which converts pseudo-attributes in a ProcessingInstruction object into real Attribute/code> objects.

PureValidator.javaClass

Demonstrates validation via the Builder class that does not build much of a document, and thus does not have a lot of overhead.

RDDLFilter.javaClass

Demonstrates using the Builder and a custom NodeFactory to filter out start-tags and end-tags while leaving the content intact.

RDDLStripper.javaClass

Demonstrates removing elements from a tree while retaining their children.

RDDLToTable.javaClass

Demonstrates a custom NodeFactory that converts rddl:resource elements to XHTML tables.

ResourceToTable.javaClass

Demonstrates replacing elements in a document with different elements that contain the same content.

Restructurer.javaClass

Demonstrates moving nodes from one part of the tree to a different part.

ROT13File.javaClass
ROT13XML.javaClass

Demonstrates getter and setter methods in the Text class, as well as recursive descent through a document.

RSSHeadlines.javaClass
SchemaValidator.javaClass
SimpleSVG.javaClass

Demonstrates the creation and serialization of an SVG document that uses namespaces and the default namespace and includes a document type declaration.

SourceCodeGenerator.javaClass

This program essentially serializes a XOM Node object into the Java statements necessary to build the Node using XOM.

SourceCodeSerializer.javaClass

This class converts an XML document into XOM source code that creates the same XML document.

SQLToXML.javaClass

Demonstrates building a structured XML document, from relational data using JDBC.

StreamingCommentReader.javaClass

Demonstrates using the Builder and a custom NodeFactory to list the comments in a document that contains very little else, thus saving memory, and avoiding the overhead of building lots of objects we don't actually need.

StreamingElementLister.javaClass

Demonstrates walking the element hierarchy of an XML document in a streaming fashion while storing state in the node factory.

StreamingExampleExtractor.javaClass

Demonstrates extracting the content of particular named elements from one XML document, and storing them into new files.

StreamingNodeLister.javaClass

Non-recursive, streaming alternative to NodeLister.

StreamingProcessingInstructionLister.javaClass

Demonstrates using the Builder and a custom NodeFactory to list the processing instructions while avoiding the overhead of constructing a lot of unneeded nodes thus saving memory and time.

StreamingROT13.javaClass
StreamingTextExtractor.javaClass

Demonstrates filtered streaming via a NodeFactory subclass.

StreamingTreeReporter.javaClass

Demonstrates recursive descent through an XML document, and the getter methods of the Element and Attribute classes.

StreamingTypeCounter.javaClass

Demonstrates walking the element hierarchy of an XML document in a streaming fashion while storing state in the node factory.

StreamingXHTMLPurifier.javaClass

Demonstrates a custom NodeFactory that strips out all non-XHTML elements.

StreamingXHTMLQualifier.javaClass

Demonstrates a custom NodeFactory that changes the namespaces of elements while building the document so a second tree walk is not required.

Subfunction.javaClass

Demonstrates building a structured XML document, from flat, tabular data.

TextExtractor.javaClass

Demonstrates the getValue() method of the Document class.

TextMerger.javaClass

Utility methods for merging all consecutive text nodes.

TextSerializer.javaClass

This Serializer subclass outputs raw, unescaped text from the text nodes, but no markup of any kind.

Transformer.javaClass
TreePrinter.javaClass

Demonstrates reading the names, namespaces, and attributes of an element.

TreeReporter.javaClass

Demonstrates recursive descent through a document.

TreeViewer.javaClass

Demonstrates using Swing to present a graphical display of the tree structure of an XML document.

Validator.javaClass

Demonstrates validation via the Builder class.

ValidFibonacci.javaClass

Demonstrates the creation and serialization of a simple XML document that includes a document type declaration.

WrappingSerializer.javaClass

This class writes XML with a maximum line length, but only breaks lines inside tags.

XHTMLPurifier.javaClass

Demonstrates the removal of elements and their content from a document.

XHTMLQualifier.javaClass

Demonstrates adding namespaces to elements.

XHTMLValidator.javaClass

Demonstrates the use of the DocType class by validating XHTML.

XIncludeDriver.javaClass
XLinkSpider.javaClass

Demonstrates the reading of attributes in namespaces, as well as maintaining a stack of hierarchy-based state during document traversal.

XMLPrinter.javaClass

Demonstrates parsing a document and outputting it again using the toXML method.

XOMChecker.javaClass

Demonstrates simple parsing and the exceptions that may be throw in the process.

XPathDriver.javaClass
XPathHeadlines.javaClass

Use XPath to find just the headlines from an RSS feed.

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.