Link to home
Start Free TrialLog in
Avatar of jhully
jhully

asked on

XslTransform works but all 'http' links from XSL file failed

Hello.
I am trying to make some interface to xsl transfromation from C#.
My last function was:
//loads
public static void Transform(ref spXmlDoc, string sXslFile)
{
    XmlDocument spXslDoc = new XmlDocument();
    XslTransform oXslTransform = new XslTransform();
    oXslTransform.Load(sXslFile);
//  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);
    spXmlDoc.LoadXml(oStringWriter.ToString());
}
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?
Avatar of vascov
vascov
Flag of United States of America image

Hi,

Have a look at this article, i believe it addresses your concern

Secure XSL Transformations in Microsoft .NET
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml/html/xml07212003.asp

HTH
ASKER CERTIFIED SOLUTION
Avatar of vascov
vascov
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jhully
jhully

ASKER

Really, yes... But I am still trying to build some more usable and comortable interface. Could we continue after I'll send the points to you?
Hi,

Of course we can, but if the question is answered it's fair to give me the points, right ? :)

Regards
Avatar of jhully

ASKER

You absolutely right