OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xdi message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: XDI Proposal


Examples for discussion on today's call
 
The following is example from the XML Schema Primer.
 
<purchaseOrder orderDate="1999-10-20" ID="_1234">
  <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>
 
The same XML as an XDI Resource Bundle
 
<xdi:Resource>
  <xdi:Header>
  .
  .
  .
  </xdi:Header>
  <xdi:Data>
    <purchaseOrder orderDate="1999-10-20" ID="_1234">
      <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>
  </xdi:Data>
</xdi:Resource>

Same data with meta data to add typing and addressing info to some of the data nodes
 
<xdi:Resource>
  <xdi:Header>
  <xdi:Meta URI="#_1234" XPath="/purchaseOrder">
      <xdi:Address>xri://@w3c/xmlschema/po.xml</xdi:Address>
      <xdi:type>@dictionary/(+purchaseOrder)</xdi:Type>
      <xdi:Meta XPath="/purchaseOrder/shipTo">
        <xdi:Address>!2</xdi:Address>
        <xdi:Type>@dictionary/(+address)</xdi:Type>
        <xdi:Type>@dictionary/(+shippingAddress)</xdi:Type>
      <xdi:Meta>
      <xdi:Meta XPath="/purchaseOrder/billTo">
        <xdi:Address>!3</xdi:Address>
        <xdi:Type>@dictionary/(+address)</xdi:Type>
        <xdi:Type>@dictionary/(+billingAddress)</xdi:Type>
      </xdi:Meta>
      <xdi:Meta XPath="/purchaseOrder/comment">
        <xdi:Address>!4</xdi:Address>
      </xdi:Meta>
      <xdi:Meta XPath="/purchaseOrder/items">
        <xdi:Address>!5</xdi:Address>
        <xdi:Meta XPath="/purchaseOrder/items/item[1]">
          <xdi:Address>!1</xdi:Address>
        </xdi:Meta>
        <xdi:Meta XPath="/purchaseOrder/items/item[2]">
          <xdi:Address>!2</xdi:Address>
        </xdi:Meta>
      </xdi:Meta>
    </xdi:Meta>
  </xdi:Header>
  <xdi:Data>
    <purchaseOrder orderDate="1999-10-20" ID="_1234">
      <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>
  </xdi:Data>
</xdi:Resource>

What this says, in effect is, the we wish the XML in the data section looked like this
 
<purchaseOrder orderDate="1999-10-20" ID="_1234">
  <shipTo country="US">
    <name>Alice Smith</name>
    <street>123 Maple Street</street>
    <city>Mill Valley</city>
    <state>CA</state>
    <zip>90952</zip>
    <xdi:Address>!2</xdi:Address>
    <xdi:Type>@dictionary/(+address)</xdi:Type>
    <xdi:Type>@dictionary/(+shippingAddress)</xdi:Type>
  </shipTo>
  <billTo country="US">
    <name>Robert Smith</name>
    <street>8 Oak Avenue</street>
    <city>Old Town</city>
    <state>PA</state>
    <zip>95819</zip>
    <xdi:Address>!3</xdi:Address>
    <xdi:Type>@dictionary/(+address)</xdi:Type>
    <xdi:Type>@dictionary/(+billingAddress)</xdi:Type>
  </billTo>
  <comment>
    Hurry, my lawn is going wild
    <xdi:Address>!4</xdi:Address
  </comment>>
  <items>
    <item partNum="872-AA">
      <productName>Lawnmower</productName>
      <quantity>1</quantity>
      <USPrice>148.95</USPrice>
      <comment>Confirm this is electric</comment>
      <xdi:Address>!1</xdi:Address>
    </item>
    <item partNum="926-AA">
      <productName>Baby Monitor</productName>
      <quantity>1</quantity>
      <USPrice>39.98</USPrice>
      <shipDate>1999-05-21</shipDate>
      <xdi:Address>!2</xdi:Address>
    </item>
    <xdi:Address>!5</xdi:Address>
  </items>
  <xdi:Address>xri://@w3c/xmlschema/po.xml</xdi:Address>
  <xdi:type>@dictionary/(+purchaseOrder)</xdi:Type>
</purchaseOrder>

 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]