473,413 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 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 2058
* 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....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.