473,657 Members | 2,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with xs:substitution Group and MSXML

Hi all,

These days I'm playing with schemas and SOM from MSXML. To learn it I used
the excellent tutorial from Mr.Costello:
http://www.xfront.com/xml-schema.html. while working through the labs I
stumbled upon a problem with substitutionGro up-s (Lab 9).

Below you can find both the schema and a sample document to test it.
Unfortunately, MSXML doesn't like the document and ends up with an error:
"### <guarantee>life time warranty</guarantee>(11) error: Element content
is invalid according to the DTD/Schema." Can someone please take a look at
it and comment on the problem. May be I am doing something wrong here or
may be someone can confirm that this is MSXML validation bug.

Thank you!
Val Melamed

The schema:
-------------------------------------------------------------------------------
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
targetNamespace ="http://www.juicers.org "
xmlns="http://www.juicers.org "
elementFormDefa ult="qualified" >
<xsd:element name="warranty" type="xsd:strin g"/>
<xsd:element name="guarantee " substitutionGro up="warranty"
type="xsd:strin g"/>
<xsd:complexTyp e name="juiceAppl iance">
<xsd:all>
<xsd:element name="descripti on" type="xsd:strin g"/>
<xsd:element ref="warranty" minOccurs="0"/>
<xsd:element name="name" type="xsd:strin g"/>
<xsd:element name="image" type="imageType "/>
<xsd:element name="weight" minOccurs="0">
<xsd:complexTyp e>
<xsd:simpleCont ent>
<xsd:extensio n base="xsd:posit iveInteger">
<xsd:attribut e name="units" type="xsd:strin g"
fixed="pounds"/>
</xsd:extension>
</xsd:simpleConte nt>
</xsd:complexType >
</xsd:element>
<xsd:element name="cost" minOccurs="0">
<xsd:complexTyp e>
<xsd:simpleCont ent>
<xsd:extensio n base="money">
<xsd:attribut e name="currency" use="required">
<xsd:simpleType >
<xsd:restrictio n base="xsd:strin g">
<xsd:enumeratio n value="USD"/>
<xsd:enumeratio n value="CAD"/>
</xsd:restriction >
</xsd:simpleType>
</xsd:attribute>
</xsd:extension>
</xsd:simpleConte nt>
</xsd:complexType >
</xsd:element>
<xsd:element name="retailer" type="xsd:anyUR I"/>
</xsd:all>
<xsd:attribut e name="id" type="xsd:ID" use="required"/>
<xsd:attribut e name="electric" type="xsd:boole an" use="required"/>
<xsd:attribut e name="type" use="required">
<xsd:simpleType >
<xsd:restrictio n base="xsd:strin g">
<xsd:enumeratio n value="press"/>
<xsd:enumeratio n value="gear"/>
<xsd:enumeratio n value="centrifu gal"/>
</xsd:restriction >
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType >
<xsd:element name="juicers">
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element name="juicer" type="juiceAppl iance"
minOccurs="0" maxOccurs="unbo unded"/>
</xsd:sequence>
</xsd:complexType >
</xsd:element>
<xsd:simpleTy pe name="money">
<xsd:restrictio n base="xsd:decim al">
<xsd:fractionDi gits value="2"/>
</xsd:restriction >
</xsd:simpleType>
<xsd:simpleTy pe name="imageType ">
<xsd:restrictio n base="xsd:strin g">
<xsd:pattern value="(.)+\.(g if|jpg|jpeg|bmp )"/>
</xsd:restriction >
</xsd:simpleType>
</xsd:schema>
-------------------------------------------------------------------------------
The document:
-------------------------------------------------------------------------------
<?xml version="1.0"?>
<juicers xmlns="http://www.juicers.org "
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://www.juicers.org
C:\xml-schemas\labs\la b09\answer\juic ers.xsd">
<juicer id="mighty-oj" electric="false " type="press">
<name>OJ Home Juicer</name>
<image>images\m ighty_oj.gif</image>
<cost currency="USD"> 41.95</cost>
<description>Th ere&apos;s just no substitute for a properly
squeezed orange in the morning. So delicate and refreshing. The finest
hotels use mechanical juicers of this type for their most discriminating
guests. This is the largest selling juicer of its kind. It&apos;s a
beautiful little all-metal piece in baked enamel and polished chrome; it
even won the Frankfurt Fair Award for its design. Uses no electricity and
produces no non-recyclable waste as do frozen juices.</description>
<guarantee>life time warranty</guarantee>
<retailer>htt p://www.thewhitewha le.com/oj.htm</retailer>
</juicer>
<juicer id="champion" electric="true" type="gear">
<cost currency="USD"> 239.00</cost>
<retailer>htt p://www.grainsandgr eens.com/juicerparts.htm l</retailer>
<description>Th e Champion Juicer is the answer to every juicing
problem. Because it operates on the mastication process principle, the
Champion chews the fibers and breaks up the cells of vegetables and fruits.
This give you more fiber, enzymes, vitamins and trace minerals. The juice
will be a darker, richer color, with a sweeter, richer more full-bodied
flavor.</description>
<name>Champio n Juicer</name>
<image>images\c hampion.gif</image>
</juicer>
<juicer id="green-power" electric="true" type="gear">
<name>Green Power Gold Juice Extractor</name>
<image>images\g reenPower.jpg</image>
<description>Yo u are not What You Eat, But What you Absorb. The
rate of absorption of juice has never been considered a factor in comparing
juicers. With the introduction of Green Power&apos;s magnetic Twin Gear
press, this has now changed. Experiments conducted by the Green Power Co.
Research and Development Dept. show the rate of absorption of green juice
using dual gear extraction is up to five times greater than using
centrifugal extraction.</description>
<cost currency="USD"> 459.99</cost>
<retailer>htt p://www.discountjui cers.com/greencomplete.h tml</retailer>
</juicer>
<juicer id="juiceman-jr" electric="true" type="centrifug al">
<description>Th e Juiceman Jr. juicer is the little brother to the
Juiceman II juicer that is seen on television. The Juiceman Jr. is a pulp
ejection juicer that allows you to juice continuously without having to stop
and clean the machine. Made popular by Jay Kordich, the Juiceman series of
juicers have been a popular addition to millions of households all across
this nation. This machine comes ready to use out of the box</description>
<warranty>1 yr. Limited Warranty </warranty>
<name>Juicema n Jr.</name>
<image>images\j uiceman.jpg</image>
<weight>10</weight>
<cost currency="USD"> 82.00</cost>
<retailer>htt p://www.juicebars.c om/juicers/jm1.htm</retailer>
</juicer>
<juicer id="omega" electric="true" type="centrifug al">
<description>Th is heavy-duty, American-made juicer has a powerful
GE motor that spins at 3,600 rpm to extract 20% - 30% more juice than pulp
ejector models (according to independent laboratory tests). Large capaciy
bowl hold a ful 1-2 quarts of fruits or vegetables - compared to just one
pint for many brands. Easy-cleaning design with lift out disposable
filter.</description>
<name>Omega Juicer</name>
<image>images\o mega.jpg</image>
<cost currency="USD"> 234.00</cost>
<retailer>htt p://www.boschcanada .com/omega.htm</retailer>
</juicer>
<juicer id="wheateena" electric="true" type="gear">
<description>Wh eatgrass juice contains 70% "crude" chlorophyll.
Chlorophyll by definition being the green pigment in plants. It is
considered the "blood" of plants, due to the similarity to our blood in
molecular structure. This juicer extracts the juice out of the blades of
wheatgrass. Normal fruit and vegetable juicers will not juice
wheatgrass</description>
<guarantee>Moto r Guarantee: For Home Use: one (1) year. For
Commercial Use: six (6) months.</guarantee>
<name>Wheatee na Wheatgrass Juicer</name>
<image>images\w heateena.jpg</image>
<weight>46</weight>
<cost currency="USD"> 639.99</cost>
<retailer>htt p://www.rawfoods.co m/marketplace/heavyduty.html</retailer>
</juicer>
</juicers>

