All the methods I see use files.
I want to create a Xslt transform via code?
Any examples would be great.
Thanks,
Schneider
> Anyone know if there is a way to dynamicly create a Xslt template/s and use
> them as an
> xml transform with-out use files for the Xslt?
>
> All the methods I see use files.
>
> I want to create a Xslt transform via code?
Basically any XSLT stylesheet is just XML document, so of course you can
build it in-memory using XmlDocument. Another common approach is to
generate XSLT stylesheets on the fly using XSLT (again - as XSLT is XML,
the best way to generate/transform it is XSLT itself).
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
I still don't see any way to create a XslTransform from a XmlDocument?
Have any sample code?
Thanks,
Schneider
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:OfrMnap4...@TK2MSFTNGP09.phx.gbl...
All this can be done in RAM without a single read/write to the hard drive.
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"schneider" <00...@0000.SPAM> wrote in message
news:eFYDvpu4...@TK2MSFTNGP15.phx.gbl...
Hmmm, I really wonder why... Have you looked at XslTransform.Load() methods?
There is probably something wrong with the API as you (and you arent'
the first one) can't see that XmlDocument implements IXPathNavigable and
you can just pass XmlDocument instance into the XslTransform.Load() method.
It's as as simple as:
XslTransform xslt = new XslTransform();
xslt.Load(doc);
In .NET 1.1 you'll get compiler warning that you have to pass an
evidence, so use
xslt.Load(doc, null, null);
or
xslt.Load(doc, new XmlUrlResolver(),
Assembly.GetExecutingAssembly().Evidence);
if you need a URI resolving during stylesheet's load (e.g. you are using
xsl:include/xsl:import).