|
Commons Digester example source code file (core.xml)
The Commons Digester core.xml source code<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd"> <properties> <title>Download Commons Digester <author email="dev@commons.apache.org">Commons Documentation Team </properties> <body> <section name="External Dependencies" id="doc.Depend"> <p>The Digester component Version 2.0 is dependent upon implementations of the following standard libraries:</p> <ul> <li>XML Parser compatible with the JAXP/1.3 specification. Compatible implementations are included in JDKs 1.5 and above.</li> </ul> <p>It is also dependent on a compatible set of <a href="http://commons.apache.org">Apache Commons library components. The recommended dependency set is: </p> <blockquote> <table border="1" cellspacing="2" cellpadding="3"> <tr class="a"> | Digester | +Logging 1.1.1 | +BeanUtils 1.8.3 | </table> </blockquote> <p>It is also possible to use Logging 1.0.x or BeanUtils 1.8.0 instead. </section> <section name="Introduction" id="doc.Intro"> <p>In many application environments that deal with XML-formatted data, it is useful to be able to process an XML document in an "event driven" manner, where particular Java objects are created (or methods of existing objects are invoked) when particular patterns of nested XML elements have been recognized. Developers familiar with the Simple API for XML Parsing (SAX) approach to processing XML documents will recognize that the Digester provides a higher level, more developer-friendly interface to SAX events, because most of the details of navigating the XML element hierarchy are hidden -- allowing the developer to focus on the processing to be performed.</p> <p>In order to use a Digester, the following basic steps are required: <ul> <li>Create a new instance of the <code>org.apache.commons.digester.Digester class. Previously created Digester instances may be safely reused, as long as you have completed any previously requested parse, and you do not try to utilize a particular Digester instance from more than one thread at a time.</li> <li>Set any desired configuration properties that will customize the operation of the Digester when you next initiate a parse operation.</li> <li>Optionally, push any desired initial object(s) onto the Digester's <a href="#doc.Stack">object stack. <li>Register all of the element matching patterns for which you wish to have <a href="#doc.Rules">processing rules fired when this pattern is recognized in an input document. You may register as many rules as you like for any particular pattern. If there is more than one rule for a given pattern, the rules will be executed in the order that they were listed.</li> <li>Call the
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.