XslTransform works but all 'http' links from XSL file failed
Posted on 2003-11-17
I am trying to make some interface to xsl transfromation from C#.
My last function was:
public static void Transform(ref spXmlDoc, string sXslFile)
XmlDocument spXslDoc = new XmlDocument();
XslTransform oXslTransform = new XslTransform();
// thats my function that successfully loads xml files to xmldocument object
XmlUtils.XmlFileLoad(ref spXslDoc, sXslFile);
StringWriter oStringWriter = new StringWriter();
XmlResolver oResolver = new XmlResolver();
oXslTransform.Transform(spXmlDoc.DocumentElement, null, oStringWriter, oResolver);
So as I meant it works but only for 'local' files called from xsl.
if in the xsl there is something like that:
<!-- getting http base address from local files -->
<xsl:variable name="home" select="document('const.xml')/Constants/Address" />
<xsl:variable name="ClientProps" select="document(concat($home, 'properties.asp'))"/>
it's stopping. (I've checked that xsl on XMLSPY 5 Professional, it worked.)
So I'm sure there is something here about resolving url's, credentials and something else. But how to fix it?