# Understanding XML Repeating Nodes

A repeating node means that more than one instance of this node can be specified. For example, in the following XML data there are three instances of the priceRequest node, as shown in the following listing:

    <?xml version="1.0"?>
    <priceQuote xmlns="http://www.example.org/price">
    	<customerName>Acme Inc</customerName>
    	<shipAddress street="12 Springs Rd" city="Morris Plains" state="nj" zip="07960"/>
    	<priceRequests>
    		<priceRequest>
    			<widgetId>12</widgetId>
    			<price>1.00</price>
    		</priceRequest>
    		<priceRequest>
    			<widgetId>134</widgetId>
    			<price>34.10</price>
    		</priceRequest>
    		<priceRequest>
    			<widgetId>211</widgetId>
    			<price>10.00</price>
    		</priceRequest>
    	</priceRequests>
    </priceQuote>

A segment of the XML Schema for the preceding XML data is shown in the following listing:

    <?xml version="1.0"?>
    <xsd:schema . . . >
    . . .
    	<xsd:element name="widgetId" type="xsd:integer"/>
    	<xsd:element name="price" type="xsd:float"/>
    	<xsd:element name="priceRequest">
    		<xsd:complexType>
    			<xsd:sequence>
    				<xsd:element ref="pri:widgetId"/>
    				<xsd:element ref="pri:price"/>
    			</xsd:sequence>
    		</xsd:complexType>
    	</xsd:element>
    	<xsd:element name="priceRequests">
    		<xsd:complexType>
    			<xsd:sequence>
    				<xsd:element ref="pri:priceRequest" minOccurs="1" maxOccurs="10"/>
    			</xsd:sequence>
    		</xsd:complexType>
    	</xsd:element>
    . . .
    	<xsd:element name="priceQuote">
    		<xsd:complexType>
    			<xsd:sequence>
    				<xsd:element ref="pri:customerName" minOccurs="1" maxOccurs="1"/>
    				<xsd:element ref="pri:shipAddress" minOccurs="1" maxOccurs="1"/>
    				<xsd:element ref="pri:priceRequests"/>
    			</xsd:sequence>
    		</xsd:complexType>
    	</xsd:element>
    </xsd:schema>

The minOccurs="1" and maxOccurs="10" settings, in the definition of the priceRequest element (highlighted in bold in the preceding listing), specify that there can be one to ten instances of the priceRequest element. This defines priceQuote as a repeating element.

To View the Full listing of the XML Schema, Open the PriceQuote.xsd file

1. In the Application tab, expand Schemas folder. (If the Application tab is not visible in WebLogic Workshop, from the menu bar choose View —> Application.)
2. Double-click the PriceQuote.xsd icon.

The PriceQuote.xsd file is displayed.

3. Return to the Design View of the myJoin.xq file:

1. In the Application tab, double-click Tutorial_Process_Application\Tutorial_Process_ApplicationWeb\
   requestquote\MyTutorialJoin.dtf\myJoin.xq
2. Select the Design View tab.