tags:

views:

107

answers:

3

I am trying to create an XML schema representing an 'order' for a shopping cart

I want this to completely abstract away my shopping cart's implementation -- and eventually support partners sending us orders using this schema. (yes i'm planning on integrating this schema into our existing cart)

It will have original order items, repeat shipping items and domain specific things. I'm quite capable of building this, but i was wondering if there are many things out there like this that I could at least base mine upon.

I know there are standards out there for certain schema elements like this, but I've lost track of which are the best/standard and how you might extend them etc.

obviously if i want a partner to send me an 'order' i'd like to use a standard if one exists.

+2  A: 

Do you want the XML, or the XSD? For the XSD, you can generate one using Microsoft's XSD generator based off of an XML document.

If you want a generic XML document that could represent an 'order', here's one.

<?xml version="1.0"?>
    <Order>
 <Date>2003/07/04</Date>
 <CustomerId>123</CustomerId>
 <CustomerName>Acme Alpha</CustomerName>

   <Item>
 <ItemId> 987</ItemId>
 <ItemName>Coupler</ItemName>
 <Quantity>5</Quantity>
 </Item>

<Item>
 <ItemId>654</ItemId>
 <ItemName>Connector</ItemName>
 <Quantity unit="12">3</Quantity>
 </Item>

<Item>  
 <ItemId>579</ItemId>
 <ItemName>Clasp</ItemName>
 <Quantity>1</Quantity>
 </Item>

</Order>

From here.

George Stocker
thanks. xsd or xml is fine. much easier to read XML on here anyway. i was more wondering about more complicated scenarios - including more complex thins like shipping, discounts, addresses, partner specific things. especially interested in standards based thins
Simon_Weaver
Great. What have you tried so far? What are your business requirements? Unfortunately, your question comes off as 'plz send teh codez', and it's very tough for the SO crowd to do that, especially when you haven't shown any of your work, as it were.
George Stocker
+1  A: 

If you are looking for ideas about how to structure the shopping cart:
http://stackoverflow.com/questions/360959/database-table-structure-for-shopping-cart

Leah
+1  A: 

UBL (Universal Business Language) defines schemas for business documents (purchase orders, invoices, etc.). It is an OASIS standard, see:

http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=ubl

George Bina
this is exactly the kind of thing i'm looking for. thanks
Simon_Weaver