[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XLink, XInclude, and xml:base


policy xml
Magnus Henriksson (MO/EAB) wrote:
> If run document.xml through an XInclude processor, I get the
> following result:
> 
> <?xml version="1.0"?>
> <document xmlbase="http://example.com"
>           xmlns:xi="http://www.w3.org/2001/XInclude" >
>   <paragraph>How to handle customers:</paragraph>
>   <list xmlns:xlink="http://www.w3.org/1999/xlink"
>         xml:base="common/policy.xml">
>     <item xml:id="item1">The customer is always right.</item>
>     <item>When the customer is wrong, see <link xlink:type="simple"
>                                                 xlink:href="#item1"/>.</item>
>     <graphic xlink:type="simple"
>              xlink:actuate="onLoad"
>              xlink:show="embed"
>              xlink:href="../images/happy-customer.gif"/>
>   </list>
> </document> 
>
> My problem is that the link points to
> http://example.com/common/policy.xml#item1, but I really want it to
> point to #item1 in the XIncluded result.

Those two things are the same in this case. Let me quote the relevant 
part from http://www.apps.ietf.org/rfc/rfc3986.html#sec-4.4

"When a URI reference refers to a URI that is, aside from its fragment 
component (if any), identical to the base URI (Section 5.1), that 
reference is called a "same-document" reference. The most frequent 
examples of same-document references are relative references that are 
empty or include only the number sign ("#") separator followed by a 
fragment identifier.

When a same-document reference is dereferenced for a retrieval action, 
the target of that reference is defined to be within the same entity 
(representation, document, or message) as the reference; therefore, a 
dereference should not result in a new retrieval action."

Because http://example.com/common/policy.xml is the base URI, 
http://example.com/common/policy.xml#item1 is a same-document reference, 
and therefore "points" to the XIncluded result.

-- 
Sjoerd Visscher
http://w3future.com/weblog/

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.