473,385 Members | 2,180 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,385 software developers and data experts.

Question about xml:base

What can be and what should be xml:base attribute?
Should/can it end with a slash? What to do if it
doesn't end with a slash?

If xml:base="http://xxx.org/aaa/" anything is clear.
But what if xml:base="http://yyy.org/bbb"? Does now
href="a.html" mean http://yyy.org/bbb/a.html or
http://yyy.org/a.html?

As I read the RFC2396 the base URL of
http://zzz.org/a.html is by default http://zzz.org/a.html
what really point to http://zzz.org/.
Then base URL of http://yyy.org/bbb should really point
to http://yyy.org/? I'm messed.
Jul 20 '05 #1
1 1768
In article <20****************************@home.porton.narod. ru>,
Victor Porton <po****@home.porton.narod.ru> wrote:
What can be and what should be xml:base attribute?
It should be the base URI that you want to use for resolving relative URIs
in the document.

Normally the base URI is the URI of the document itself. However,
only the "directory" part of it is relevant for resolving relative
URIs, so it doesn't really matter what appears after the last slash of
the path part.
Should/can it end with a slash? What to do if it
doesn't end with a slash?
When resolving relative URIs, the part after the last slash of the
path part is removed and replaced with the relative URI. So these are
the effectively the same:

http://example.org/foo/bar/baz
http://example.org/foo/bar/

and are different from

http://example.org/foo/bar

If you use them to resolve "one/two" you will get

http://example.org/foo/bar/one/two

in the first two cases, and

http://example.org/foo/one/two

in the third.
If xml:base="http://xxx.org/aaa/" anything is clear.
But what if xml:base="http://yyy.org/bbb"? Does now
href="a.html" mean http://yyy.org/bbb/a.html or
http://yyy.org/a.html?


The latter.

(By the way, if you use your web browser to fetch a directory without
putting the slash on the end, the server sends a redirect to the name
with a slash added, so that relative URIs will work. In most web
browsers you can see the slash appear after you hit return.)

-- Richard
Jul 20 '05 #2

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

Similar topics

4
by: David | last post by:
Hello , I'm trying to parse an XML document a get spicific tags such as email in the code below. I'm using xerces 2.4. However I don't manage to get the value for the email. Can anybody help. ...
4
by: annoyingmouse2002 | last post by:
Hi there, sorry if this a long post but I'm really just starting out. I've been using MSXML to parse an OWL but would like to use a different solution. Basically it reads the OWL (Based on XML)...
21
by: Jure Sah | last post by:
Hello, I have been promising an object orientated ASM IDE for a while now. Trying to make the best of what is already here, I have made a compiler, that will parse XML code and output ASM files....
1
by: Kevin | last post by:
I have the following Xml document (see end of post) with many external resources that need to get resolved. When I "view" the Xml document in Internet Explorer (Windows XP SP2, IE 6.0.2900) all of...
0
by: Frederico Guimar?es via DotNetMonster.com | last post by:
Hi, I'm trying to use the Microsoft.Web.Services2.Messaging. ISoapFormatter but I receive this error: System.Xml.XmlException: The root element is missing. at System.Xml.XmlTextReader.Read()...
1
by: ankit | last post by:
There are various packages availaible for XML processing using python. So which to choose and when. I summarized some of the features, advantages and disadvantages of some packages int the...
4
by: Gustaf Liljegren | last post by:
I'm reading a document with the XmlTextReader, and I want to make it XML Base aware, so I need to implement this somehow. What's the most effective way of doing it? I imagine having a variable...
4
by: Terry Olsen | last post by:
I use the following code to create an XML string: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim tw As New StringWriter Dim xml...
8
by: SL | last post by:
I try to validate against a schema a document stored in several files thanks to external entities. The parseur add a 'xml:base="url"' attribute on the root element of this sub-trees during parsing,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.