Listing 1

<?xml version="1.0" encoding="UTF-8"?>
<Order xmlns="urn:oasis:names:tc:ubl:Order:1.0:0.70" 
xmlns:u="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.70">
<u:ID/>
<u:IssueDate/>
<u:LineExtensionTotalAmount currencyID="USD"/>
<u:BuyerParty>
<u:ID/>
<u:PartyName>
<u:Name/>
</u:PartyName>
<u:Address>
<u:ID/>
<u:Street/>
<u:CityName/>
<u:PostalZone/>
<u:CountrySub-Entity/>
</u:Address>
<u:BuyerContact>
<u:ID/>
<u:Name/>
</u:BuyerContact>
</u:BuyerParty>
<u:SellerParty>
<!-- ... -->
</u:SellerParty>
<u:DeliveryTerms>
<u:ID/>
<u:SpecialTerms/>
</u:DeliveryTerms>
<u:OrderLine>
<u:BuyersID/>
<u:SellersID/>
<u:LineExtensionAmount currencyID=""/>
<u:Quantity unitCode="">1</u:Quantity>
<u:Item>
<u:ID/>
<u:Description>Enter description here</u:Description>
<u:SellersItemIdentification>
<u:ID>Enter part number here</u:ID>
</u:SellersItemIdentification>
<u:BasePrice>
<u:PriceAmount currencyID="">0.00</u:PriceAmount>
</u:BasePrice>
</u:Item>
</u:OrderLine>
</Order>


Listing 2

<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:xforms="http://www.w3.org/2002/xforms/CR" 
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:u="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.70">
<head>
<title> 
<xforms:model id="default">
<!-- schema="UBL_Library_0p70_Order.xsd" -->
<xforms:instance src="ubl_inst.xml"/>
<xforms:submission action="file://tmp/ubl.xml" method="put" id="submit"/>


Listing 3

<!-- a few things are always required -->
<xforms:bind nodeset="u:IssueDate" required="true()" type="xs:date"/>
<xforms:bind nodeset="u:OrderLine/u:Quantity" required="true()"
type="xs:nonNegativeInteger"/>
<xforms:bind nodeset="u:OrderLine/u:Item">
<xforms:bind nodeset="u:BasePrice/u:PriceAmount" required="true()" type="xs:decimal"/>
<xforms:bind nodeset="u:SellersItemIdentification/u:ID" required="true()"/>
</xforms:bind>


Listing 4

<!-- a few basic calculations -->
<xforms:bind nodeset="u:OrderLine/u:LineExtensionAmount" type="xs:decimal"
calculate="../u:Quantity * ../u:Item/u:BasePrice/u:PriceAmount"/>
<xforms:bind nodeset="u:LineExtensionTotalAmount" type="xs:decimal"
calculate="sum(../u:OrderLine/u:LineExtensionAmount)"/>

Listing 5

<body>
<xforms:group>
<xforms:input ref="u:IssueDate">
<xforms:label>Order Date</xforms:label>
</xforms:input>
<xforms:select1 ref="u:LineExtensionTotalAmount/@currencyID"
appearance="minimal" selection="open">
<xforms:label>Currency to use throughout this form</xforms:label>
<xforms:itemset nodeset="instance('scratchpad')/currencyOptions/option">
<xforms:label ref="."/>
<xforms:value ref="@value"/>
</xforms:itemset>
</xforms:select1>
<xforms:output ref="u:LineExtensionTotalAmount">
<xforms:label>Order Total: </xforms:label>
</xforms:output>
</xforms:group>

Listing 6

<!-- repeating sequence for line items -->
<xforms:repeat id="lineitems" nodeset="u:OrderLine">
<xforms:group>
<xforms:range ref="u:Quantity" class="narrow"
start="1" end="9" step="1" incremental="true">
<xforms:label>Quantity <xforms:output ref="."/></xforms:label>
</xforms:range>

<xforms:input ref="u:Item/u:Description">
<xforms:label>Description</xforms:label>
</xforms:input>
<xforms:input ref="u:Item/u:SellersItemIdentification/u:ID">
<xforms:label>Part Number</xforms:label>
</xforms:input>
<xforms:input ref="u:Item/u:BasePrice/u:PriceAmount" class="narrow">
<xforms:label>Price</xforms:label>
</xforms:input>
</xforms:group>
</xforms:repeat>