de.frame4j
Class XMLio

java.lang.Object
  extended by de.frame4j.util.App
      extended by de.frame4j.XMLio
All Implemented Interfaces:
AttrSettable, TextHelper.MessageComponents, UIInfo, ActionListener, EventListener, DynamicMBean

@MinDoc(copyright="Copyright 2001 - 2003, 2007, 2009  A. Weinert",
        author="Albrecht Weinert",
        version="V.30",
        lastModified="22.03.2010",
        lastModifiedBy="A. Weinert",
        usage="start as Java application (-? for help)",
        purpose="input [check] [validate] [transform] [and output | list] XML")
public class XMLio
extends App

XML input and output: XML --> DOM --> XML.

This application handles the input and output of XML documents as a DOM object. Multiple variants and combinations are possible:

The application handles the XML document as a object of type org.w3c.dom.Document.

For further pre or post processing by this or other applications objects of this type can be serialised respectively de-serialised by this application. In that sense this application may act as a common parser / reader / writer front respectively back end for any applications that handle / transform DOM objects without bothering of how to get or get rid off.

A .xsl style sheet transformation can be inserted before output.

Hint 1: To this application XMLio belongs (as integral part) a .properties file named XMLio.properties. It's part of the documentation.
See also the hints in the package description.

Hint 2: If the document to be parsed relates to DTDs (document type definitions) given as (web) URLs, like e.g.
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
they will be loaded while parsing.

Besides the possible performance impact, this may require proxy settings. They can comfortably put in a .properties file.


© Copyright 2001 - 2003, 2007   Albrecht Weinert

Version:
30 (22.03.2010)
Author:
Albrecht Weinert
See Also:
App, Input, XMLconf, SAXdemo

Field Summary
 String dest
          The destination file's name or the denotation of a destination directory.
 boolean parse
          Do a XML parsing instead of de-serialising.
 boolean serialise
          Serialise the DOM object on output instead of outputting XML text.
 String source
          The source file's name or the source URL denomination.
 int structList
          List the DOM object's structure.
 String trans
          An XSL transformation file's name or URL.
 
Fields inherited from class de.frame4j.util.App
ano, appBase, appIO, appStartTime, args, bgColor, err, fullClassName, help, icon, INIT_ERROR, jmxRemoteNote, JOB_DONE_OK, log, LOG_OUT_ERROR, MAIN_THREAD_EXC, mainThread, myClass, myFrame, name, NO_PARS_ERROR, objectName, out, outMode, packName, prop, retCode, runFlag, shortClassName, title, verbose, verbosity
 
Fields inherited from interface de.frame4j.net.AttrSettable
ILLEGAL_TYPE, ILLEGAL_VALUE, NO_ATTRIBUTE, NO_KNOWN_ATTRIBUTE, NO_VALUE, OK
 
Constructor Summary
XMLio()
           
 
Method Summary
 int doIt()
          Working method of XMLio.
static void main(String[] args)
          Start method of XMLio.
 
Methods inherited from class de.frame4j.util.App
actionPerformed, allowNoPropertiesFile, clientOrder, condHelpLog, connect, errMeld, errMeld, errorExit, errorExit, errorExit, errorText, formMessage, formMessage, getAbout, getAboutText, getActTime, getAppLogger, getAppStartTime, getArgs, getAttribute, getAttributes, getAuthor, getCopyright, getDbLogger, getExecTimeMs, getExecTimeString, getHelp, getHelpText, getIcon, getLanguage, getLogHandler, getMBeanInfo, getMessageComponent, getMessageComponentsLength, getMyFrame, getName, getNameWithVersDate, getOutMode, getProp, getPurpose, getStartTime, getStateString, getTitle, getUsage, getVerbosity, getVerbosityString, getVersDate, getXMLinput, go, go, go, haveIcon, invoke, isDebug, isHelp, isHelpLog, isNormal, isRunFlag, isSilent, isTest, isVerbose, logVerbose, logVerbose, makeDbLogger, makeMenuBar, makeMenuBar, makeStatusTextEnd, makeStatusTextStart, messageFormat, normalExit, parsePartial, performeAction, postDeregister, postRegister, preRegister, queueAction, registerAsMBean, setAboutText, setAttribute, setAttribute, setAttribute, setAttributes, setAuthor, setBgColor, setCodePages, setCopyright, setHelp, setJmxRemoteNote, setLogOut2, setName, setOutMode, setOutMode, setPurpose, setTitle, setUsage, setVerbose, setVerbose, setVerbosity, setVerbosity, setVerbosityString, setVersDate, stop, threeLineEndMsg, toString, twoLineEndMsg, twoLineStartMsg, valueLang, valueLang, wakeMainThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

source

public String source
The source file's name or the source URL denomination.

The content must either be parsable XML text or a serialised DOM depending on start options.

Default: null (means normal input; as keyboard it makes usually no sense.)


dest

public String dest
The destination file's name or the denotation of a destination directory.

dest may be a file or a directory. A directory makes sense only if source denotes an input file. In that case name.ser respectively name.out is taken as output file name in the destination directory.

Default: null; null means normal output (usually makes no sense)


trans

public String trans
An XSL transformation file's name or URL.

This names a eXtensible StyLe sheet responsible for transforming the document prior to output.

Default: null; null means no style sheet transformation


parse

public boolean parse
Do a XML parsing instead of de-serialising.

true is the normal case and the default.


serialise

public boolean serialise
Serialise the DOM object on output instead of outputting XML text.

If true the DOM object is output without formatting and transformations. That is as well a XML text.

Default: true


structList

public int structList
List the DOM object's structure.

If > 0 the DOM's structure will be listed on output down to the tree depth / recursion level indicated by structList's value.

Has precedence before serialise.

Default: 0

Constructor Detail

XMLio

public XMLio()
Method Detail

main

public static void main(String[] args)
Start method of XMLio.

Execute : Java XMLio [options] source dest

Exit code 0: All OK no errors or warnings
Exit code 1: Warnings or non fatal errors occurred; the result may nevertheless be usable
Exit code 2 or higher: Fatal errors occurred or application or I/O failure

Parameters:
args - command line parameter

doIt

public int doIt()
Working method of XMLio.

Specified by:
doIt in class App
See Also:
main(String[]), App.go(java.lang.String[], java.lang.String, boolean, java.lang.CharSequence)