Most web scripting languages are not able to
correctly handle relative URL resource names embedded in fragments because
the current directory depends on the location where an enclosing dynamic
page is executed.
Relative URL can be used if all enclosing web files are in
the same folder as the fragment in which the URL is defined and no decision
center is shared between web files.
Netsilon provides a System variable displayer - a
decision center - that can be inserted before an URL relative to the
document root and that will return the document root (root path) at
execution time. See System variable
displayer .
In order to handle relative URL, Netsilon provides also
a mean to filter the HTML source to find a sequence of characters and replace
it with a new sequence. Filters can be defined in a web file or zone or can be
inherited from parent web folders.
A filter is defined by :
- a perl-like regular expression that describes the sequence of characters to find
- a sequence of characters that will replace the sequence of characters that matches the regular expression.
The substitution string can contain specific escape sequences:
- \1 to \7: replaced by the characters that match the n-th expression between parenthesis in the regular expression
- \ElementPath: replaced by the absolute path to the parent folder of the considered web element (root path and parent folder pathes)
- \ServerName: replaced by the server name property of the current Deployment site.
- \RootPath: replaced by the root path property of the current Deployment site.
- \TargetLanguageExtension: replaced by the target language extension property of the current Deployment site.
For example, the regular expression \.\.\/(images\/) will match
every sequence of characters like ../images/. The substitution string \ElementPath\1
will replace the matched sequence by /parentfolder/images/ if the considered web file
is contained in the root web folder parentfolder and the root path is /.