Question XSLT Transformations: Using document() in XSL

stats

Member
Joined
Jan 15, 2009
Messages
11
Programming Experience
1-3
I was able to get my transformations to work thanks to this site but now I'm having a new problem. All of my files worked locally but when I moved them to the server the ones that use document() in the XSL to open another XML will not run. This is my file structure:

MAIN DIR: two dirs - league and dropbox (virtual dir)
league contains my .net and xsl files
dropbox is a virtual directory that contains all the XMLs

The only thing I'm seeing on this problem is using XmlResolver but I can't find out what I'm supposed to do with it. It says it should be the 4th parameter on my transform function?

VB.NET:
transformer.Transform(Server.MapPath("../dropbox/league/TEAM_INFO.XML"), args, Response.OutputStream, New XmlUrlResolver())

My xsl (which works fine) opens the file like this:
VB.NET:
<xsl:variable name="xmlTeams" select="document('TEAM_INFO.XML')"/>
 
All of my files worked locally
Do you mean when loading the transformed xml directly to browser, or with the XslCompiledTransform ?
When debugging the latter locally I get this error when loading the xsl document:
Execution of the 'document()' function was prohibited. Use the XsltSettings.EnableDocumentFunction property to enable it.
After enabling this setting the transformation runs as expected, as it does when loading the xml with a xsl transform directly in browser.
The only modification I did to code was this:
VB.NET:
transformer.Load(Server.MapPath("display.xsl"), New System.Xml.Xsl.XsltSettings(True, False), Nothing)
 
Back
Top