To run DOMWriter:
- open up a MS-DOS command line window
- set the path to the jdk\bin directory
- change directory to the latest xerces-1_4_4 directory
- invoke the
DOMWriter
sample
On Windows:
The easiest way to do this is to create a .bat file using the
Notepad editor. Then the DOMWriter
can be invoked by double clicking
on the file name or icon. The following command lines assume that
both the jdk and the xerces-1_4_4 directories are located directly below
the c: dirve.
| | |
| set PATH=%PATH%;c:\jdk1.1.8\bin
set CLASSPATH=%CLASSPATH%;c:\xerces-1_4_4\xerces.jar;c:\xerces-1_4_4\xercesSamples.jar
cd c:\xerces-1_4_4
java dom.DOMWriter data/personal.xml | |
| | |
Switches:
DOMCount also allows you to change the default behavior via the
following command line flags (type this in as one long command line):
- -p Specify the parser class to be used.
The available parsers are:
- dom.wrappers.DOMParser [default parser]
- -h Print DOMWriter help information. [default is no help]
- -c Output in canonical format. [default is normal format]
- -e encodingName Output using the specified encoding. [default is UTF8]
Running DOMWriter
with the default settings is equivalent to running
DOMWriter
like this:
| | |
| java dom.DOMWriter -p dom.wrappers.DOMParser
data/personal.xml | |
| | |
Bringing up the help information:
Searching for elements:
| | |
| java dom.DOMWriter -c data/personal.xml | |
| | |
Running DOMWriter with the -e switch and no encoding specified
will print out a list of valid encoding names:
Prints the following:
| | |
| Java Encoding one of (case sensitive):
Default
8859_1 8859_2 8859_3 8859_4 8859_5 8859_6 8859_7
8859_8 8859_9 Cp037 Cp273 Cp277 Cp278 Cp280
Cp284 Cp285 Cp297 Cp420 Cp424 Cp437 Cp500
Cp737 Cp775 Cp838 Cp850 Cp852 Cp855 Cp856
Cp857 Cp860 Cp861 Cp862 Cp863 Cp864 Cp865
Cp866 Cp868 Cp869 Cp870 Cp871 Cp874 Cp875
Cp918 Cp921 Cp922 Cp930 Cp933 Cp935 Cp937
Cp939 Cp942 Cp948 Cp949 Cp950 Cp964 Cp970
Cp1006 Cp1025 Cp1026 Cp1046 Cp1097 Cp1098 Cp1112
Cp1122 Cp1123 Cp1124 Cp1250 Cp1251 Cp1252 Cp1253
Cp1254 Cp1255 Cp1256 Cp1257 Cp1258 Cp1381 Cp1383
Cp33722 MS874 DBCS_ASCII DBCS_EBCDIC EUC EUCJIS GB2312
GBK ISO2022CN_CNS ISO2022CN_GB JIS JIS0208 KOI8_R KSC5601
MS874 SJIS SingleByte Big5 CNS11643 MacArabic
MacCentralEurope MacCroatian MacCyrillic MacDingbat
MacGreek MacHebrew MacIceland MacRoman MacRomania
MacSymbol MacThai MacTurkish MacUkraine SJIS Unicode
UnicodeBig UnicodeLittle UTF8 | |
| | |
| Parse your own XML file instead of data/personal.xml |