[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [xdi] Some XDI examples (including enveloped)
Dave, Thanks much for preparing this - I didn't know if you'd have something ready by the call. Consider it added it to the agenda. =Drummond --- Dave McAlpin <Dave.McAlpin@epok.net> wrote: > Attached are some annotated XDI examples that might > be useful for > tomorrow's call. > > Dave > > > Example 1 - Original XML > > This is the XML document used as an example by the > XML Schema Primer. > > <purchaseOrder orderDate="1999-10-20"> > <shipTo country="US"> > <name>Alice Smith</name> > <street>123 Maple Street</street> > <city>Mill Valley</city> > <state>CA</state> > <zip>90952</zip> > </shipTo> > <billTo country="US"> > <name>Robert Smith</name> > <street>8 Oak Avenue</street> > <city>Old Town</city> > <state>PA</state> > <zip>95819</zip> > </billTo> > <comment>Hurry, my lawn is going wild!</comment> > <items> > <item partNum="872-AA"> > <productName>Lawnmower</productName> > <quantity>1</quantity> > <USPrice>148.95</USPrice> > <comment>Confirm this is > electric</comment> > </item> > <item partNum="926-AA"> > <productName>Baby Monitor</productName> > <quantity>1</quantity> > <USPrice>39.98</USPrice> > <shipDate>1999-05-21</shipDate> > </item> > </items> > </purchaseOrder> > > Example 2 - All data > > If we want it all to be data, it's easy. > > <resource> > <xri>@:1001:1:2</xri> > <data> > <purchaseOrder orderDate="1999-10-20"> > <shipTo country="US"> > <name>Alice Smith</name> > <street>123 Maple Street</street> > <city>Mill Valley</city> > <state>CA</state> > <zip>90952</zip> > </shipTo> > <billTo country="US"> > <name>Robert Smith</name> > <street>8 Oak Avenue</street> > <city>Old Town</city> > <state>PA</state> > <zip>95819</zip> > </billTo> > <comment>Hurry, my lawn is going > wild!</comment> > <items> > <item partNum="872-AA"> > > <productName>Lawnmower</productName> > <quantity>1</quantity> > <USPrice>148.95</USPrice> > <comment>Confirm this is > electric</comment> > </item> > <item partNum="926-AA"> > <productName>Baby > Monitor</productName> > <quantity>1</quantity> > <USPrice>39.98</USPrice> > <shipDate>1999-05-21</shipDate> > </item> > </items> > </purchaseOrder> > </data> > </resource> > > Example 3 - All XDI > > If we want it be marked up with XDI using an > enveloping model, we lose the XML-ness. This is just > a pure, straight transformation. It doesn't do much > good by itself, but it gives us a base to work from. > > Notice that when we follow the XML, we break the > proposed rule about name uniqueness on "item". In > other words, @:1001:1:2/purchaseOrder/items/item > doesn't return a single node, it returns a node set, > just like XPath. The only issue is that the result > of an XDI request may not be well formed XML since > it may have multiple root nodes, so we probably need > to wrap all responses in a containing resource > element. > > <resource> > <xri>@:1001:1:2</xri> > <resource> > <xri>purchaseOrder</xri> > <resource> > <xri>orderDate</xri> > <data>1999-10-20</data> > </resource> > <resource> > <xri>shipTo</xri> > <resource> > <xri>country</xri> > <data>US</data> > </resource> > <resource> > <xri>name</xri> > <data>Alice Smith</data> > </resource> > <resource> > <xri>street</xri> > <data>123 Maple Street</data> > </resource> > <resource> > <xri>city</xri> > <data>Mill Valley</data> > </resource> > <resource> > <xri>state</xri> > <data>CA</data> > </resource> > <resource> > <xri>zip</xri> > <data>90952</data> > </resource> > </resource> > <resource> > <xri>billTo</xri> > <resource> > <xri>country</xri> > <data>US</data> > </resource> > <resource> > <xri>name</xri> > <data>Robert Smith</data> > </resource> > <resource> > <xri>street</xri> > <data>8 Oak Avenue</data> > </resource> > <resource> > <xri>city</xri> > <data>Old Town</data> > </resource> > <resource> > <xri>state</xri> > <data>PA</data> > </resource> > <resource> > <xri>zip</xri> > <data>95819</data> > </resource> > </resource> > <resource> > <xri>comment</xri> > <data>Hurry, my lawn is going > wild!</data> > <resource> > <resource> > <xri>items</xri> > <resource> > <xri>item</xri> > <resource> > <xri>partNum</xri> > <data>872-AA</data> > </resource> > <resource> > <xri>productName</xri> > <data>Lawnmower</data> > </resource> > <resource> > <xri>quantity</xri> > <data>1</data> > </resource> > <resource> > <xri>USPrice</xri> > <data>148.95</data> > </resource> > <resource> > <xri>comment</xri> > <data>Confirm this is > electric</data> > </resource> > </resource> > <xri>item</xri> > <resource> > <xri>partNum</xri> > <data>926-AA</data> > </resource> > <resource> > <xri>productName</xri> > <data>Baby Monitor</data> > === message truncated ===
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]