Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Converting a xml STRING displaying a long date, to dd/mm/yyyy [Thread Next] Re: Converting a xml STRING displaying a long date, to dd/mm/yyyyTo: NULL Date: 12/22/2008 9:50:00 AM
"Savvoulidis Iordanis" <SavvoulidisIordanis@d...> wrote
in message news:993BFFF4-D452-4014-B788-AE0B8458E810@m......
>
> I tried to execute the transformation using the XML excerpt I sent
> previously and the XSL you posted inside an ASP.NET (vb) page.using the
> following code:
>
>
>
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs)
> Handles Me.Load
>
> Dim xsl As New XslCompiledTransform
>
> xsl.Load(Server.MapPath("~/XSLTFile.xslt"))
> xsl.Transform(Server.MapPath("~/XMLFile.xml"),
> Server.MapPath("~/XMLCSV_file.csv"))
>
> End Sub
>
> but I get the message
> "Execution of the 'document()' function was prohibited. Use the
> XsltSettings.EnableDocumentFunction property to enable it. An error
> occurred
> at ..."
>
>
I was waiting for that one :)
The error message is quite clear, using document() function is a potential
security/resource risk as external documents can cause problems. Here it
doesn't matter as you're only using it to read the current XSLT. So you use
the XsltSettings class to allow this:
http://msdn.microsoft.com/en-us/library/system.xml.xsl.xsltsettings.aspx
You need new XsltSettings(True, False) to allow document function but not
scripts.
--
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
