- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: 16 Dec 2000 10:45:52 +0000
- To: Marc Horowitz <marc@mit.edu>
- Cc: xmlschema-dev@w3.org
Marc Horowitz <marc@mit.edu> writes: > I'm trying to get XSV to work, and I'm having a lot of trouble. > Environment: Debian Linux, python 1.5. > > I'm using ltxml 1.2, PyLTXML 1.2, and XSV checked out of cvs on 12/13. > > I'm just starting out with XML Schemas, so I may have obvious errors, > but even very simple testcases seem to fail. > > -- tiny.xsd -- > <schema xmlns="http://www.w3.org/2000/10/XMLSchema" > xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" > xmlns:ela="http://www.mit.edu/people/marc/xmlschemas/tiny/1.0" > targetNamespace="http://www.mit.edu/people/marc/xmlschemas/tiny/1.0"> > <element name="foo" type="string" /> > </schema> > -- -- > > -- tiny.xml -- > <tiny:foo xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" > xmlns:tiny="http://www.mit.edu/people/marc/xmlschemas/ela/1.0" /> > -- -- > > When I run applyschema.py, I get: > > % python ./applyschema.py -w ~/xml/tiny.xml ~/xml/tiny.xsd > <?xml version='1.0' encoding='unspecified-ascii-superset'?> > <xsv docElt='{http://www.mit.edu/people/marc/xmlschemas/ela/1.0}foo' instanceAssessed='true' instanceErrors='0' nsURIDeref='success' schemaDocs='/home/marc/xml/tiny.xsd' schemaErrors='0' schemaLocs='' target='/home/marc/xml/tiny.xml' validation='lax' version='XSV 1.173/1.82 of 2000/10/31 16:30:47' xmlns='http://www.w3.org/2000/05/xsv'> > <notASchema filename='/home/marc/xml/tiny.xsd'/> > <importAttempt URI='http://www.mit.edu/people/marc/xmlschemas/ela/1.0' namespace='http://www.mit.edu/people/marc/xmlschemas/ela/1.0' outcome='failure'/> > <notASchema filename='http://www.mit.edu/people/marc/xmlschemas/ela/1.0'/> > <XMLMessages> > Warning: Document has no DTD, validating abandoned > (detected at end of prolog of document file:///home/marc/xml/tiny.xsd) > Error: can't retrieve "http://www.mit.edu/people/marc/xmlschemas/ela/1.0": 404 File Not Found > </XMLMessages> > </xsv> The messages are obscure given the bug, but it's hard to do better. Your schema, provided on the command line, has target namespace http://www.mit.edu/people/marc/xmlschemas/tiny/1.0 ^^^^ Your instance has an explicit namespace http://www.mit.edu/people/marc/xmlschemas/ela/1.0 ^^^ Since the schema does not provide declarations for the document, XSV tries to dereference the namespace URI, resulting in the error message above. Finally, it goes ahead and validates anyway, laxly (i.e. without a type to start with), and reports no further errors. Fix the namespace difference, and I get the following: <xsv docElt='{http://www.mit.edu/people/marc/xmlschemas/tiny/1.0}foo' instanceAssessed='true' instanceErrors='0' rootType='string' schemaDocs='t1.xsd' schemaErrors='0' schemaLocs='' target='/projects/ltg/users/ht/xml/xmlschema/monk/t1.xml' validation='strict' version='XSV 1.173.2.6/1.82 of 2000/10/31 16:30:47' xmlns='http://www.w3.org/2000/05/xsv'/> 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/
Received on Saturday, 16 December 2000 05:45:59 UTC