473,386 Members | 1,842 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,386 software developers and data experts.

XSLT namespace question

As the XSLT namespace is declared to be used in XSL documents like this:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

, isn't this a risky practice as it refers to an external web site and if
that web site is down at a particular time or is moved to another place,
then even large web sites referring to it may fall down with it. So, is it
possible to obtain a local copy of such a namespace and refer to it in
further applications as

<xsl:stylesheet version="1.0"
xmlns:xsl="http://localhost/XSL/Transform">

or in a similar way? Which files are important and where to obtain them?
Mikko Nummelin
Jul 20 '05 #1
6 2369
On Thu, 20 Nov 2003 22:19:37 +0200, Mikko Nummelin
<mn******@EI.cc.ROSKAA.hut.fi> wrote:
As the XSLT namespace is declared to be used in XSL documents like this:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

, isn't this a risky practice as it refers to an external web site and
if that web site is down at a particular time or is moved to another
place, then even large web sites referring to it may fall down with
it. So, is it possible to obtain a local copy of such a namespace and
refer to it in further applications as
the string attached to a namespace definition is just that -- an
arbitrary string. The engine doesn't download anything from a URI that
may be in that string. If w3 deletes that directory it will have *no*
effect on your processing.

It is customary to base the namespace key on the web site of the
creator, and to have documentation on the components of the namespace at
that location, but it is not required.

