A Simple Way To Read An XML File In Java
This is the simplest way to read data from an XML file into a Java program. I have also included some basic error checking, so you can directly cut-paste this code with a few changes of course. All you have to do is change the XML tags within the program to match those that are present in your XML file.
Accelerate WSS applications with VTD-XML
Real-world implementations of the Web Services Security standards generally exhibit poor performance characteristics. VTD-XML can solve some of these performance issues by speeding up parsing.
All about JAXP
The article covers basic concepts of JAXP, demonstrates why it is needed in the XML parsing space, and shows how the parser used by JAXP can easily be changed. It also drills down into SAX and DOM, two popular Java and XML APIs that are related to JAXP.
Build distributed applications with Java and XML
XML is a popular way to represent data in a portable,
vendor-neutral, readable format. But what if you need to send
XML data across a process boundary in a distributed
application? Bruce Martin examines three approaches to
accomplishing that in Java.
Changing the JAXP Parser Classes
This tip extends that discussion by explaining what vendor-neutral means in JAXP, and how to change the parsers that JAXP configures and constructs.
Chatting in XML Financial Messages
This article explains how to apply Java and XML to financial industry messaging transactions, including Real Time Chatting (RTC) between parties.
CO-STARS IN NETWORKING XML and JavaTM Technologies
This article tells how Sun is combining XML with Java technologies to create a complete, platform-independent, Web-based computing environment. XML and JavaTM technologies are perfect complements, creating a whole new world of possibilities for developers.
Converting from DOM
In this tip, you'll learn how to to convert DOM structures to SAX and JDOM to allow communication with applications that do not use DOM. The code listings demonstrate how to convert from DOM to an output stream for use by SAX, and how to convert from DOM to JDOM.
Converting XML to HTML Using Sun's Java API for XML Processing and Microsoft's MSXML 3.0 API
This article describes two solutions he employed in applications to generate custom reports. His solutions convert XML data to HTML using XSL Transformations. One solution uses the Sun Java API for XML Processing, which is called JAXP. The other solution uses the Microsoft MSXML API.
Creating Parsers with JAXP
One of the major strengths of J2EE is its vendor-neutral, integrated support for XML. This month's tip focuses on how to use the Java API for XML (JAXP). JAXP provides a built-in set of interfaces for creating and configuring XML parsers in J2EE applications. This tip assumes you are familiar with the SAX and DOM interfaces to XML documents, and with basic XML terminology.
Easy Screen-scraping with XQuery
While XQuery was designed for querying large document bases, it serves as a fine tool for transforming simple documents as well. This article shows how XQuery offers a fast and easy way to scrape HTML pages for the data you need. XQuery is the perfect tool for you if your goal is simplifying complex pages for display on small screens, or extracting elements from multiple pages to aggregate them together on a home-grown portal, or simply extracting data from Web pages because there is no other programmatic way to get the data.
Effective XML processing with DOM and XPath in Java
IBM developerWorks just came out with an article that recommend
how to process XML with DOM and XPath. The article is an
analysis of many DOM projects and suggests how to avoid buggy
code
Introduction to Jena
RDF is increasingly recognized as an excellent choice for representing and processing semi-structured data. In this article, Web developer Philip McCarthy shows you how to use the Jena Semantic Web Toolkit to exploit RDF data models in your Java applications.
Jato: The new kid on the open source block
In this article, the first of three, Andy explains how to use Jato to perform basic Java-to-XML and XML-to-Java transformations.
Jato: The new kid on the open source block, Part 2
The Jato API converts XML documents into Java objects and back again. In Part 1 of this three-part series, Andy provided a set of simple examples to illustrate Java-to-XML and XML-to-Java transformations. In this second part, he delves more deeply into Java-to-XML transformations.
Jato: The new kid on the open source block, Part 3
This article explores converting XML-based data into a Swing user interface based on the JTreeTable component. Explore conditional object creation, Jato expressions, property settings, dynamic debug statements, and more.
Java configuration with XML Schema
This article shows how to use a Java XML parser together with the Java language reflection features to create an arbitrary set of named objects according to the content of an XML file.
Java Technology and XML-Part Two
This article is the second in a series of three. The first one gave an overview of the Java API for XML Processing (JAXP), and the technologies that it directly or indirectly provides to the Java developer or technologies that rely on it in order to process XML documents. It illustrated the use of different APIs with some sample programs. This second article focuses on the relative performance of these APIs as obtained by running the sample programs presented in the first article. This series will conclude with a third article which gives tips on how to improve the performance of XML-based applications from a programmatic and architectural point of view.
Managing ezines with JavaMail and XSLT, Part 1
This article describes how to convert DocBook XML documents to a text format that satisfies the stringent requirements of e-mail publishing.
Managing ezines with JavaMail and XSLT, Part 2
This article describes how to wrap this process with JavaMail -- the standard Java language e-mail API -- to send the e-zine over the wire. In the process, he revisits SAX event handling, and illustrates how to wrap XSLT processing in a larger application.
Managing XML Encryption with Java
XML is a text format, and as such, provides no wire security by itself; however, using standard Java encryption techniques, you can transmit and receive XML securely.
Moving DOM nodes
This tip takes a look at a common exception that occurs when you attempt to move DOM nodes. Here you'll learn the causes of this exception and, most important, how to avoid it when doing DOM programming.
New StAX Parsing in Woodstox
An XML parser is often the key to a high-performance, robust application. Traditional XML parsing techniques include DOM and SAX, but now there an innovative new parsing technique called Streaming API for XML (StAX); so beneficial its integrated with the Java EE 5 specification. In this installment, learn the benefits of StAX and why the Geronimo team chose Codehaus Woodstox as the StAX parser.
Parsing XML Efficiently
Efficient parsing of XML documents is more and more critical as XML gets adopted more widely. It is very important to have an efficient way to parse XML data, especially in applications that are intended to handle large volumes. Improper parsing can result in excessive memory usage and processing times that can hurt scalability.
Portable database reporting using Java and XML
This article explains how to generate printable reports from a database using Java- and XML-related technologies like Xalan, Xerces, and FOP
Roll Your Own Swing-based XML Editor (Part II)
This is the second of a three-part series that shows you how to
create the framework for an XML editor, including coverage of a
variety of Swing components (JSplitPane, JScrollPane, JButton,
and JTextArea).
Safeguard your XML-based messages
Apache XML Security is an open source implementation of the XML Digital Signature specification that allows you to digitally sign your Web service messages. Digital signatures assure your messages' receivers that the messages are really from you. After reading this article, which serves as an introductory tutorial to Apache XML Security, you will be well prepared to start signing your Web services messages.
SAX, the power API
This preview of the second edition of XML by Example by Benoit Marchal gives a solid introduction to SAX, the event-based API for processing XML that has become a de facto standard. This preview tells when to use SAX instead of DOM, gives an overview of commonly used SAX interfaces, and provides detailed examples in a Java-based application with many code samples.
Serialize Java Objects in XML with XStream
XStream is a lightweight and easy-to-use open source Java library for serializing Java objects to XML and back again. Learn how to set up XStream, and discover how to use it to serialize and deserialize objects as well as to read configuration properties from an XML configuration file.
Signing, Encrypting, and Decrypting Atom
Atom is a great format for relaying information, but what about security concerns? XML Digital Signatures and Encryption can ensure trusted, unaltered, secure data transfer. But how can you use them without destroying Atom structures? This article shows you how easily the digital signatures and encryption can mesh with Atom data using the Apache Abdera API.
StAXing up XML: Streaming API for XML
The Streaming API for XML (StAX) is the latest standard for processing XML in the Java language. As a stream-oriented approach, it often proves a better alternative to other methods, such as DOM and SAX, both in terms of performance and usability. This article provides an overview of StAX and describes its cursor-based API for processing XML.
Using JDOM and XSLT
In this tip, you'll learn how to take a JDOM document representation, transform it using the Apache Xalan processor, and obtain the resulting XML as another JDOM document. The code demonstrates how to use JDOM with the new Apache Xalan 2 processor (for Java).
Using SAXTransformerFactory
In this detailed tip, explains how SAXTransformerFactory -- a class that feeds SAX events directly in an XSLT processor -- buys you greater flexibility when you save XML files. Several reusable Java code samples demonstrate the techniques, which require TrAX.
Using XML in Java Gets Easier with DOM4J
Have you experienced the pain of parsing and extracting XML data inside Java applications? Then you'll love DOM4J. Find out how flexible, high-performance, and memory-efficient implementations of this XML framework can ease the hardships of XML-based Java application development.
Validation with Java and XML schema, Part 4
XML schemas can provide a better way to validate data in Java applications. You'll parse the XML schema, build up Java representations of the schema's constraints, and learn how to apply those constraints to data in an application
Web Application Development with JSPTM and XML Part II: JSP with XML in mind
In part II of his popular series "Web Application Development with JSP and XML," author presents a brief overview of XML, utilizing JavaServer PagesTM technology, with an eye towards eventually writing your own custom tags and tag libraries that help separate business logic from presentation.
Working with JDOM, XPath and XSLT
This month Keld will give some advice on which tools to use for a given task, and then go further into one of his absolute favorites, JDOM. We'll look at some of the more advanced features of JDOM, namely the use of XPath and XSLT with JDOM.
Write a simple XML message broker for custom XML messages
In this article, the first of three, it discusses XML messaging, specifically the basic premise of XML messaging, what it is, and why it is useful. Further, it presents a simple XML message broker for custom XML messages.
XACML: A New Standard Protects Content in Enterprise Data Exchange
The XACML language effectively protects content from
unauthorized use in enterprise data exchanges. Here are three
reasons why XACML may soon emerge as the single standard: *
XACML is designed around, and written in, XML, which enjoys a
wide and expanding base in global enterprise environments. *
OASIS, which drives the development, convergence, and adoption
of e-business standards, has ratified XACML. * XACML places a
set of powerful features at the disposal of developers. It
allows a firm to create and deploy authorization policies to
match its mix of assets and business use-cases, then plug in
additional policies as the business and its standards evolve.
XML as a Bridge between SQL and Web Applications
Over the past few years XML technology has gained great popularity as a format for exchanging information over the Internet. Today, XML is often portrayed as a distinct technology, but initially it was born as an Internet technology (somewhere between HTML and SGML). This article looks at how XML can be used as a "transport protocol" between a database and an end user. The most popular relational database management systems use SQL queries for working with data. Although XML-oriented databases are already on the market, they are not yet ubiquitous. Keeping in mind the popularity of XML, the developers of relational databases are moving forward by adding XML compatibility to their products. This article looks at one such approach: having a database return XML. An Oracle database is used in the sample code, which is supposed to be an XML-compliant database that already has a mechanism for working with XML data.
XML Development with Java 2
Learn how to use Java technology to develop XML-based applications. These two chapters explore advanced XML (including advanced markup techniques) and collections.
XML messaging, Part 2
In this article, the second of three, Dirk Reinshagen introduces SOAP to the XML messaging equation. He begins by describing SOAP and other related technologies, then reinforces with a simple example using SOAP to create an invoice.
XML Processing with TRaX
The TRaX API extends JAXP to include XML transformations, providing a vendor- and implementation-agnostic standard Java API for specifying and executing XML transformations.
XML programming in Java technology, Part 1
This updated tutorial covers the basics of manipulating XML documents using Java technology. It looks at the common APIs for XML and discusses how to parse, create, manipulate, and transform XML documents.
XML: Mastering Information on the Web
This is first in a series of articles written by Todd Freter of Sun about XML, its promises, and its challenges. Topics addressed in this article include the shortcomings of HTML; XML's goals for the Internet; and some observations on how a transition to XML may occur.
XSL Transformation using Xalan and Java Part I
The author writes a small Java program which uses Xalan and shows us how simple it is to do XML transformation. In this first-part of series articles he explains the problem and helps getting things ready.
XSL Transformation using Xalan and Java Part III
In this third and final part III of the series, we'll closely look at the stylesheet file used to do the conversion. We'll also learn how to convert XML document to HTML document using XSLT.