- From: Hussein Suleman <hussein@vt.edu>
- Date: Sat, 31 Mar 2001 16:40:25 -0800
- To: xmlschema-dev@w3.org
- Cc: hussein@vt.edu
- Message-id: <3AC678F9.FB7789A8@vt.edu>
hi ive been trying to get XSV installed locally and have had no luck so far ... i have the previous version (for the candidate recommendation) installed and working but this one gives no joy the problem appears to be that the program cannot find the schema location corresponding to a namespace ... which is weird since it worked before and the online version works ok ... so, i altered the XMLSchema.py file to hard-code the XMLSchema.xsd schema in case that was the only problem and after that the schema i was writing validated just fine ... however, when i tested my XML file, it once again tried to load a schema from the namespace instead of the URI ... i was using a simple "applyschema" command-line interface but then i switched to using a full "runItandShow" call (no im not a python programmer but i think i got it right) and still it doesnt find the schema file properly ... i have no more ideas ... any help will be most appreciated ... i have attached a file containing in order: - the error when trying to validate a schema - ... followed by the error when trying to validate an instance file - the modification i made to XMLSchema.py - the subsequent successful validation of the schema - ... followed by an error in validating an instance - the contents of the simple shell script i used - and the more complete python script which gave the same results thanx, hussein -- ======================================================================== hussein suleman -- hussein@vt.edu -- vtcs -- http://purl.org/net/hussein ========================================================================
~/test/ims > $ xsv http://oai.dlib.vt.edu/OAI/oai_ims.xsd 2>&1 | head -15 <?xml version='1.0' encoding='unspecified-ascii-superset'?> <xsv docElt='{http://www.w3.org/2001/XMLSchema}schema' instanceAssessed='true' instanceErrors='0' nsURI Deref='success' schemaErrors='0' schemaLocs='' target='http://oai.dlib.vt.edu/OAI/oai_ims.xsd' validati on='lax' version='XSV 1.179/1.88 of 2001/03/17 12:11:13' xmlns='http://www.w3.org/2000/05/xsv'> <importAttempt URI='http://www.w3.org/2001/XMLSchema' namespace='http://www.w3.org/2001/XMLSchema' outc ome='failure'/> <notASchema filename='http://www.w3.org/2001/XMLSchema'/> <XMLMessages> Warning: 0x192 is not a valid 8-bit XML character; ignored in entity "xhtml-symbol" at line 34 char 26 of http://www.w3.org/2001/rddl/xhtml-symbol.ent in entity "xhtml-charent.mod" at line 35 char 15 of http://www.w3.org/2001/rddl/xhtml-charent-1.mod in entity "xhtml-framework.mod" at line 96 char 20 of http://www.w3.org/2001/rddl/xhtml-framework-1.mo d in unnamed entity at line 126 char 22 of http://www.w3.org/2001/rddl/rddl-xhtml.dtd Warning: 0x391 is not a valid 8-bit XML character; ignored in entity "xhtml-symbol" at line 38 char 26 of http://www.w3.org/2001/rddl/xhtml-symbol.ent in entity "xhtml-charent.mod" at line 35 char 15 of http://www.w3.org/2001/rddl/xhtml-charent-1.mod in entity "xhtml-framework.mod" at line 96 char 20 of http://www.w3.org/2001/rddl/xhtml-framework-1.mo d in unnamed entity at line 126 char 22 of http://www.w3.org/2001/rddl/rddl-xhtml.dtd ~/test/ims > $ xsv oai_ims.xml 2>&1 | head -15 <?xml version='1.0' encoding='unspecified-ascii-superset'?> <xsv docElt='{http://oai.dlib.vt.edu/metadata/oai_ims}oai_ims' instanceAssessed='true' instanceErrors=' 0' nsURIDeref='success' schemaErrors='0' schemaLocs='http://oai.dlib.vt.edu/metadata/oai_ims -> http:// oai.dlib.vt.edu/OAI/oai_ims.xsd' target='/home/hussein/test/ims/oai_ims.xml' validation='lax' version=' XSV 1.179/1.88 of 2001/03/17 12:11:13' xmlns='http://www.w3.org/2000/05/xsv'> <importAttempt URI='http://oai.dlib.vt.edu/OAI/oai_ims.xsd' namespace='http://oai.dlib.vt.edu/metadata/ oai_ims' outcome='failure'/> <notASchema filename='http://oai.dlib.vt.edu/OAI/oai_ims.xsd'/> <importAttempt URI='http://oai.dlib.vt.edu/metadata/oai_ims' namespace='http://oai.dlib.vt.edu/metadata /oai_ims' outcome='failure'/> <notASchema filename='http://oai.dlib.vt.edu/metadata/oai_ims'/> <XMLMessages> Warning: Root element name schema not declared (detected at end of prolog of document http://oai.dlib.vt.edu/OAI/oai_ims.xsd) Warning: Start tag for undeclared element schema in unnamed entity at line 8 char 8 of http://oai.dlib.vt.edu/OAI/oai_ims.xsd Warning: Undeclared attribute targetNamespace for element schema in unnamed entity at line 10 char 19 of http://oai.dlib.vt.edu/OAI/oai_ims.xsd Warning: Undeclared attribute elementFormDefault for element schema in unnamed entity at line 12 char 22 of http://oai.dlib.vt.edu/OAI/oai_ims.xsd # modification to find XMLSchema URL - line 2776 of XMLSchema.py [Hussein Suleman 2000-03-30] if fullLoc=='http://www.w3.org/2001/XMLSchema': fullLoc='http://www.w3.org/2001/XMLSchema.xsd' ~/test/ims > $ xsv http://oai.dlib.vt.edu/OAI/oai_ims.xsd <?xml version='1.0' encoding='unspecified-ascii-superset'?> <xsv docElt='{http://www.w3.org/2001/XMLSchema}schema' instanceAssessed='true' instanceErrors='0' nsURIDeref='success' rootType='[Anonymous]' schemaErrors='0' schemaLocs='' target='http://oai.dlib.vt.edu/OAI/oai_ims.xsd' validation='stri ct' version='XSV 1.179/1.88 of 2001/03/17 12:11:13' xmlns='http://www.w3.org/20 00/05/xsv'> <importAttempt URI='http://www.w3.org/2001/XMLSchema.xsd' namespace='http://www .w3.org/2001/XMLSchema' outcome='success'/> <importAttempt URI='http://www.w3.org/2001/xml.xsd' namespace='http://www.w3.or g/XML/1998/namespace' outcome='success'/> </xsv> ~/test/ims > $ xsv oai_ims.xml <?xml version='1.0' encoding='unspecified-ascii-superset'?> <xsv docElt='{http://oai.dlib.vt.edu/metadata/oai_ims}oai_ims' instanceAssessed ='true' instanceErrors='0' nsURIDeref='success' schemaErrors='0' schemaLocs='ht tp://oai.dlib.vt.edu/metadata/oai_ims -> http://oai.dlib.vt.edu/OAI/oai_ims.xsd ' target='/home/hussein/test/ims/oai_ims.xml' validation='lax' version='XSV 1.1 79/1.88 of 2001/03/17 12:11:13' xmlns='http://www.w3.org/2000/05/xsv'> <importAttempt URI='http://oai.dlib.vt.edu/OAI/oai_ims.xsd' namespace='http://o ai.dlib.vt.edu/metadata/oai_ims' outcome='failure'/> <notASchema filename='http://oai.dlib.vt.edu/OAI/oai_ims.xsd'/> <importAttempt URI='http://oai.dlib.vt.edu/metadata/oai_ims' namespace='http:// oai.dlib.vt.edu/metadata/oai_ims' outcome='failure'/> <notASchema filename='http://oai.dlib.vt.edu/metadata/oai_ims'/> <XMLMessages> Warning: Root element name schema not declared (detected at end of prolog of document http://oai.dlib.vt.edu/OAI/oai_ims.xsd) Warning: Start tag for undeclared element schema in unnamed entity at line 8 char 8 of http://oai.dlib.vt.edu/OAI/oai_ims.xsd Warning: Undeclared attribute targetNamespace for element schema in unnamed entity at line 10 char 19 of http://oai.dlib.vt.edu/OAI/oai_ims.xsd Warning: Undeclared attribute elementFormDefault for element schema in unnamed entity at line 12 char 22 of http://oai.dlib.vt.edu/OAI/oai_ims.xsd Warning: Undeclared attribute attributeFormDefault for element schema in unnamed entity at line 13 char 24 of http://oai.dlib.vt.edu/OAI/oai_ims.xsd Error: can't retrieve "http://oai.dlib.vt.edu/metadata/oai_ims": 404 Not Found </XMLMessages> </xsv> Contents of "xsv": #!/bin/sh /usr/bin/python /usr/local/xsv_pr/applyschema.py $1 $2 $3 $4 $5 $6 $7 $8 $9 Contents of "xsv2": #!/usr/bin/python import string import urllib import applyschema ss=None dontWarn=1 keep='off' outFile=None addrs='http://oai.dlib.vt.edu/OAI/oai_ims.xsd' args=string.split(addrs) target=args[0] schemas=args[1:] uhandle=urllib.urlopen(target) info=uhandle.info() fileInfo={'realName':uhandle.geturl()} for n,k in (('modDate','Last-Modified'), ('size','Content-Length'), ('server','Server')): if info.has_key(k): fileInfo[n]=info[k] applyschema.runitAndShow(target, schemas, keep=='on', ss, fileInfo, outFile, dontWarn)
Received on Saturday, 31 March 2001 16:36:54 UTC