tags:

views:

79

answers:

2

Mysticism.

I use XSLT for reception of the address for the reference.

<a href="{element/url}"/>

In XML i have:

<element>
    <url>www.mysite.ru</url>
</element>

As a result on page I receive:

<a href="www.currentsite.ru/cursection/cursubsection/www.mysite.ru"/>

That is: in the beginning there is an address of a current site (the address of current section where we now are), and then there is a reference to an external site.

There can be it any problem with metatag BASE?

In what a trouble?

+5  A: 

Most likely the URL you see is what is interpeted by the browser as the final URL .. in the source code it most likely is as you want it ...

in HTML, the hrefs if they do not start with a protocol (http, ftp, mailto ..etc) then they are interpeted as relative urls.. which means relative to where the current url is..

either change the

<a href="{element/url}"/> to <a href="http://{element/url}"/&gt;

or the

<element>
    <url>www.mysite.ru</url>
</element>

to

<element>
    <url>http://www.mysite.ru&lt;/url&gt;
</element>
Gaby
@Gaby: Thanks for detailed, an understandable explanation.
Kalinin
@kalininew, no worries. Glad it worked :)
Gaby
+3  A: 
<url>www.mysite.ru</url>

Ceci n'est pas une URL.

That's a hostname. If you want to turn it into an absolute URL you will have to add http:// to the front. Otherwise, as a relative URI in href, it's just a pointer to the file called www.mysite, with file extension .ru, in the current folder.

bobince