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

Re: xml:base and fragments

  • From: Michael Kay <mike@saxonica.com>
  • To: "Andrew S. Townley" <ast@atownley.org>
  • Date: Tue, 9 May 2017 23:31:48 +0100

Re:  xml:base and fragments
> If you’ve previously retrieved string1 as the base URI, then what the paragraph actually says was that you shouldn’t need to trigger a new retrieval of string2 because both are equal and refer to the same resource content that you have already loaded.
> If you haven’t actually retrieved string1 as the base URI *and* you’re dereferencing the target as part of a retrieval action, then you have no choice but to trigger a new retrieval action (because you don’t have it yet).
> What I still didn’t understand was your:
>>> * the reference is interpreted as a reference to the entity containing the reference, even if that entity is completely unrelated to anything you might find by retrieving the resource at http://A/. 
> Because it must be related if you’ve already loaded it, and it by definition is a "same-document” reference.  How could it be completely unrelated?

Let's say a document located at http://www.saxonica.com/foo.xml contains (a) the attribute xml:base="http://www.microsoft.com/bar.xml", and (b) the attribute href="". Resolving @href against the base URI gives "http://www.microsoft.com/bar.xml". The expanded value of href is the same as the base URI, so the spec says this is a same-document reference, so under section 4.4 the @href is assumed to refer to http://www.saxonica.com/foo.xml, not to http://www.microsoft.com/bar.xml. In other words, xml:base is effectively ignored - technically it's used to expand the relative reference, but the document you get back isn't the document at that location.

> What is your concern behind the observation?  Have you seen this behavior in the wild?

I have spent countless hours trying to decide what RFC 3986 and related specs mean, in order to ensure that specifications like XSLT and XPath are consistent with the RFC, and that my software products are conformant. My concerns are that (a) it's often very difficult to decide what they mean even after close study, and (b) sometimes when you work out what they mean, it's the last thing the user would expect.

Michael Kay

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


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.
First Name
Last Name
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.