xslcompiledtransform

fastest in-memory cache for XslCompiledTransform

不想你离开。 提交于 2019-12-06 04:40:42
I have a set of xslt stylesheet files. I need to produce the fastest performance of XslConpiledTransform, so i want to make in-memory representation of these stylesheets. I can load them to in-memory collection as IXpathNavigable on application start, and then load each IXPAthNavigable into singleton XslCompiledTransform on each request. But this works only for styleshhets without xsl:import or xsl:include. (Xsl:import is only for files). also i can load into cache many instances of XSLCompiledTransform for each template. Is it reasonable? Are there other ways? What is the best? what are

Problem with XSL sorting

丶灬走出姿态 提交于 2019-12-05 20:18:36
I am having a problem trying to sort with an XSL file using the XslCompiledTransform in CLR4.0. Here is my sample XML file (Note: there is a space after the second <foo> element): <?xml version="1.0" encoding="utf-8"?> <reflection> <apis> <api id="A"> <foos> <foo/> </foos> </api> <api id="B"> <foos> <foo/> </foos> </api> </apis> </reflection> When I apply the following XSL file: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"> <xsl:template match="/"> <html> <body> <table> <xsl:apply-templates select="/reflection/apis/api"> <xsl:sort select=

XSLT self-closing tags issue

好久不见. 提交于 2019-11-28 06:50:45
I am using xslt to transform an xml file to html. The .net xslt engine keeps serving me self-closing tags for empty tags. Example: <div class="test"></div> becomes <div class="test" /> The former is valid html, while the latter is illegal html and renders badly. My question is : How do I tell the xslt engine (XslCompiledTransform) to not use self-closing tags. If it's not possible, how can I tell my browser (IE6+ in this case) to interpret self-closing tags correctly. If you are using XmlWriter as your ouput stream, use HTMLTextWriter instead. XMLWriter will reformat your HTML output back to

XSLT self-closing tags issue

眉间皱痕 提交于 2019-11-27 01:38:27
问题 I am using xslt to transform an xml file to html. The .net xslt engine keeps serving me self-closing tags for empty tags. Example: <div class="test"></div> becomes <div class="test" /> The former is valid html, while the latter is illegal html and renders badly. My question is : How do I tell the xslt engine (XslCompiledTransform) to not use self-closing tags. If it's not possible, how can I tell my browser (IE6+ in this case) to interpret self-closing tags correctly. 回答1: If you are using

Passing parameters to XSLT Stylesheet via .NET

懵懂的女人 提交于 2019-11-27 01:07:57
I'm trying to pass a parameter to an XSLT stylesheet, but all i'm getting is an empty xml document when the document is transformed using XSlCompiledTransform. This is the C# method used to add the parameters(after adding in people's suggestions) private static void CreateHierarchy(string manID) { string man_ID = manID; XsltArgumentList argsList = new XsltArgumentList(); argsList.AddParam("Boss_ID","",man_ID); XslCompiledTransform transform = new XslCompiledTransform(); transform.Load("htransform.xslt"); using (StreamWriter sw = new StreamWriter("output.xml")) { transform.Transform("LU AIB.xml

Passing parameters to XSLT Stylesheet via .NET

限于喜欢 提交于 2019-11-26 09:35:14
问题 I\'m trying to pass a parameter to an XSLT stylesheet, but all i\'m getting is an empty xml document when the document is transformed using XSlCompiledTransform. This is the C# method used to add the parameters(after adding in people\'s suggestions) private static void CreateHierarchy(string manID) { string man_ID = manID; XsltArgumentList argsList = new XsltArgumentList(); argsList.AddParam(\"Boss_ID\",\"\",man_ID); XslCompiledTransform transform = new XslCompiledTransform(); transform.Load(

How do I prevent and/or handle a StackOverflowException?

梦想的初衷 提交于 2019-11-26 01:35:56
问题 I would like to either prevent or handle a StackOverflowException that I am getting from a call to the XslCompiledTransform.Transform method within an Xsl Editor I am writing. The problem seems to be that the user can write an Xsl script that is infinitely recursive, and it just blows up on the call to the Transform method. (That is, the problem is not just the typical programmatic error, which is usually the cause of such an exception.) Is there a way to detect and/or limit how many