472,805 Members | 1,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Is a fragment ID a URI reference?

I'm trying to grasp this little passage from the XBRL spec:

"The xlink:href attribute MUST be a URI. The URI MUST point to an XML
document or to one or more XML fragments within an XML document. If the
URI is relative, it MUST be resolved to obtain an absolute URI as
specified in XML Base specification [XML Base]."

I guess they really mean "URI reference" and not "URI" in the formal
sense. But anyway, consider this document:

<?xml version="1.0"?>
<a xml:base="http://example.org/schema.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink">
<b xlink:href="#myelement"/>
</a>

My question is: is a fragment ID by itself a URI reference? Is the above
example valid, or can xlink:href="#myelement" only refer to the same
document?

Gustaf
May 18 '06 #1
3 2023
* Gustaf wrote in comp.text.xml:
<a xml:base="http://example.org/schema.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink">
<b xlink:href="#myelement"/>
</a>

My question is: is a fragment ID by itself a URI reference? Is the above
example valid, or can xlink:href="#myelement" only refer to the same
document?


It's valid and refers to (#myelement in) the same document, please see
RFC 3986 for details.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
May 18 '06 #2
In article <e9********************@giganews.com>,
Gustaf <gu*****@algonet.se> wrote:
My question is: is a fragment ID by itself a URI reference? Is the above
example valid, or can xlink:href="#myelement" only refer to the same
document?


A URI reference of the form #myelement is always a same-document
reference, regardless of the base URI.

Either by RFC 2396, in which it is handled explicitly without
reference to the base URI:

4.2. Same-document References

A URI reference that does not contain a URI is a reference to the
current document. In other words, an empty URI reference within a
document is interpreted as a reference to the start of that document,
and a reference containing only a fragment identifier is a reference
to the identified fragment of that document.

or by RFC 3986, in which it is handled by using the base URI and comparing
it with the (same!) base URI:

4.4. Same-Document Reference

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.

You can't use xml:base to make a bare fragment refer to some other document.

-- Richard
May 18 '06 #3
Richard Tobin wrote:
A URI reference of the form #myelement is always a same-document
reference, regardless of the base URI.


A good answer. It simplifies my task too. :-)

Gustaf
May 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Stuart Baker | last post by:
I just added session support to a web site and the URL's that contain a #fragment no longer function. Is there a delimiter that I can add following the #fragment that will tell the browser that the...
2
by: Yuriy | last post by:
Hi, any ideas how to read XML fragment from TextReader? XmlTextReader constructor accepts only Stream or string as source Do I miss something? thanks Yuriy
1
by: Wallace | last post by:
Hi all, I have a problem on validating a xml fragment using a single namespace schema which spread across multiple schema files using include in the master schema file. No matter how I change...
3
by: DC | last post by:
Hi, (ASP.Net 1.1) is it possible to (programmatically and globally) deactivate page fragment caching? We have only two scenarios, development stage where we want caching off and testing where we...
3
by: ano | last post by:
Hi all, I try to add an XML fragment into C# Documentation Comments like this: /// <example> ///<code> ///<book> /// <name>Book1</name> ///</book> ///</code>
2
by: Shimon Sim | last post by:
Hi I keep getting error : WriteStartDocument cannot be called on writers created with ConformanceLevel.Fragment. The code that I have is very simple. SimpleClass c = new SimpleClass();
1
by: =?Utf-8?B?QU1lcmNlcg==?= | last post by:
I have a vb.net program that needs to display a few fragments of its source code, typically one to five lines for each fragment, and each line contains one assignment statement. I need to do this...
2
by: =?Utf-8?B?Q29lbg==?= | last post by:
Hi, can anyone tell me 1) what is a easy way to build a xml fragment into a string. I don't what the fragment to be written to file, just in a string will be fine. I can build the xml fragment...
2
by: scottbvfx | last post by:
Hi, I'm trying to launch a web browser along with an html file with a fragment identifier in its path. I'm using the webbrowser module for this. ie....
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.