Paul Tomsic <[EMAIL PROTECTED]> wrote on 07/26/2006 04:52:45 PM: > actually, something strange is happening. > if i modify the 'samples/personal.xml' file (that > ships w/ xerces) to this: > > <personnel xmlns="http://example.com" > > xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.example.com/schema > personal.xsd" > > > the example fails with: > Cannot find the declaration of element 'personnel' > > why is it that when i try to put a schemaLocation > attribute on the root element, i get errors?
Probably because the namespace you're using in the instance ( http://example.com) and the target namespace of your schema ( http://www.example.com/schema) don't match. > thanks in advance > > > --- Michael Glavassevich <[EMAIL PROTECTED]> wrote: > > > Looks like you specified the schema in place of the > > instance document. Try > > "java jaxp.SourceValidator -a personal.xsd -i > > personal.xml". > > > > Michael Glavassevich > > XML Parser Development > > IBM Toronto Lab > > E-mail: [EMAIL PROTECTED] > > E-mail: [EMAIL PROTECTED] > > > > Paul Tomsic <[EMAIL PROTECTED]> wrote on 07/25/2006 > > 02:13:19 PM: > > > > > Hmm, the problem that i'm seeing, though, if i use > > > that SourceValidator example and the > > "personal.xsd" > > > and "personal.xml" files, the result says > > something to > > > the effect of: > > > > > > [Error] personal.xsd:2:56 Cannot find the > > declaration > > > of element 'xs:schema' > > > > > > that doesn't seem right to me. > > > > > > thoughts? > > > > > > thanks in advance > > > > > > > > > --- Michael Glavassevich <[EMAIL PROTECTED]> > > wrote: > > > > > > > Paul Tomsic <[EMAIL PROTECTED]> wrote on > > 07/17/2006 > > > > 08:40:20 AM: > > > > > > > > > what's the best way to validate an xml file > > > > against an > > > > > xsd, when you have to retrieve the xsd from > > the > > > > header > > > > > attribs via http? > > > > > > > > > > for instance, if given an xml that contains > > the > > > > > > > > > > > > > > > > "schemaLocation="http://www.example.com/myschema.xsd > > > > > http://www.example.com/myschema.xsd" > > > > > > > > > > the process would be (a) retrieve the xsd from > > the > > > > > schemaLocation, and (b) ensure that the xml > > file > > > > > validates against the retrieved schema > > > > > > > > > > retrieval of the xsd is trivial, but not sure > > > > about > > > > > the validation part > > > > > > > > > > is there an example that someone could point > > me > > > > to? > > > > > > > > There are several samples [1][2] which come with > > the > > > > binary distribution > > > > that show how to do that. > > > > > > > > > thanks > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > To unsubscribe, e-mail: > > > > [EMAIL PROTECTED] > > > > > For additional commands, e-mail: > > > > [EMAIL PROTECTED] > > > > > > > > [1] > > > > > > > > > > http://xerces.apache.org/xerces2-j/samples-jaxp.html#SourceValidator > > > > [2] > > > > > > > > > > http://xerces.apache.org/xerces2-j/samples-jaxp.html#ParserAPIUsage > > > > > > > > Michael Glavassevich > > > > XML Parser Development > > > > IBM Toronto Lab > > > > E-mail: [EMAIL PROTECTED] > > > > E-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: > > > > [EMAIL PROTECTED] > > > > For additional commands, e-mail: > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
