![]() |
|
tsbaseuri |
Longname: | t s tream base u niform r esource i dentifier | ![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Released: | 8.10w | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Created: | 8.10w |
Summary |
In order to provide a strict method for resolving any relative paths provided to the libxml parser through URI's, a new macro and area has been created that allow you to specify a stream level baseURI for libxml. It is possible to set the base level URI for a streamwith the tsbaseuri macro. |
Example extract |
Syntax
|
stream:s base path:s
|
stream:s |
stream name to apply the base URI. |
base path:s |
URI to apply. |
This base area can then be accessed anywhere throughout 3B2 by using a new area of the form{Þstrm} where "strm" is the name of the stream to get the base path from. The equivalentURI in libxml is "x3b2://type=strmbase;name=strm/". |
It is also possible to set a global default across 3B2 by putting the base path into a system variable "OE_libxml_system_base", although this method is not recommended as it is not unique to each document. |
When libxml is required to resolve a relative path, it picks the first valid URI it finds checking the following things in order: |
|
Note that if 2) contains an encoding in theURI (e.g. {:xml-auto}),the encoding will be ignored when calculating the new filename, andwill need to be respecified in the new URI if still required. |
If for some reason these rules do not result in a valid absolute URI, then an error will be generated. However, as the final step resolves to the directory the document was opened from, this is unlikely to happen. |
The area "{ }" (or "x3b2://type=strmbase/") follows these rules to calculate which final URI to resolve to. |
XML Base |
Should the baseURI need to change in the middle of the XML document, it is possible to override the standard path resolution steps using XML Base. To make use of this, specify an attribute |
|
On the required element, and any relative URIs specified on child elements will try and resolve to this path first before following the standard rules. |
Document created on 01-Sep-2005 (revision 1)