Re: xsv trouble on linux and triv.xsd: can't find address for host "foo" in http URL "http://foo/"

Thanks for your answer, my comments below.

Jeni Tennison <jeni@jenitennison.com> writes:

> Hi Simon,
>
>> I'm trying to get XSV (CVS HEAD) to work under linux, but it is
>> giving me some problems. Running it on triv.xml + triv.xsd yields:
>>
>> [sjosefsson@sjosefsson-pc xmlschema]$ python ./applyschema.py triv.xml triv.xsd
>> <?xml version='1.0'?>
>> <xsv docElt='{http://foo}root' instanceAssessed='true' instanceErrors='1' schemaDocs='triv.xsd' schemaErrors='0' schemaLocs='http://foo -> triv.xsd' target='/home/sjosefsson/src/xmlschema/triv.xml'
>> validation='lax' version='XSV 1.205/1.109 of 2001/10/03 21:06:42' xmlns='http://www.w3.org/2000/05/xsv'>
>> <schemaDocAttempt URI='/home/sjosefsson/src/xmlschema/triv.xsd' outcome='failure' source='command line'/>
>> <notASchema filename='/home/sjosefsson/src/xmlschema/triv.xsd'/>
>> <schemaDocAttempt URI='/home/sjosefsson/src/xmlschema/triv.xsd' namespace='http://foo' outcome='failure' source='schemaLoc'/>
>> <notASchema filename='/home/sjosefsson/src/xmlschema/triv.xsd'/>
>> <schemaDocAttempt URI='http://foo/' namespace='http://foo' outcome='failure' source='docElt'>
>> <notASchema filename='http://foo/'>couldn't open</notASchema>
>> </schemaDocAttempt>
>> <invalid char='5' code='cvc-elt.1.1' line='9' resource='file:///home/sjosefsson/src/xmlschema/triv.xml'>xsi:nil 
>> specified on non-nillable element e2</invalid>
>> <XMLMessages>
>> Error: can't find address for host "foo" in http URL "http://foo/"
>> </XMLMessages>
>> </xsv>
>
> If you look at the first couple of schemaDocAttempts, it looks as
> though XSV is having problems opening triv.xsd. It only tries to find
> a schema at http://foo/ because it can't use the schema that you've
> provided at triv.xsd.
>
> So my guess would be that there's something wrong with triv.xsd.
> Perhaps it's not well formed, or perhaps the XML Schema namespace
> isn't declared properly within it. It's hard to tell without seeing
> the schema, but that's what I'd look at first. Try running XSV on
> triv.xsd with the -i flag so that it checks the schema itself.

triv.xsd is checked into XSV's CVS, I thought it was a simple example
Schema.

>> Even running it on XMLSchema doesn't work:
>>
>> [sjosefsson@sjosefsson-pc xmlschema]$ python ./applyschema.py http://www.w3.org/2001/XMLSchema
>> <?xml version='1.0'?>
>> <xsv docElt='{http://www.w3.org/2001/XMLSchema}schema' instanceAssessed='true' instanceErrors='0' schemaErrors='0' target='http://www.w3.org/2001/XMLSchema' validation='lax' version='XSV
>> 1.205/1.109 of 2001/10/03 21:06:42' xmlns='http://www.w3.org/2000/05/xsv'>
>> <schemaDocAttempt URI='http://www.w3.org/2001/XMLSchema' namespace='http://www.w3.org/2001/XMLSchema' outcome='failure' source='docElt'/>
>> <notASchema filename='http://www.w3.org/2001/XMLSchema'/>
>> </xsv>
>
> That's a different problem. XSV is trying to retrieve the schema for
> schema by guessing that it's at the location specified by the
> namespace URI http://www.w3.org/2001/XMLSchema. There is a RDDL
> document there that refers to the schema for schema, so my guess would
> be that either XSV can't use the RDDL document or it can't open the
> connection to http://www.w3.org/2001/XMLSchema to retrieve the
> document for some reason.

I straced the binary, and it does retrieve the document successfully,
and it seems if it does get a XML Schema document.  It seems as if XSV
indicates in the HTTP headers that it prefers a XML document, if you
look at the URL with a web browser you get a HTML document instead.
But something bad happens when it tries to parse that document.

I tried another minimal schema:

[sjosefsson@sjosefsson-pc xmlschema]$ cat tiny.xsd
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
      targetNamespace="urn:foo">
  <element name="foo" type="string" />
</schema>
[sjosefsson@sjosefsson-pc xmlschema]$ xsv tiny.xsd
<?xml version='1.0'?>
<xsv docElt='{http://www.w3.org/2001/XMLSchema}schema' instanceAssessed='true' instanceErrors='0' schemaErrors='0' target='/home/sjosefsson/src/xmlschema/tiny.xsd' validation='lax' version='XSV 1.205/1.109 of 2001/10/03 21:06:42' xmlns='http://www.w3.org/2000/05/xsv'>
<schemaDocAttempt URI='http://www.w3.org/2001/XMLSchema' namespace='http://www.w3.org/2001/XMLSchema' outcome='failure' source='docElt'/>
<notASchema filename='http://www.w3.org/2001/XMLSchema'/>
</xsv>
[sjosefsson@sjosefsson-pc xmlschema]$ 

Is something wrong with the schema?  Is there a more minimal example?

Has anyone gotten XSV to work on RedHat Linux 7.2?  RPMs?

We have IBM SQC's working, but I'd like to validate instances with XSV
as well.

Received on Tuesday, 12 March 2002 14:07:26 UTC