You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by S Page <sp...@macromedia.com> on 2001/05/04 05:49:45 UTC

validating input XML document in Xalan-J (and minor doc bug)

I'm using Xalan-J 2.0.1 on the command line to transform XML documents.

Works great!  You folks are awesome!  But Xalan-J's command-line interface doesn't validate the input XML document against the DTD in its DOCTYPE.  Garbage In, Garbage Out :(


Doc Bug: http://xml.apache.org/xalan-j/getstarted.html claims that you can you can use the -validate option on the command line.  But you get "Invalid option" if you do.  I see that src/org/apache/xalan/xslt/Process.java has a -VALIDATE option, but it's commented out.

It appears that under the covers, Xalan-J uses xerces.jar Ver_1_3_0.  Xerces does have the capability to validate against the DTD and report errors ( http://xml.apache.org/xerces-j/faq-general.html#faq-6 ) , so I assume there's some way Xalan-J can enable this feature.

*  Does anyone have Java code similar to Process that validates, or the source/properties modifications necessary to turn it on?

*  Otherwise, what's the simplest way to validate a document before invoking  org.apache.xalan.xslt.Process?  I don't see a simple command-line validator in http://xml.apache.org/xerces-j/



Thanks indeed.

--
=S Page  a www.macromedia.com site engineer

  "I'm trying to ban e-mail attachments.  I just want an ASCII e-mail.
  If you want to show me something, put it in a Web page, publish it,
  give me the URL, and I'll look at it.  That's the new model."
  Scott McNealy, CEO of Sun Microsystems, in May 1997 Upside magazine.