Skip navigation.
 
mlNSXMLDocument xsi:noNamespaceSchemaLocation attribute accepted in validateAndReturnError method?
FROM : Richard Wolf
DATE : Fri Feb 29 03:45:27 2008

Hi guys, kind of a funky question ... not a crisis or anything, but I 
was curious if anyone knows ... or if this is a bug.  I am happy to 
radar away if it's a bug.  I actually Googled "NSXMLDocument 
xsi:noNamespaceSchemaLocation" and it comes up a bust ... zero 
hits.  :)  So I thought I would verify here before radar-ing.  :)

So okay, my issue ...

I'm trying to validate against an Apple-defined XML schema:

http://deimos.apple.com/iTunesURequest-1.0.3.xsd

Cocoa has this handy-dandy method in NSXMLDocument ... 
validateAndReturnError:

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
Classes/NSXMLDocument_Class/Reference/Reference.html#//apple_ref/occ/
instm/NSXMLDocument/validateAndReturnError:

it can use a DTD to validate XML ... or an XMLSchema doc.  But if you 
go XMLSchema, it looks like your schema has to be in a namespace.

In other words, so long as you put an xsi:schemaLocation attribute in 
the root element of the XML you want to validate, all is cool ... but 
if your schema is not in a namespace (like Apple's) ... well, you're 
supposed to use xsi:noNamespaceSchemaLocation ... per the w3c.  :) 
But the validateAndReturnError method in NSXMLDocument does not see 
that attribute ... only xsi:schemaLocation.

Am I just missing something obvious here?  :)

Many thanks in advance for any insight.

Richard K. Wolf                    University of Illinois at Chicago
<email_removed> (work)  Tweets: richwolf    (work) +1 312 996-8291
<email_removed> (fun)  AIM: pigthug      (mobile) +1 773 339-0574

Related mailsAuthorDate
No related mails found.