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

Re: XLink, XInclude, and xml:base


xinclude same document
In article <8D1E3CF2596C6745A9D1765D67B12EE12C560D@e...> you write:

>  <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>

>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.

You're in luck: it *does* point to #item1 in the XIncluded result,
because "#item1" is a same-document reference regardless of the
current base URI.

How this is determined to be the case depends on whether you use the
old or new URI spec.

If you use the old one (RFC2396), "#item1" is a same-document reference
because the non-fragment part is an empty string and the relative uri
resolution algorithm says that that means a same-document reference.

If you use the new one (RFC3986), "#item1" is a same-document
reference because the relative uri resolution algorithm produces a
non-fragment part "http://example.com/common/policy.xml" that is the
same as the base URI, and that is the new definition of same-document
reference.

Either way it is a same-document reference, and thus points to #item1
in the result document.

-- Richard

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.