This is the mail archive of the mailing list .

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: xerces and schema(offtopic)

Sadly I'm posting to myself. Here's a solution.
Add the following to the top of the schema file.

<?xml version="1.0"?>
<!DOCTYPE xsd:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN"
  ""; [
  <!ENTITY % p 'xsd:'><!-- overriden, default namespace is xs --> 
  <!ENTITY % s ':xsd'> 

<xsd:schema xmlns:xsd="";>


$ po.xsd -v
po.xsd: 2864 ms (37 elems, 61 attrs, 1061 spaces, 145 chars)

This will validate. BTW is just a shell script that add
xerces.jar and xercesSamples.jar to the classpath and calls java
sax.SAXCount. Other ideas welcome.


Eric Richardson wrote:
> Hi,
> I was trying to parse the po.xsd from
> I'm using xerses1.4.1 for
> java.
> usage: java sax.SAXCount (options) uri ...
> options:
>   -p name  Specify SAX parser by name.
>   -n | -N  Turn on/off namespace [default=on]
>   -v | -V  Turn on/off validation [default=off]
>   -s | -S  Turn on/off Schema support [default=on]
>   -f | -F  Turn on/off Schema full consraint checking  [default=off]
>   -d | -D  Turn on/off deferred DOM [default=on]
>   -l | -L  Turn on/off external DTD loading [default=on]
>   -w       Warmup the parser before timing.
>   -h       This help screen.
> Here is the command I'm using.
> $ java sax.SAXCount po.xsd -v
> [Error] purchase-order.xsd:2:58: General Schema Error: Grammar with uri
> 2: , can not be found.
> [Error] po.xsd:2:58: Element type "xsd:schema" must be declared.
> ......
> Does anybody know what the correct url is for the following?
> <xsd:schema xmlns:xsd="";>
> Or am I totally in left field and you can't validate an XML file that
> contains schema?
> Eric

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]