Sun About XML Tutorial

xiaoxiao2021-03-06  96

Working with XML: Table of Contents

Part i: understanding XML and the Java XML API

A Quick Introduction TO XML

What is xml?

Tags and attributes

EMPTY TAGS

Comments in XML Files

The xml protogo

Processing Instructions

Why is xml important?

What can you do with xml?

2. XML and Related Specs: Digesting The Alphabet Soup

W3C Recommendations

SAX

DOM

DTD

RDF

Namespaces

W3c proposed Recommendations

RDF Schema

W3C Working Drafts

XSL

XLL

XLINK

XPointer

XHTML

XML Schema

W3C "Notes"

Schema proposals

DDML / XSChema

DCD

SOX

Other W3C Notes

ICE

Standards That Build on XML

SMIL

Mathml

SVG

Drawml

Ecommerce Standards

CXML

CBL

Software Administration and Maintenance Standards

DMTF

WebDAV

3. An Overview of the Apis

The JAXP APIS

An Overview of Sax and Dom

The Sax Parser

3b. Other Sax Apis

The Document Object Model (DOM)

The Project X Reference Implementation

WHERE do you go from here?

4. Designing an XML Data Structure

Saving yourself some Work

Attributes and Elements

Forced Choices

STYLISTIC Choices

Normalizing DataNormalize DTDS

Part II: Serial Access with the Simple API for XML (SAX)

1. Writing a Simple XML File

Creating the file

Writing the decaration

Add a comment

Defining the root element

Adding Attributes to an Element

Add Nested Elements

Add HTML-Style Text

Adding an Empty Element

The finished product

2A. Echoing an XML File with the SAX Parser

Create the Skeleton

Import the classes we need

Setting Up for I / O

Setting up the Parser

Implementing the documenthandler interface

Writing the Output

Spacing the Output

HANDLING Document Events

Compiableing the program

Running the program

Command Scripts

Checking the Output

Identifying the eventscompressing the output

INSPECTING THE OUTPUT

Documents and Data

2b. Adding Additional Event Handlers

Identifying the document's location

Handling Processing Instructions

Summary

3. Handling Errors with the Nonvalidating Parser

Introducing an Error

Handling a saxparseexception

Handling a SAXException

Improving the saxparseexception handler

Handling a ParserConfigurationException

Handling an oException

Understanding Nonfatal Errors

Handling Nonfatal Errors

Handling Warnings

4. Substituting and Inserting Text

Handling Special Characters

Predefined Entities

Character References

Using an entity reason in an xml document

Handling Text with XML-Style Syntax

Handling cdata and other character character

5A. CREANG A Document Type Definition (DTD)

Basic DTD Definitions

Defining Text and Nested Elements

Limitations of DTDS

Special Element Values ​​in the DTD

Referencing the DTD

5b. DTD's Effect On The Nonvalidating Parser

Tracking Ignorable Whitespace

Cleanup

Documents and Data

EMPTY Elements, Revisited

5c. Defining Attributes and Entities in the DTD

Defining Attributes in the DTD

DEFINING Entities in the DTD

Echoing the entity references

Additional useful enttive

Referencing External Entities

Echoing the external entity

Summarizing enttive

5d. Referencing Binary Entities

USING a MIME DATA TYPE

The Alternative: Using Entity References

6. USING THE VALIDATING PARSER

Configuring the factory

Using An Environment Variable, USING AN ENVIRONMENT VARIABLE

Experimenting with validation errors

Error Handling In The Validating Parser

7a. Defining Parameter Entities and Conditional Sections

Creating and refresing a parameter entity

Conditional Sections

7b. Parsing the parameterized DTD

DTD WARNINGS8. Using a lexicaleventlistener

How the LexicaVentlistener Works

Working with a lexicaleventlistener

Echoing Comments

Echoing Other Lexical Information

9. USING The DTDHANDLER AND EntityResolver

The DTDHandler API

The EnityResolver API

Part III: XML and The Document Object Model (DOM)

GENERATING A DOM from XML Data

Reading an XML Document Into A DOM

Create the Skeleton

Import The Required Classes

Declare the DOM

Handle ErrorS

Instantiate the factory

Get a parser and parse the file

Write out the xml

Use xmldocument

Run the program

AdditionAl Information

Configuring the factory

Handling Validation ErrorS

Looking ahead

2. Generating XML from an Arbitrary Data Structure

HOW it works

Modify The "Parser" to Generate Sax Events

Implement the org.xml.sax.parser Interface

Create a factory

Wire your "parser" to an xmldocumentbuilder

Write it out

Run IT

3a. Displaying a Dom Hierarchy

Echoing Tree Nodes

Convert Domecho to a Gui App

Add Import Statements

Create the GUI Framework

Add The Display Components

Create Adapters to Display THE DOM in a jtree

Define the adapterNode Class

Define The Treemodel Adapter

Finish IT UP

3b. EXAMININININING THE STRUCTURE OF A DOM

Displaying a Simple Tree

Displaying a more complex Tree

Finishing UP

4. Constructing a User-Friendly Jtree From A DOM

Compressing the tree view

Make the Operation Selectable

Identify "Tree" Nodes

Control node visibility

Control Child Access

Check the results

EXTRA CREDIT

Acting on Tree Selects

Identify Node Types

Concatenate Subnodes to Define Element Contents

Display the Content in the JTree

Wire the jtree to the jeditorpane

Run THE APP

EXTRA CREDIT

Handling modifications

Finishing Up5. Creating and manipulating a dom

Obtaining a dom from the factory

Modify the code

Create Element and text Nodes

Run THE APP

Normalizing The Dom

Other Operations

Traversing nodes

Creating Attributes

Removing and changing nodes

Finishing UP

6. USING NAMESPACES

DEFINING a Namespace

Referencing a namespace

Defining a namespace prefix

AdditionAl Information

Java's Encoding Schemes

转载请注明原文地址:https://www.9cbs.com/read-122145.html

New Post(0)