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

Posted on 2003-11-17
Last Modified: 2010-04-16
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?
Question by:jhully
  • 3
  • 2
LVL 12

Expert Comment

ID: 9779828

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

Secure XSL Transformations in Microsoft .NET

LVL 12

Accepted Solution

vascov earned 250 total points
ID: 9797905
Did the article help ?

Need further assistance ?


Author Comment

ID: 9803714
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?
LVL 12

Expert Comment

ID: 9807453

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


Author Comment

ID: 9808746
You absolutely right

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Sending a Secure fax is easy with eFax Corporate ( First, just open a new email message. In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now