> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> 
> I'm been looking around on the cocoon site and the mailing list
archive but
> just can't seem to find out how to make cocoon validate xml against a
> schema somewhere on the net. 

>From cocoon.xconf:

----------- 8< -----------
  <xml-parser class="org.apache.avalon.excalibur.xml.JaxpParser"
              logger="core.xml-parser">
  <!-- Parser:
    The default parser used in Apache Cocoon is
    org.apache.avalon.excalibur.xml.JaxpParser. Apache Cocoon requires a

    JAXP 1.1 parser.
    If you have problems because your servlet environment uses its own
    parser not conforming to JAXP 1.1 try using the alternative
    XercesParser instead of the JaxpParser. To activate the
XercesParser,
    change the class attribute to
      class="org.apache.avalon.excalibur.xml.XercesParser"
    You will also need to add a system property to your JVM,
    probably on the startup of your servlet engine like this:
 
-Dorg.apache.avalon.excalibur.xml.Parser=org.apache.avalon.excalibur.xml
.XercesParser

    Configuration for the JaxpParser (not the XercesParser!):
    - validate (boolean, default = false): This parameter causes the
parser 
        to be a validating parser.
        XML validation is only being used for the documentation build.
        (If you are going to use it elsewhere, then do so with caution.)
        You really should have validated all of your XML documents
already,
        according to their proper DTD or schema. Do not expect Cocoon to
do it.
    - namespace-prefixes (boolean, default = false) : do we want
        namespaces declarations also as 'xmlns:' attributes ?
        Note : setting this to true confuses some XSL processors (e.g.
Saxon).
    - stop-on-warning (boolean, default = true) : should the parser
        stop parsing if a warning occurs ?
    - stop-on-recoverable-error (boolean, default = true) : should the
parser
        stop parsing if a recoverable error occurs ?
----------- 8< -----------

... and lots more.


Vadim


> Each XML document would have a different
> schema to validate against as there are 6 categories and the schema is
> already encoded in the XML as
> <metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:noNamespaceSchemaLocation="http://somewhere/metadata.xsd";>
> in the root element.  Any help would be greatly appreciated.
> 
> Thanks,
> -Gerardo


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to