• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Xerces from the command line

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have just started learning XML and have the following queries:-
1)
I have learnt how to run Xerces from the DOS command line by typing:
java sax.SAXCount file.xml
which seems to check for well-formedness but does not seem to check for validity. Is this correct?
More importantly though, I have tried to search for a list of Xerces commands to use at the DOS command line to no avail.
2)
I did read on one web-page to use the following for validation parsing:
java sax.SAXCount -v file.xml
but again I'm not sure if it correct.
3)
Does anyone know where I can get a full list of commands?
4)
When you download Xalan, it includes Xerces (does it?) Is there are list of commands for Xalan and Xerces which are similar in function to using Microsofts MSXSL
5)
Also can someone tell me if there are any good books are websites covering the specific usage of Xalan and Xerces
Thanks

Thanks,
 
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That should be
java sax.Counter
(not java.sax.SAXCount).
If you just type the above command, without any other command line arguments, you'll get a small help file. Use -v to validate against the DTD specified in the DOCTYPE (if there is one).
For more documentation on Xerces, see
http://xml.apache.org/xerces2-j/index.html
and in particular
http://xml.apache.org/xerces2-j/samples.html
For Xalan, see
http://xml.apache.org/xalan-j/index.html
and in particular
http://xml.apache.org/xalan-j/commandline.html

For documentation on Xalan, see
 
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>Also can someone tell me if there are any good books . . .
I'm very happy with the O'Reilly book "Java and XML". It's quite good.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Con,
How do I get started with Xerces? I am having a hard
time looking for XML parser class in Xerces. Which class do I instantiate to get Xerces XML parser?
I would appreciate your help.
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by suheel hussain:
Con,
How do I get started with Xerces? I am having a hard
time looking for XML parser class in Xerces. Which class do I instantiate to get Xerces XML parser?
I would appreciate your help.


Some thing like this
import org.apache.xerces.*;
import javax.xml.parsers.SAXParser;
....
.
.
org.apache.xerces.jaxp.SAXParserFactoryImpl factory = new org.apache.xerces.jaxp.SAXParserFactoryImpl();
//set namespace,schema propeerties here
SAXParser saxParser = factory.newSAXParser();
And may be this tutorial will help you,
understanding DOm and understanding sax
 
suheel hussain
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic