Apr 19, 2008

XML programming in Java technology, Part 2

In an earlier tutorial ("XML programming in Java technology, Part 1"), I showed you the basics of XML parsing in the Java language. I covered the major APIs (DOM, SAX, and JDOM), and went through a number of examples that demonstrated the basic tasks common to most XML applications. This tutorial will look at more difficult things that weren't covered before, such as:
• Getting and setting parser features
• Working with namespaces
• Validating XML documents

As in the introductory tutorial, the APIs I'll cover are:
• The Document Object Model (DOM), Levels 1, 2, and 3
• The Simple API for XML (SAX), Version 2.0
• JDOM, a simple Java API created by Jason Hunter and Brett McLaughlin
• The Java API for XML Processing (JAXP)

I'll also cover several approaches to validation, including W3C XML Schema, RELAX
NG, and Schematron.

About the examples
Most of the examples here will work with the Shakespearean sonnet that appeared in the last tutorial. The structure of this sonnet is:









[14 elements]




In the various sample programs, some versions of this document will have namespaces, and some will use DTDs, W3C XML Schemas, or other schema languages for validation. For the complete examples, see the following files:
• sonnet.xml
• sonnet.dtd (download to view in a text editor)
sonnetNamespaces.xml
sonnet.xsd
sonnetSchema.xml
sonnet.rng
sonnetRules.xsl
sonnetSchematron.xml
As an alternative, download x-java2_code_files.zip to view these files in a text editor.

Download this tutorial

XML programming in Java technology, Part 1

About this tutorial

Over the last few years, XML has become a universal data format. In this updated tutorial, I'll show you the most common programming interfaces for working with XML documents in the Java language. The most common XML processing task is parsing an XML document. Parsing involves reading an XML document to determine its structure and contents. One of the pleasures of XML programming is the availability of open-source, no-cost XML parsers that read XML documents for you. This tutorial focuses on creating parser objects, asking those parsers to process XML files, and handling the results. As you might expect, you can do these common tasks in several different ways; I'll examine the standards involved as well as when you should use one approach or another.

Programming interfaces
A number of programming interfaces have been created to simplify writing Java programs that process XML. These interfaces have been defined by companies, by standards bodies, and by user groups to meet the needs of XML programmers. In this tutorial, I'll cover the following interfaces:
• The Document Object Model (DOM), Level 2
• The Simple API for XML (SAX), Version 2.0
• JDOM, a simple Java API created by Jason Hunter and Brett McLaughlin
• The Java API for XML Processing (JAXP)

The first three of these four interfaces (DOM, SAX, and JDOM) define how the
contents of an XML document are accessed and represented. JAXP contains classes for creating parser objects. To create DOM or SAX parsers, you'll use JAXP. When you use JDOM, the JDOM library uses JAXP under the covers to create a parser. To sum it all up:
• You use DOM, SAX, or JDOM to work with the contents of an XML document.
• If you use DOM or SAX, you use JAXP to create a parser.
• If you use JDOM, the JDOM library creates a parser for you.

I'll explore the design goals, strengths, and weaknesses of each of these APIs, along
with a bit of their histories and the standards bodies that created them.

Download this tutorial

XQuery Java API (tutorial)

This API provides the methods for compiling and executing XQuery/XPath scripts from Java and exploiting the results. This is very similar to using the SQL language through a Java interface like JDBC.
Using XQuest's implementation of XQuery provides a high-level query language and extended processing capabilities. It is therefore advisable to implement the largest possible part of an application with XQuery, and use Java only for retrieving final results. This is especially true when connecting to a remote server, because such an approach will likely minimize the network traffic.
The API is actually used in the GUI and Command-line Interface applications provided with XQuest, as well as in the "Server Pages" extension, which embeds the XQuery engine in a Servlet.

The API allows:
• Creation and setup of a compilation and execution environment (which implements both the static context and dynamic context defined in the XQuery Specifications). These environments are basically provided by an interface named XQueryConnection Creation of Expressions from a XQueryConnection (interfaces XQueryExpression and XQueryPreparedExpression ). Such expressions are similar to Statements found in database connectivity interfaces like JDBC. Expressions receive a Query (i.e. a XQuery script) which is compiled and then executed once or several times.

An Expression is itself a context which inherits the environment provided by the connection, and can then be set up individually before execution. In particular, it is possible to bind global variables of the XQuery expressions to initial values.

• Exploitation of results of Expression evaluations.

The result sets are iterators, since the XQuery/XPath2 language can generally return se- quences of Items. Items are either atomic values (such as numbers or strings), or Nodes, which describe the structure of XML documents and data. The properties and relationships of Nodes are de- scribed in a section of the XQuery/XPath2/XSLT2 specifications which is called the Data Model. A section of the present document is dedicated to the Data Model interfaces, which handle Nodes.

For calling Java methods from within XQuery expressions, see the Java Binding section of the XQuery Extensions documentation.
For dealing specifically with XML databases (XML Libraries), see the XML Library API


Download

cod4 private server tutorial

This is a step by step tutorial how to export models from Maya to Call of Duty 4 – Modern
Warfare. After installing the Maya Export Tools, that are included in the Mod Tools 1.0
released by Infinity Ward, you are able to add custom models to your custom maps.
How to install the exporter to Maya, please read the iWiki from Infinity Ward. The Exporter
tools are available for Maya 7 to 8.5.
http://www.infinityward.com/wiki/index.php?title=Maya

1. Setting up
1. Setup Z UP
2. Check your Scaling
3. Setup a reference scale object
4. Setup the right scale
5. Setup the shader name
6. Setup the vertex color
2. Exporting
1. Setup and Export
3. Asset Manager Setup and Convert
1. Setting up the Material
2. Setting up the Model
3. Saving the gdt file and convert
4. Importing in Radiant

Download

Troubleshooting Guide for Java

This document helps in troubleshooting problems that might occur with applications that use the desktop technologies in the SunMicrosystems Inc. release of JavaTM Platform, Standard EditionDevelopment Kit 6 (JDKTM 6 release or Java SE 6 release). Most of the information in this guide also applies to the Java SE 5 release (also known as Java 2 SE 1.5 or 5.0). Information that applies only to Java SE 6 is indicated accordingly. For help in troubleshooting possible problems between the application and the JavaHotSpotTM virtual machine, see the Troubleshooting Guide for Java SE 6 withHotSpotVMor the Java 2 SE 5.0 Troubleshooting and Diagnostic Guide.

Who ShouldUseThis Guide
The target audience for this document comprises developers who are working with the desktop technologies in Java SE 5 or 6, as well as support or administration personnel who maintain applications that are deployed with Java SE 5 or 6. This document is intended for readers with a detailed understanding of the desktop technologies, a high-level understanding of the components of the Java VirtualMachine, as well as some understanding of concepts such as garbage collection, threads, native libraries, and so on. In addition, it is assumed that the reader is reasonably proficient on the operating system where the Java SE application is installed.

HowThis Guide Is Organized
The first chapter of this guide introduces the desktop technologies, presents some general troubleshooting information and guidelines, and introduces some troubleshooting tools. Further chapters suggest procedures to try when you encounter problems with some of the desktop technologies, namely, AWT, Java 2D, Swing, Internationalization, Java Sound, and Java Plug-in.More desktop technologies will be gradually added to this guide. The last chapter provides suggestions on what to try before submitting a bug report, guidance on how to submit a report, and suggestions on what data to collect for the report. Finally, there is an appendix for each of the following reference areas: Java 2D properties, and details about the format of the fatal error report.


Download