This is a general XML question, hope this is the good list. first post here.
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 :
<igs:xslt href="">
<igs:xslt href="">
<igs:xslt href="" xml:base="."/>
<igs:xslt href="">
</p:pipeline>
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 :
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").
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.
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 :
<p:pipeline>
<igs:xslt href="" />
</p:pipeline>
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">
<igs:xslt href="">
<igs:xslt href="">
<igs:xslt href="" xml:base="#id_root"/>
<igs:xslt href="">
</p:pipeline>
</p:library>
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 !
Cheers
--
Matthieu Ricaud-Dussarget
IGS-CP - Développeur XML
05 45 37 09 49