-------------------------------------------------------------------------------
Jul 20 '05 #1
1 2347
Works for me with XSV [1]. . .

ht

[1] http://www.ltg.ed.ac.uk/~ht/xsv-status.html
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1316
by: Ashton | last post by:
Hello, I am fairly new to all this XML stuff. I have recently taken over some coding on a project that involves reading in xml documents and validating them based on some schema files. The schema files were written long before I started working on the program, so I had no input in their creation. We created a tool that uses MSXML to load and validate the documents. 99% of it works great. The last 1% is stumping me. There are a...
1
3151
by: OKI | last post by:
Hi. I´ve made a XML parser using MSXML2.LIB in a computer. When i´ve tried to run it in another one like that: HRESULT hr = CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument, (void **)&(this->xmlDoc)); the result is:
1
2164
by: Ted | last post by:
I have some code which processes an xsd. For elements of type xs:integer the XmlSchemaDatatype object gotten from the schema elements ElementType member contains a ValueType of System.Decimal. I don't get it it should be System.Int32 or some other integer type but not a decimal. Any ideas why this is happening? btw: I'm using msxml 4.0. Ted
7
4238
by: Microsoft News | last post by:
Hi all. Does id() xpath function work in System.XML? I have built dtd, schema, xdr for a simple xml which includes attributes definded as ID and IDREFS. Validation is occurring properly for all the types of metadata, but the id() function applied to the IDREFS attribute allways returns nothing. I have tried it from xslt and using the XmlNode.selectnodes or XPathNavigator.Select nada zilch
0
1109
by: AdrianEvans | last post by:
I am trying to build a .NET assembly which will contain the OAGIS schemas using OAGIS version 8.0 SP 3. When I try to validate the schemas, specifically the Order.xsd schema, I get the following error: Invalid particle derivation by restriction: Order.xsd line 16 I have searched google, the yahoo group and several other sources and found that other users are experiencing the same thing. Do you have any information about this error, and...
5
3383
by: Jeffry van de Vuurst | last post by:
Hi, I'm working on an xml schema and I'm running into some problems relating substitutionGroups and extensions. This xsd validates fine: There are three elements and three complex types and every element has the type of some complexType. <?xml version="1.0" encoding="UTF-8"?>
0
1824
by: XSD-optimist | last post by:
I am trying to generate the classes for an XSD schema using the Microsoft XSD Object Code Generator (XSDObjGen). I am having a schema that contains the definition of the following: 1. a complex type 'ExternalDestinationBaseComplexType' 2. abstract element 'ExternalDestinationDefinitionEntry' of type 'ExternalDestinationBaseComplexType' 3. two elements 'SAP' and 'Dir' of type ExternalDestinationBaseComplexType with substitutionGroup set...
3
1770
by: Michael Skulsky | last post by:
Hi all, I've got the following validation problem. There are 2 schemas and a document: ----------------------------------------------------------------- bar.xsd ====== <?xml version="1.0" encoding="UTF-8"?> <schema xmlns:bar="urn:bar" targetNamespace="urn:bar"
3
70178
by: Sharon | last post by:
How can I find what MSXML version I have installed? -- Thanks Sharon
0
8395
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.