![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - No, I Don't Want No Namespace! >Thread Next - RE: No, I Don't Want No Namespace! RE: No, I Don't Want No Namespace!To: "'Tyson Tate'" <tytate@-----.-------.--->, <xmlschema-dev@--.---> Date: 11/23/2005 1:17:00 PM Your xsi:schemaLocation looks wrong. The first string should be the namespace URI, that is http://www.xyzcorp.com/Vessel rather than www.xyzcorp.com/Vessel. The second string should be a location URI rather than a Windows filename. I suspect that XMLSpy lets you get away with the incorrect location URI, but is tripping up on the incorrect namespace URI. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: xmlschema-dev-request@w... > [mailto:xmlschema-dev-request@w...] On Behalf Of Tyson Tate > Sent: 21 November 2005 18:11 > To: xmlschema-dev@w... > Subject: No, I Don't Want No Namespace! > > > I'm having something of a cryptic namespace problem and I > simply can't > seem to worm my way out of it. Basically, I've been given XML > files that > I can not modify and I wrote a schema to match them. The xml > files look > something like the following: > > > <?xml version="1.0" encoding="UTF-8"?> > <Vessel xmlns="http://www.xyzcorp.com/Vessel" > xmlns:cdm="http://www.xyzcorp.com/cdmtypes" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="www.xyzcorp.com/Vessel > C:\path\to\schema\Vessel2.xsd"> > <VesselBase> > <TrimStability> > ............ > > > The related schema looks like so: > > > <?xml version="1.0" encoding="UTF-8"?> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:cdm="http://www.xyzcorp.com/ctypes" > xmlns="http://www.xyzcorp.com/Vessel" > targetNamespace="http://www.xyzcorp.com/Vessel" > elementFormDefault="unqualified" attributeFormDefault="unqualified"> > <xs:import namespace="http://www.xyzcorp.com/ctypes" > schemaLocation="ctypes.xsd"/> > <xs:element name="Vessel" type="VesselType"> > </xs:element> > <xs:complexType name="VesselType"> > <xs:sequence> > <xs:element name="VesselBase" > type="VesselBaseType"/> > </xs:sequence> > </xs:complexType> > ............. > > > My problem is that it doesn't validate. XMLSpy 2005 gives me this > wonderfully useful error message: "Unexpected element 'VesselBase' in > element 'Vessel'. Expected: VesselBase" (Isn't that helpful?) > Using an > in-house Java 1.5-based validation tool (uses the Java-supplied XML > classes), I get: "XML Fatal Error: On line 2, column 329, the > following > fatal error occurred: cvc-elt.1: Cannot find the declaration > of element > 'Vessel'." > > Based on that second error message, I'm assuming this is a namespace > issue. Am I wrong? Despite having worked with XML for months now, I > still can't get namespaces straight. Very frustrating. :-/ > > Thanks in advance, > Tyson Tate > Developer, CADRC > > > From tytate@c... Wed Nov 23 18:13:33 2005 Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
