OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
xml:base use-case and questions


This is a general XML question, hope this is the good list. first post here.

Question n°2 is actually quite the same as the one posted here in 1999 : http://markmail.org/thread/sefadcmqpo7b3nyy

Contexte : what I want to achieve is an xml "profile file" for launching a kind of xml pipeline (might be xproc syntaxe... or not).

Ideally we'd like to use xml:base to set every ressources of the apps like this : 

<p:pipeline xml:base="{$XSL_COMMON}">
    <igs:xslt href="">
    <igs:xslt href="">
    <igs:xslt href="" xml:base="."/>
    <igs:xslt href="">
    <igs:xslt href="" xml:base="http://www.igs-cp.fr/net/res/xsl"/>

1. Problematic n°1 : not a question, just a thought... about dynamic evaluation of xml:base

$XSL_COMMON is an environnement variable = file:///D:/res/common/xsl/
This is really usefull because we work with SVN working copies which are located in a different folder for each developper. 
The spec doesn't have to deal with such problematic althought this is one for us.

Our solution : we have setted up a tiny web server with aliases, using http protocol to access common ressources. Then we can write :
<p:pipeline xml:base="http://localhost:777/XSL_COMMON/">

which is well interpreted.

2. Problematic n°2 : 
the 3rd element : 
    <igs:xslt href="" xml:base="."/>
aims at saying : the step3.xsl is in the current working directory (cwd), not in the scope of XSL_COMMON dir.
The cwd should actually be the directory from where the script has been launched.
But to make it simple, let's say the cwd is the directory where this xml "profile file" is located ("containing document").

The spec says (http://www.w3.org/TR/xmlbase/#same-document): 

RFC 3986 defines certain relative URI references, in particular the empty string and those of the form #fragment, as same-document references. Dereferencing of same-document references is handled specially. However, their use as the value of an xml:baseattribute does not involve dereferencing, and XML Base processors should resolve them in the usual way. In particular, xml:base="" does not reset the base URI to that of the containing document.


Some existing processors do treat these xml:base values as resetting the base URI to that of the containing document, so the use of such values is strongly discouraged.

2.1. It seems i shall use xml:base="" instead of xml:base="." althought the http://www.ietf.org/rfc/rfc3986.txt is dealing with ".." and "." as "Dot Segments" for relative URI.

If I understand well, using xml:base="." here should be interpreted relative to the current xml:base scope (which is "http://localhost:777/XSL_COMMON/"). For example xml:base=".." should be resolved to "http://localhost:777/" ?

xml:base="" is a particuliar value (empty string seems not really described in RFC 3986). This lead to the next question about the way to *reset* the base URI.
In my context I want to switch from "http://localhost:777/XSL_COMMON/" to something like "file:///C:/local/res/xsl" that means changing the scheme "http" to "file".
But I want to do it in a generic (relative) way, not by hard write "file:///C:/local/res/xsl" (which is different for each developper)

2.2. "xml:base="" does not reset the base URI to that of the containing document" 

=> OK but is there another way to do that ?

I could avoid xml:base on the containing element and then repeat it on each child  :
    <igs:xslt href="" xml:base="http://localhost:777/XSL_COMMON/"/>
    <igs:xslt href="" xml:base="http://localhost:777/XSL_COMMON/"/>
    <igs:xslt href="" />
    <igs:xslt href="" xml:base="http://localhost:777/XSL_COMMON/"/>
    <igs:xslt href="" xml:base="http://www.igs-cp.fr/net/res/xsl"/>

But this is a pity not to be able to use the xml:base "cascading mecanism" and repeating the same information  many times ...

Maybe I could use #frag instead : 
<p:library id="id_root">
  <p:pipeline xml:base="http://localhost:777/XSL_COMMON/">
    <igs:xslt href="">
    <igs:xslt href="">
    <igs:xslt href="" xml:base="#id_root"/>
    <igs:xslt href="">
    <igs:xslt href="" xml:base="http://www.igs-cp.fr/net/res/xsl"/>

Is this the correct way to do it ? (xml speaking, not xproc)

3. Problematic n°3 : about the influence of xml:base on XML elements/attributes

the spec says : "This specification does not attempt to specify which text strings in a document are to be interpreted as URIs. That is the responsibility of each XML vocabulary".

If my XML vocabulary is bounded to an XML schema which say attribute href type is "xsd:anyURI", is that enought according to the standard (not the implementation) ?

Sorry for the long post and complexity of my thought, I just like to understand well the spec and suggesting a case of use.

Any advices/opinions are welcome !


Matthieu Ricaud-Dussarget
IGS-CP - Développeur XML
05 45 37 09 49

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS