Re: Trying to validate a sample xml file against a schema I am de velo ping.

Finally!  I got it working!  Thanks to Henry.
What I was missing before is that python only uses PYTHONSTARTUP 
in interactive mode.  I was using PYTHONSTARTUP to set the sys.path.
So it worked in interactive mode.  But when I named the applyschema.py
on the python command the path was not getting set.  Now depending
only on PYTHONPATH and a fair amount of twiddling with '/' vs '\'
vs '\\' (yuck!) I have gotten it to work! 

So now I have a shell script called xsv that reads:
- - - - 
export PYTHONPATH="C:\Program Files\HCRC LTG\LT XML\Python\lib;C:\sasmkb\xml\xmlschema" 
python "C:\sasmkb\xml\xmlschema\applyschema.py" $1 $2
- - - -
If the xml file names the schema with a xsi:noNamespaceSchemaLocation=
in the root element then I only need to specify the xml file on the xsv command
like this:

xsv  tiny2000.xml 

otherwise I have to name both:

xsv tiny2000.xml tiny2000.xsd


Now, I have a simple way to test xml and xsd files. 
So it is back about to schema design! Hooray.

On Wednesday, October 18, 2000, at 09:30 AM, Michael Burns wrote:

>  
> On Wednesday, October 18, 2000, at 02:52 AM, Henry S. Thompson wrote: 
>  
> > 1) use  
> >   
> > > set PYTHONPATH="..."  
> > > python applyschema.py ...  
> >   
> > to get XSV running from the command line.  See instructions in [1].  
>  
> I don't understand this reply.   
> I don't have a problem with python, it runs fine.  PYTHONPATH tells 
> python where it's parts are I believe.  The problem I am having is 
> when applyschema.py tries to find PyLTXML.  Python itself without 
> applyschema.py in the picture has no problem.  PyLTXML is on the 
> sys.path, but applyschema.py can't find it for some reason.  
>  
> >   
> > 2) the 'validation not attempted' means you hit a very early crash:  
> > is your input file (triv.xml) well-formed XML?  
>  
> It's not really my file, it is the one that is in the xmlschema  
> cvs source project.   I assumed that it was a sample that was intended 
> to be used to test out the install and setup of applyschema.py. 
> The DOM Parser does not have a problem with it unless I turn on schema 
> validation.  I get the same result no matter what xml file I try. 
>  
> >   
> > ht  
> > --   
> >   Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh  
> >           W3C Fellow 1999--2001, part-time member of W3C Team  
> >      2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440  
> > 	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk  
> > 		     URL: http://www.ltg.ed.ac.uk/~ht/  
> >   
> >   
>  
> ------------------------------------------------------------------------ 
> Michael Burns                        email: Michael.Burns@sas.com 
> Principal Systems Developer           home: mburns@bga.com  
> Metadata Integration Technology      voice: (512)258-5171x3264 
> SAS Institute, Inc.                    fax: (512)258-3906 
> 11920 Wilson Parke Ave.                www: http://www.realtime.net/~mburns 
> Austin, TX 78726-4052                  sww: http://sww.sas.com/~sasmkb 
> "choose for yourselves today whom you will serve;... 
>  but as for me and my house, we will serve the Lord." Joshua 24:15 
>  
>  

------------------------------------------------------------------------
Michael Burns                        email: Michael.Burns@sas.com
Principal Systems Developer           home: mburns@bga.com 
Metadata Integration Technology      voice: (512)258-5171x3264
SAS Institute, Inc.                    fax: (512)258-3906
11920 Wilson Parke Ave.                www: http://www.realtime.net/~mburns
Austin, TX 78726-4052                  sww: http://sww.sas.com/~sasmkb
"choose for yourselves today whom you will serve;...
 but as for me and my house, we will serve the Lord." Joshua 24:15

Received on Wednesday, 18 October 2000 18:30:47 UTC