When processing XML data in a program, most (I can't say all) libraries
will provide things in the form of (name,namespace). What your program
will see is actually something more like ('template',
'http://www.w3.org/1999/XSL/Transform') than 'xsl:template'. If it
isn't in the namespace identified by that URI, an XSLT engine won't
recognize the element as being XSLT.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://localhost/XSL/Transform">

or in a similar way? Which files are important and where to obtain
them?


there are no files to obtain. A namespace is little more than a
qualifier used to correctly identify an XML component.
Keith
--
Keith Davies "Your ability to bang your head against
ke**********@kjdavies.org reality in the hope that reality will
crack first is impressive, but futile"
-- Geoffrey Brent, rec.games.frp.dnd
Jul 20 '05 #2
On Thu, 20 Nov 2003, Keith Davies wrote:
On Thu, 20 Nov 2003 22:19:37 +0200, Mikko Nummelin
As the XSLT namespace is declared to be used in XSL documents like this:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

, isn't this a risky practice as it refers to an external web site and
if that web site is down at a particular time or is moved to another
place, then even large web sites referring to it may fall down with
it. So, is it possible to obtain a local copy of such a namespace and
refer to it in further applications as the string attached to a namespace definition is just that -- an
arbitrary string. The engine doesn't download anything from a URI that
may be in that string. If w3 deletes that directory it will have *no*
effect on your processing. It is customary to base the namespace key on the web site of the
creator, and to have documentation on the components of the namespace at
that location, but it is not required. When processing XML data in a program, most (I can't say all) libraries
will provide things in the form of (name,namespace). What your program
will see is actually something more like ('template',
'http://www.w3.org/1999/XSL/Transform') than 'xsl:template'. If it
isn't in the namespace identified by that URI, an XSLT engine won't
recognize the element as being XSLT. <xsl:stylesheet version="1.0"
xmlns:xsl="http://localhost/XSL/Transform">

or in a similar way? Which files are important and where to obtain
them?

there are no files to obtain. A namespace is little more than a
qualifier used to correctly identify an XML component.


Sorry for my stupidity. IMO, using variable or file names of that type is
extremely misleading and comparable to a malpractice of naming the further
Linux kernel gzip packets in a way like

http://www.microsoft.com/2.6.1

/dev/null/2.4.27heydude

, which are, well, valid UNIX file names, but ...
Mikko Nummelin
Jul 20 '05 #3
In article <Pi********************************@kosh.hut.fi> ,
Mikko Nummelin <mn******@EI.cc.ROSKAA.hut.fi> wrote:

[About the convention of using http: urls for name spaces]

% Sorry for my stupidity. IMO, using variable or file names of that type is
% extremely misleading and comparable to a malpractice of naming the further
% Linux kernel gzip packets in a way like

% http://www.microsoft.com/2.6.1
%
% /dev/null/2.4.27heydude
%
% , which are, well, valid UNIX file names, but ...

The problem is that you need to have a globally unique identifier. What
would you like to use, that you can guarantee nobody else will use, or
at least you can claim they're not being reasonable if they do use it?
People started using http: protocol URIs because the network address
is guaranteed to be unique and people can reasonably expect to
control the URIs associated with addresses that they `own'.

Someone could have defined a protocol for name spaces, like

ns://www.w3.org/1999/XSL/Transform

and saved everyone a lot of trouble, because the convention of putting
documentation at the web address used for name-spaces only arose _after_
lots and lots of people just assumed they'd find documentation there,
and raised a fuss.

Anyway, I think it's more confusing than misleading (certainly not
`extremely misleading'. I have no idea what your analogy is supposed
to mean (it's also confusing), but it seems likely that it's not
particularly apt. Nothing has been mislabled, there's just a URI
being used in a context which doesn't suggest there are any resources
assoicated with it, and which has no resources associated with it.
--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #4
> Sorry for my stupidity. IMO, using variable or file names of that type is
extremely misleading and comparable to a malpractice of naming the further
Linux kernel gzip packets in a way like

http://www.microsoft.com/2.6.1

/dev/null/2.4.27heydude

, which are, well, valid UNIX file names, but ...

Namespaces are used in programming languages -- C++ or C# -- what's so
"misleading" about this? This is a useful feature. One needs to read more
before making striking statements...
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Jul 20 '05 #5
In article <Pi********************************@kosh.hut.fi> ,
Mikko Nummelin <mn******@EI.cc.ROSKAA.hut.fi> wrote:
Sorry for my stupidity. IMO, using variable or file names of that type is
extremely misleading and comparable to a malpractice of naming the further
Linux kernel gzip packets in a way like

http://www.microsoft.com/2.6.1


Obviously it would be unwise to use Microsoft's domain name to name
Linux objects :-)

But the point of using URIs is that it's easy to construct names that
will be unique, by using your own domains. All W3C namespace names
are URIs beginning http://www.w3.org, for example. There's no need
for a registry of namespace names, and it's easy to see who is
responsible for the namespace.

Whether there is anything at the location specified by the URI is up
to you. Often there is a schema, or a RDDL file, or a textual
description of the namespace. Again, it would be unwise to put an
unrelated document there. But the main purpose of namespaces is to
disambiguate names, and for that purpose there is no need to
dereference the name at all.

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
Jul 20 '05 #6
I like the convention of being able to browse to a given XML namespace URI
and read up on what this namespace is all about. For example, there are
web pages at http://www.w3.org/1999/XSL/Transform, I think this is cool --
it is the ultimate in global online help for programmers. There's even
opportunities here for folks to provide richer web sites with their schemas,
provide a list of tools that know how to process that namespace and so on.
"Patrick TJ McPhee" <pt**@interlog.com> wrote in message
news:bp**********@news.eusc.inter.net...
In article <Pi********************************@kosh.hut.fi> ,
Mikko Nummelin <mn******@EI.cc.ROSKAA.hut.fi> wrote:

[About the convention of using http: urls for name spaces]

% Sorry for my stupidity. IMO, using variable or file names of that type is % extremely misleading and comparable to a malpractice of naming the further % Linux kernel gzip packets in a way like

% http://www.microsoft.com/2.6.1
%
% /dev/null/2.4.27heydude
%
% , which are, well, valid UNIX file names, but ...

The problem is that you need to have a globally unique identifier. What
would you like to use, that you can guarantee nobody else will use, or
at least you can claim they're not being reasonable if they do use it?
People started using http: protocol URIs because the network address
is guaranteed to be unique and people can reasonably expect to
control the URIs associated with addresses that they `own'.

Someone could have defined a protocol for name spaces, like

ns://www.w3.org/1999/XSL/Transform

and saved everyone a lot of trouble, because the convention of putting
documentation at the web address used for name-spaces only arose _after_
lots and lots of people just assumed they'd find documentation there,
and raised a fuss.

Anyway, I think it's more confusing than misleading (certainly not
`extremely misleading'. I have no idea what your analogy is supposed
to mean (it's also confusing), but it seems likely that it's not
particularly apt. Nothing has been mislabled, there's just a URI
being used in a context which doesn't suggest there are any resources
assoicated with it, and which has no resources associated with it.
--

Patrick TJ McPhee
East York Canada
pt**@interlog.com

Jul 20 '05 #7

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

Similar topics

1
by: Harry Zoroc | last post by:
I would like to treat an xsd Schema file as XML file and to display the targetNamespace and all the imports. That's it. But the following does not work. Why? I did not enter the stylesheet in the...
3
by: Grant Harmeyer | last post by:
I have an XSL file that is being applied to an RSS feed, and it works great except for 2 things: 1.) XSL doesn't close the <img> tag for xhtml even though I have it being closed in the XSL file...
7
by: pintihar | last post by:
Hi, As a follow on from an earlier post I have another question about xslt. Is it possible to create the stylsheet programatically? Is this sensible? In the first phase I needed to map element...
1
by: Nick | last post by:
I am working on a website for a client and one of their requirements was to have a mailing list. I decided to XSLT to transform "templates" to HTML so that editing was very easy and less time...
10
by: Andy Fish | last post by:
hi, I have an XSLT which is producing XML output. many of the nodes in the output tree contain namespace declarations for namespaces that are used in the source document even though they are...
3
by: Chrism2671 | last post by:
I'm new to XSLT/XML and I have a very simple, quick question. i've been trying to convert simple xml files into CSV files and have made a simple XSLT template using the w3 tutorials, but it doesn't...
2
by: daydreaming | last post by:
Hi again, I have one more question to inquiry from you guys that if I want to want to use XSLT copying from xml containing namespace to a new xml without namespace. How can I do it. I have written...
6
by: kluge.wolfram | last post by:
Hi, i get stucked on a transformation problem using XSLT. What i need is to copy an XML Tree to an output XML without any automatic changes. Since i used <xsl:copyor <xsl:copy-ofthere occur...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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,...

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.