[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XML Schemas: schemas without a targetNamespace

  • From: "Roger L. Costello" <costello@m...>
  • To: xml-dev@l..., costello@m...
  • Date: Sat, 26 Aug 2000 12:28:44 -0400

targetnamespace
Hi Folks,

I have three questions about creating an XML Schema with no
targetNamespace:

1. Suppose that I create a schema, BookCatalogue.xsd with no
targetNamespace.  Now suppose that I want to create an instance
document, BookCatalogue.xml, which asserts that it conforms to the
schema.  How do I do it?  I tried two ways and both failed:

  a. In the instance document, for the value of schemaLocation I put 
     one value:

     <?xml version="1.0"?>
     <BookCatalogue 
             xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
             xsi:schemaLocation= "BookCatalogue.xsd">
        ...
     </BookCatalogue>

     I ran it through XSV and it gave an error "schemaLocation requires
     a pair of values".  "Hmm", I thought, "how can I give it a pair of
     values since the first in the pair specifies a targetNamespace and
     there is no targetNamespace?  Perhaps the trick is to put a 
     bogus value in for the first value in the pair?"  So, that's
     what I tried next...

  b. In my second attempt I put a pair of values in for schemaLocation
     where the first in the pair is a bogus value:

     <?xml version="1.0"?>
     <BookCatalogue 
             xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
             xsi:schemaLocation= "fjdkfsdklfds
                                  BookCatalogue.xsd">
        ...
     </BookCatalogue>

     As you might guess, this did not work either.  XSV gave me the
     error message, "targetNamespace mismatch: fjdkfsdklfds expected,
     None found".

Can someone tell me how to do this?

2. I have seen schemas which use "noTargetNamespace".  Upon examining
the specs, however, I see no mention of noTargetNamespace.  Is that
something from an old working draft that is no longer present?

3. Can someone give me a reason why you would ever want to have no
targetNamespace (i.e., why you would want your schema to have no
namespace for the elements that it declares)?

Thanks!  /Roger


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.