![]() |
|
|
|||||||
![]() |
XML - possible to use an environmental variable to address the XSL file path? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
I'm just wondering, is there a way I could use an environmental
variable in an XML file to specify the path of its XSL file? something like <?xml-stylesheet type="text/xsl" href="%test%\test.xsl" ?> Kourosh |
|
|
|
|
#2 |
|
Posts: n/a
|
Kourosh wrote:
> I'm just wondering, is there a way I could use an environmental > variable in an XML file to specify the path of its XSL file? XSLT itself can't access the system's environmental variables. The usual solution is to use your XSLT processor's command-line options (or API, if you're invoking it from another program) to pass the value of the environment variable in as a stylesheet parameter. The exact syntax varies depending on the processor. Alternatively, you could write an extension function that retrieves environment variable values. But that might have to be recoded if you ever want to run on another processor. -- () ASCII Ribbon Campaign | Joe Kesselman /\ Stamp out HTML e-mail! | System architexture and kinetic poetry |
|
|
|
#3 |
|
Posts: n/a
|
.... Oh. I misread. You want to use the variable in the path to find the
stylesheet in the first place. The simple answer to that one is "no, or at least you can't count on it". The more complicated answer is that this is a question of how the specific tool (browser or whatever) interprets that processing instruction. Some may let a user/developer plug in code that can help them process URIs (a "URI Resolver"); others may have other ways of handling this; others will simply not handle it. But this inability to implicitly/automatically retrieve environment variables is probably a Good Thing. I don't _want_ downloaded files accessing anything else on my system unless I explicitly give them permission to do so; that would be a security/privacy issue. -- () ASCII Ribbon Campaign | Joe Kesselman /\ Stamp out HTML e-mail! | System architexture and kinetic poetry |
|