xslcompiledtransform

.NET Xsl script transform results in 'System.Object' is not defined or imported

Hi XSL noobie but uttery stuck! I have a transform that formats a date using c# scripting function , this works fine when I am in VS 2008 and run "show xml output", the output is exactly what I want. However , when i try to run this using code I get the error Predefined type 'System.Object' is not defined or imported To funct...

Hyphen in method name, is it possible in any .NET language ?

I need to support a method named 'send-request' as an extension function to be used in an XSLT transformation. This is provided by an extension object on XslCompiledTransform. The cool thing about extension objects vs. <msxsl:script> is, well, that I don't have to use <msxsl:script>, you just declare the namespace and call the function. ...

Merging two XPathDocuments using XmlCompiledTransform

I can't possibly be the first person to do this, it seems like it would be such a common practice to merge two documents using XSLT. However, I can't seem to find a single example on the ol' interweb. I have two XML documents that are being retrieved as strings of XML from SQL Server. I want to use XslCompiledTransform to merge the tw...

How to retrieve xsl:output media-type value from xsl file via ASP.NET

Is there a way to retrieve the media-type value? e.g. like OutputSettings.OutputMethod used to get xsl:output method. ...

How to migrate from XslTransform to XslCompiledTransform

I have the following code that I need to migrate from VS 2003 (.Net 1.1) to VS 2008 (.Net 2+) but I get compilation error - System.Xml.Xsl.XslTransform' is obsolete: This class has been deprecated. I probably need to use System.Xml.Xsl.XslCompiledTransform instead. but I do not find the matching Load() and Transform() overload versions...

XslCompiledTransform fails for XSLT with many xsl:when conditions

I'm just in the process of upgrading a ASP.Net 1.1 application up to .Net 3.5 and one of the changes I've made is to use XslCompiledTransform rather than XslTransform. I was running through some test XSLTs to ensure all was well when I found an XSLT that failed using the new method. After a bit of investigation I found that the XSLT had...

XML size limit for XslCompiledTransform.

Is there any limit for XML size for which XSLT is applied by XslCompiledTransform in .NET (3.5)? Also, is there any limitation for a length of parameteres passed to XSLT? UPDATE: I have ment not the amount of parameters, but the length of a string, which is passed as a parameter and length of an XML text, to which XSLT is applied. ...

How to get the output of an XslCompiledTransform into an XmlReader?

I have an XslCompiledTransform object, and I want the output in an XmlReader object, as I need to pass it through a second stylesheet. I'm getting a bit confused - I can successfully transform some XML and read it using either a StreamReader or an XmlDocument, but when I try an XmlReader, I get nothing. In the example below, stylesheet...

Problem with XElement and XslCompiledTransform

I'm having some trouble using a combination of XElement and XslCompiledTransform. I've put the sample code I'm using below. If I get my input XML using the GetXmlDocumentXml() method, it works fine. If I use the GetXElementXml() method instead, I get an InvalidOperationException when calling the Transform method of XslComiledTransform: ...

How do I include the css file in a XMLtransformation?

I'm creating an html file based on xml and xsl with XslCompiledTransform in c#.net. This works perfectly. But the xsl also has a css file included, and I'm wondering if there is any way to get this css styles included in the output html file, so it can be showed as a standalone file (so I don't have to copy the css file to wherever i wa...

XSL Transformation through code does not result in the same output as XSL transformation done through a tool.

I am transforming my XML file to another XML file using the XslCompiledTransform classes available in the .NET framework 3.5 Here's my code. private static void transformUtil(string sXmlPath, string sXslPath, string outputFileName) { try { XPathDocument myXPathDoc = new XPathDocument(sXmlPath); ...

xslt Parsing in .NET

Hi all, Consider following snippet code for xml. <rootnode> <child id="child1" ><![CDATA[child 1]]></child> <child id="child2" ><![CDATA[child 2]]></child> <child id="child3" ><![CDATA[child 3]]></child> <child id="child4" ><![CDATA[child 4]]></child> <child id="child5" ><![CDATA[child 5]]></child> <child id="chi...

XSLT stripping comments

I have a weird problem. Using XSLT transformations with PHP and for some reason, the compiled template file that is printed to the user strips all comments from the code. This never occurred before and have been unable to debug this problem at all. Even at the source $xslt->transformToXML($xml), it is stripped comments now, when it wasn'...

Cannot set a breakpoint in "main" XSLT file

This is a very irritating bug/behaviour in Visual Studio. I am hoping that someone can tell me how to fix it or what we are doing wrong. The scenario is that we have a program that runs some XSLT over some XML (see code below). There is nothing particularly strange about the code as far as I can tell. This code is run on a new Thread...