Hmmm ...
a ) This line does'nt have any resolver or evidence either.
xslt.Load(xsltHTML.DocumentElement.CreateNavigator(), null, null);
Try change it to
xslt.Load(xsltHTML.DocumentElement.CreateNavigator(), new XmlUrlResolver(),
this.GetType().Assembly.Evidence);
Suggest you read up on the Evidence section of the load method to decide
which evidence method is right for your application.
b) I'm curious about your XSLT. I don't think passing document() as a
parameter value will yield what you are looking for. The only way I have
been successful, is to pass only the filename as the parameter. Then in
the XSLT you can pass the paramter variable to the document function, to
yeild a node-set.
E.g.
Changing the AddParam line to below ...
xslArg.AddParam("varAdvanced", "", advancedOptionsFile);
In the XSLT doing ...
....
<xsl:param name="varAdvanced"/>
<xsl:apply-templates match="/">
<xsl:for-each select="document($varAdvanced)">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:apply-templates>
....
If you success in passing parameter any other way, please share it with the
group. I will be interested in learning from your experience.
Hope this helps,
-Naraen
---
[quoted text, click to view] "Cathie" <someone@miscrosoft.com> wrote in message
news:%23LaAv%23CHEHA.688@tk2msftngp13.phx.gbl...
> Thanks for your response. It still doesn't work. Any other ideas?
>
> Cathie
>
>
> "NaraendiraKumar R. R." <naraendira@nospam.com> wrote in message
> news:uisYdf$GEHA.1240@TK2MSFTNGP12.phx.gbl...
> > You are attempting to use an external document in an XSLT. It is a
> security
> > issue.
> >
> > Try changing this line of code
> > xslt.Transform(xmlSimplified.DocumentElement.CreateNavigator(), xslArg,
> > writer, null);
> > to
> > xslt.Transform(xmlSimplified.DocumentElement.CreateNavigator(), xslArg,
> > writer, new XmlUrlResolver());
> >
> > -Naraen
> >
> > ----
> > "Cathie" <someone@miscrosoft.com> wrote in message
> > news:%23hzqPE7GEHA.2084@TK2MSFTNGP10.phx.gbl...
> > > Hi All,
> > >
> > > I am trying to get my style sheet to work. It works fine in IE but I
> > can't
> > > get it to work in .net.
> > >
> > > Below is the function I use for transforming, where
advancedOptionsFile
> is
> > > the path to the file containing an XML document required by the
> > > transformation, and xmlSimplified is the XML document to trasform.
> >
>
> --------------------------------------------------------------------------
> > --
> > > -------------------------------
> > >
> > > string strHTML = String.Empty;
> > >
> > > XmlNamespaceManager nsmgr = XmlaWrapper.ReturnXmlaNameSpaceManager();
> > >
> > > // Retrieve the XSLT to transform
> > >
> > > XmlDocument xsltHTML = new XmlDocument();
> > >
> > >
> >
>
xsltHTML.LoadXml(Utilities.GetResource("ZapOLAP.xsltMDXtoHTMLAdvanced.xslt")
> > > );
> > >
> > > XslTransform xslt = new XslTransform();
> > >
> > > xslt.Load(xsltHTML.DocumentElement.CreateNavigator(), null, null);
> > >
> > > // Add the Advanced Formatting XML document as a parameter
> > >
> > > XsltArgumentList xslArg = new XsltArgumentList();
> > >
> > > xslArg.AddParam("varAdvanced", "", "document('" + advancedOptionsFile
+
> > > "')");
> > >
> > > using(StringWriter writer = new StringWriter())
> > >
> > > {
> > >
> > > xslt.Transform(xmlSimplified.DocumentElement.CreateNavigator(),
xslArg,
> > > writer, null);
> > >
> > > strHTML = writer.ToString();
> > >
> > > }
> > >
> > > return strHTML;
> > >
> >
>
> --------------------------------------------------------------------------
> > --
> > > -------------------------------
> > >
> > > If I extract the XSLT and XML (adding a xsl statement to the top of
the
> > XML
> > > file) and open my xml file in IE, the results occur as they should,
but
> > not
> > > when transforming using the above method. The information from the
> > > advancedOptions file seems to be ignored.
> > >
> > > Any ideas in what I am doing wrong?
> > >
> > > Thanks in Advance
> > >
> > > Cathie
> > >
> > >
> >
> >
>
>