Can you put a sample of your XML/Xsd  files online in a zip file somewhere, 
then I can have a look when. I've got a few mins spare..

-b



On 8 Jan 2013, at 20:31, Kelly Beard <[email protected]> wrote:

> I had a dream to make an XSD that contains my most commonly used XML types
> and have them contained in an XSD that I could import into other XSDs that
> represented by other form types.  The namespace I chose for my types XSD is
> DFCTypes.  The other XSD/XML forms would have their own namespaces.
> 
> Here's the thing: I think I'm doing everything correctly.  I have a generic
> program that I adapted from one of the Xerces samples.  It just reads in an
> XML document and spits things out based on the events (startDocument,
> endElement, et al).  I use it to validate a new XSD and run test XML
> documents through it to see that the parser isn't going to have problems.
> 
> This sample program has one thing not in common with how I set up my real
> production stuff: an entity resolver set with setEntityResolver().  The
> sample validator program flies through an XML validated with an XSD that
> does an <xs:import>.  In my production stuff however, I get errors like
> these:
> 
> Error at file "/home/dfcuser/rfidLog.xsd", line=7, column=36, XML element=,
> Imported schema 'DFCTypes.xsd' has a different target NameSpace '
> http://www.quikq.com/xsd/rfidLog' from what's declared '
> http://www.quikq.com/DFCTypes'
> 
> Error at file "/home/dfcuser/rfidLog.xsd", line=18, column=95, XML
> element=, Schema Representation Constraint: Namespace '
> http://www.quikq.com/DFCTypes' is referenced without <import> declaration
> 
> Error at file "/home/dfcuser/rfidLog.xsd", line=20, column=97, XML
> element=, Schema Representation Constraint: Namespace '
> http://www.quikq.com/DFCTypes' is referenced without <import> declaration
> 
> Error at file "/home/dfcuser/rfidLog.xsd", line=22, column=97, XML
> element=, Schema Representation Constraint: Namespace '
> http://www.quikq.com/DFCTypes' is referenced without <import> declaration
> 
> The first error regarding "line=7" is about the <xs:import> statement
> itself.  There's nothing wrong with it, I swear!
> 
> <xs:import namespace="http://www.quikq.com/DFCTypes";
> schemaLocation="DFCTypes.xsd" />
> 
> That is the namespace I want to use and that is the file that those types
> are contained in.  Works fine on my validator program - squat on production
> stuff.  Notice the error message says that the namespaces in the target XSD
> don't match - bullcrap!
> 
> Is anyone interested in helping me out here?  I'm sure the entity stuff is
> the problem.  I don't know why I need an entity resolver.  I can post
> whatever code you'd like to see.
> 
> Thanks!
> 
> -- 
> Kelly Beard

Reply via email to