Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Handling unbounded elements


Message #1 by sking@m... on Tue, 12 Nov 2002 08:07:30
Hi,

If I have a schema that has an unbounded element in it, for example a 
party may have many addresses, and I want to know how many of these are 
populated when I access the data, how do I know how many occurrences are 
populated? I assume that I would have to loop through the data to find out 
how many are populated, how do I do this with Javascript?

A sample of what I mean:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="Unboundedexample">
		<xs:complexType>
			<xs:sequence>
			<xs:element name="Address" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

How do I know at the time I get this schema, how many occurrences of the 
unbounded element are populated?

Stuart King

  Return to Index