473,623 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1785
In article <20************ *************** *@home.porton.n arod.ru>,
Victor Porton <po****@home.po rton.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
11541
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. thanks in advance, david ---------------
4
4257
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) and puts values in a number of arrays and then puts the contents of the array in a HTML table. I'd like to keep the array structure. I've checked out all sorts of different javascript parsers but have not met with a great deal of success with any...
21
2285
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. The program still needs an internet interface (will do that tommorow), but here is an example of what the code looks like, to wet your appetite: <?xml version="1.0"?>
1
1231
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 the external resources and namespaces are resolved properly. However, when trying to load the document in an XmlDocument object in .NET 1.1.4322, I receive the following error: Prefixes beginning with "xml" (regardless of whether the...
0
3332
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() at Microsoft.Web.Services2.Xml.XmlSkipDTDReader.Read() at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
1
1623
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 following text. Have a look to it. May this get out of the dillema of choice. Here we go: OPTIONS ========= - libxml2
4
1206
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 that's keeping the current base URI, and then look for an xml:base attribute at every new start element, and update the variable if needed. Would that be all? I know some have made useful extensions to the System.Xml namespace, but I'm not...
4
1875
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 As New XmlTextWriter(tw) xml.WriteStartDocument() xml.WriteStartElement("StartElement") xml.WriteElementString("ElementString", "TheElement") xml.WriteEndElement()
8
2267
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, so the validation of the document fails. Is there a recommanded solution to this situation ? I have no idea how to handle the problem: I don't want to take into account at the vocabulary level a question of syntax (the external entities) by...
0
8227
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8670
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8613
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8326
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8469
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4074
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4164
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1473
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.