OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] MSXML and the "<any>" tag in XML Schemas

[ Lists Home | Date Index | Thread Index ]

I was working with my schema again today, and I managed to recreate
the behavior I was encountering last week, and now I know what I was 
doing wrong.  Apparently I had missed that I had changed this the 
last time I posted.  Also, I believe I failed to give an accurate 
representation of my orginal schema.

Here is something closer to a direct cut and paste of what was 
really causing the error.  I'm posting this just in case it helps 
anyone.



	<xsd:element 
		name      = "some-element"
		>

		<xsd:annotation>
			<xsd:documentation>

				Some notes about this element

			</xsd:documentation>
		</xsd:annotation>

		<xsd:complexType>
			<xsd:sequence>

				<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>

				<xsd:element  
					name      = "sub-element-one"  
					type      = "sub-element-one-type"	
					minOccurs = "0"  
					maxOccurs = "1"  
					/>

				<xsd:element  
					name      = "sub-element-two"  
					type      = "sub-element-two-type"	
					minOccurs = "0"  
					maxOccurs = "1"  
					/>

				<xsd:element  
					name      = "sub-element-three"  
					type      = "sub-element-three-type"	
					minOccurs = "0"  
					maxOccurs = "1"  
					/>

				<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>

			</xsd:sequence>
			<xsd:anyAttribute/>
		</xsd:complexType>
	</xsd:element>


The problem was when I had the

	<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>

insertion both before and after the elements in the sequence, and there was a 
possibility that there could be no other elements between these two (notice
the minOccurs="0" on all elements in the sequence).  Well, if I put a minOccurs
of at least 1 in at least one of the elements between the two 

	<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>

then I don't have the problem.  It was just chance that I had eliminated the first 
one of these tags from the only element in my schema that is like this prior to 
running my validation again that last time, and I didn't even realize I had done it,
so as it turns out, it was not a glitch in my system, but rather an oversight.

Thanks for everybody's help on this,

Chris Strolia-Davis
Database Specialist
Contractor - CDO Technologies Inc.
(937) 656-0537
x60537


-----Original Message-----
From: Strolia-Davis Christopher Contr MSG/MAT
[mailto:Christopher.Strolia-Davis@wpafb.af.mil]
Sent: Wednesday, December 10, 2003 12:14 PM
To: 'michael.h.kay@ntlworld.com'
Cc: xml-dev@lists.xml.org
Subject: RE: [xml-dev] MSXML and the "<any>" tag in XML Schemas


Hi Michael,

It would appear that I was the victim of some sort of computer glitch yesterday when I was running my validation script.  I should have run it again today prior to sending out my post.  I guess all I needed was a reboot.  Sorry about that.

In any case, I didn't have any other namespaces included, imported or otherwise referenced in any way, and that is why I was confused that it wouldn't work.  I checked my work thoroughly, and it didn't seem like there would be any reason that the schema would have any problems, and apparently I was right.  So anyway, I guess there was just something wiggy going on in my PC.  It wouldn't be the first time, and I doubt it will be the last.

Thanks for the help

Chris Strolia-Davis
Database Specialist
Contractor - CDO Technologies Inc.




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS