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

MSXML : XMLSchemaCache Object

  • From: s.livingstone@b...
  • To: xml-dev@l...
  • Date: Tue, 28 Aug 2001 02:51:26 +0100 (BST)

xmlschemacache
Can someone explain the exact format for this. I managed to get it working, and i understand how to make it work, jsut an examplanatiomn of 

I created two schemas and loaded both into SchemaCache...

var cache = new ActiveXObject("MSXML2.XMLSchemaCache"); 
cache.add("urn:n", xmlXdr) 
cache.add("urn:m", xmlXdr1)

Now, my XML file...

<?xml version="1.0" ?>
<m:dunno m:somenum="10" xmlns:m="urn:foo">
 <n:some xmlns:n="urn:bar" />
</m:dunno>

Now, this works fine and validates and I can change the integer value "somenum" to a letter and validation fails etc... which is great. It DOES work.

I don't quite get the cache part though and how it relates to the namespaces. I would have thought that prefixes in the instance would have been irrelevant and that the namespace would be the main thing connecting the schema in the cache with a part of the XML instance. So you would have defined the prefix "m" to be a particular namespace in the instance (xmlns:m="anything" in my case) and then when you add the relevent schema document to validate that part of the instance to the cache you woudl just use the same namespace and it would associate that schema with that namespace - RATHER than the prefix which works for me.

So, in my case, rather than cache.add("urn:n", xmlXdr) , you would do cache.add("urn:foo", xmlXdr).

Can someone explain why this happens? Surely the context of the schema should be based on the namespace rather than whatever prefix you decide to use!?

Thanks,
Steven

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.