W3C home > Mailing lists > Public > www-xml-xinclude-comments@w3.org > March 2002

Resolving ID/IDREF conflicts

From: Roger L. Costello <costello@mitre.org>
Date: Sat, 30 Mar 2002 14:04:17 -0500
Message-ID: <3CA60C31.6590F7B6@mitre.org>
To: www-xml-xinclude-comments@w3.org
CC: costello@mitre.org
I am trying real hard to understand the proposed method for resolving
ID and IDREF conflicts [section 4.5.3].  Alas, after many, many rereads
I do not understand.  I understand best when I see a concrete example,
so please allow me to consider this example of a <Library> containing a
<BookCatalogue> section and a <GuestAuthors> section:

<?xml version="1.0"?>
<Library>
    <BookCatalogue>
        <Book isbn="_94303-12021-43892">
                <Title>My Life and Times</Title>
                <Author>Paul McCartney</Author>
                <Date>1998</Date>
                <Publisher>McMillin Publishing</Publisher>
        </Book>
        <Book isbn="_0-440-34319-4">
                <Title>Illusions The Adventures of a Reluctant 
                       Messiah</Title>
                <Author>Richard Bach</Author>
                <Date>1977</Date>
                <Publisher>Dell Publishing Co.</Publisher>
        </Book>
        <Book isbn="_0-06-064831-7">
                <Title>The First and Last Freedom</Title>
                <Author>J. Krishnamurti</Author>
                <Date>1954</Date>
                <Publisher>Harper &amp; Row</Publisher>
        </Book>
    </BookCatalogue>
    <GuestAuthors>
        <GuestAuthor>
            <Name>Richard Bach</Name>
            <BookForSigning isbn_ref="_0-440-34319-4">
                <Title>Illusions The Adventures of a Reluctant
                       Messiah</Title>
            </BookForSigning>
        </GuestAuthor>
    </GuestAuthors>
</Library>

The isbn_ref attribute on the <BookForSigning> element is of type
IDREF.  Its purpose is to point to the corresponding <Book> in the
<BookCatalogue> section.  Each <Book> has an ID attribute, isbn.

First Question:

Suppose that the library has another document that includes the
<BookForSigning> element.  Here's the include element:

<LibraryYearlySummary>
   <xi:include 
         href="Library.xml#xpointer(/Library/.../BookForSigning)"/>
</LibraryYearlySummary>

What would the resulting document look like?  Is the isbnRef
attribute's
value left dangling in the result document?

Second Question:

Suppose that instead of including the <BookForSigning> element I
include
one of the <Book> elements.  Note that each <Book> element has an ID
attribute, isbn.  Suppose that the including document already has an
element with the same ID value:

<MyBookCatalogue>
    <foo id="_94303-12021-43892"/>
    <xi:include 
        href="Library.xml#xpointer(/Library/.../Book[1])"/>
</MyBookCatalogue>

What will the resulting document look like?

/Roger
Received on Saturday, 30 March 2002 14:06:56 GMT

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