W3C home > Mailing lists > Public > www-xml-xinclude-comments@w3.org > June 2004

RE: examples of xpointer attribute use

From: Jonathan Marsh <jmarsh@microsoft.com>
Date: Wed, 9 Jun 2004 14:54:50 -0700
Message-ID: <DF1BAFBC28DF694A823C9A8400E71EA203E27216@RED-MSG-30.redmond.corp.microsoft.com>
To: "Elliotte Rusty Harold" <elharo@metalab.unc.edu>, "Henry S. Thompson" <ht@inf.ed.ac.uk>
Cc: <www-xml-xinclude-comments@w3.org>
I'm agreeable!  Here's what I propose:

 


C.4 Fragment Inclusion Example


The following illustrates the results of including fragments of another
XML document. Assume the base URI of the document is
http://www.example.com/JoeSmithQuote.xml.

<?xml version='1.0'?>

<price-quote xmlns:xi="http://www.w3.org/2001/XInclude">

  <prepared-for>Joe Smith</prepared-for>

  <good-through>20040930</good-through>

  <xi:include href="price-list.xml" xpointer="w002-description"/>

  <volume>40</volume>

  <xi:include href="price-list.xml" xpointer="element(w002-prices/2)"/>

</price-quote>

price-list.xml references a DTD which declares the id attributes as type
ID, and contains:

<?xml version='1.0'?>

<!DOCTYPE price-list SYSTEM "price-list.dtd">

<price-list xml:lang="en-us">

  <item id="w001">

    <description id="w001-description">

      <p>Normal Widget</p>

    </description>

    <prices id="w001-prices">

      <price currency="USD" volume="1+">39.95</price>

      <price currency="USD" volume="10+">34.95</price>

      <price currency="USD" volume="100+">29.95</price>

    </prices>

  </item>

  <item id="w002">

    <description id="w002-description">

      <p>Super-sized widget with bells <i>and</i> whistles.</p>

    </description>

    <prices id="w002-prices">

      <price currency="USD" volume="1+">59.95</price>

      <price currency="USD" volume="10+">54.95</price>

      <price currency="USD" volume="100+">49.95</price>

    </prices>

  </item>

</price-list>

The infoset resulting from resolving inclusions on this document is the
same as that of the following document:

<?xml version='1.0'?>

<price-quote xmlns:xi="http://www.w3.org/2001/XInclude">

  <prepared-for>Joe Smith</prepared-for>

  <good-through>20040930</good-through>

  <description id="w002-description" xml:lang="en-us"

               xml:base="http://www.example.com/price-list.xml">

    <p>Super-sized widget with bells <i>and</i> whistles.</p>

  </description>

  <volume>40</volume>

  <price currency="USD" volume="10+" xml:lang="en-us"

         xml:base="http://www.example.com/price-list.xml">45.95</price>

</price-quote>

 

 

> -----Original Message-----

> From: www-xml-xinclude-comments-request@w3.org
[mailto:www-xml-xinclude-

> comments-request@w3.org] On Behalf Of Elliotte Rusty Harold

> Sent: Thursday, June 03, 2004 6:57 AM

> To: Henry S. Thompson

> Cc: www-xml-xinclude-comments@w3.org

> Subject: Re: examples of xpointer attribute use

> 

> 

> At 12:50 PM +0100 6/3/04, Henry S. Thompson wrote:

> >It would be _very_ helpful to see examples which use the normative

> >XPointer mechanisms, i.e. shorthand pointers and element() scheme

> >pointers.

> >

> 

> I agree. This should be included in the spec, indeed in preference to

> the xpointer mechanism scheme.

> --

> 

>    Elliotte Rusty Harold

>    elharo@metalab.unc.edu

>    Effective XML (Addison-Wesley, 2003)

>    http://www.cafeconleche.org/books/effectivexml

> 

>
http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaula
it

> A

 
Received on Wednesday, 9 June 2004 17:55:40 GMT

This archive was generated by hypermail 2.2.0 + w3c-0.30 : Thursday, 9 June 2005 12:16:09 GMT