xslcompiledtransform

How to resolve XSL includes in a Transformation that loads XSL from a String?

不羁岁月 提交于 2020-01-02 03:17:26
问题 .NET 2.0/VS2005 I am trying to use the XslCompiledTransform class to perform a XSL Transformation. I have two XSL files, the first of which includes a reference to the other in the form of an <xsl:include> statement : Main.xsl: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:include href="Included.xsl" /> ... ... </xsl:stylesheet> Now, If I could load the "Main.xsl" file itself as a URI, my transformation code would be as simple as : // This is a function

Dynamic XSL file

别来无恙 提交于 2019-12-25 02:57:45
问题 I have 3 XSL files which have paths in them to something like C:\templates\Test\file.pdf This path isn't always going to be the same and rather than having it hard coded in the XSL, I'd like it so that the path C:\templates\test\ is replaced with a tag [BASEPATH] and when I read in the xsl file into the XSLTransform object (yes I know it's been deprecated, I may move over to the XSLCompiledTransform at the same time), I'd like the tag [BASEPATH] to be replaced with the absolute file path of

How to sort the elements (columns) in xslt to transform the xml file to csv format

泪湿孤枕 提交于 2019-12-24 00:05:49
问题 <?xml version="1.0" encoding="utf-8"?> <Report p1:schemaLocation="Customer details http://reportserver?%2fCustomer details&rs%3aFormat=XML&rc%3aSchema=True" Name="Customer details" xmlns:p1="http://www.w3.org/2001/XMLSchema-instance" xmlns="Customer details"> <table2> <Detail_Collection> <Detail Col1="aaa" col1_SeqID="2" col1_Include="1" Col2="aaa" col2_SeqID="1" col2_Include="1" Col3="aaa" col3_SeqID="" col3_Include="0" Col4="aaa" col4_SeqID="4" col4_Include="1" Col5="aaa" col5_SeqID="" col5

XslCompiledTransform and custom XmlUrlResolver: “An entry with the same key already exists”

五迷三道 提交于 2019-12-22 07:28:19
问题 Is there a way to debug XSLT documents that are loaded from a database by a custom XmlUrlResolver or does anyone know, what the errormessage below is about? I have a XSLT stylesheet that imports a common xslt document: <xsl:import href="db://common.hist.org"/> The Scheme is handled by a custom XmlResolver that loads the XSLT document from a DB, but I get an error: An entry with the same key already exists. The common XSLT document referred to by the xsl:import contains some common XSLT

StackOverflowException loading XsltCompiledTransform

元气小坏坏 提交于 2019-12-21 12:14:02
问题 i have some big xslt crashing iis (StackOverflowException) when loading an XslCompiledTransform while the old (deprecated) XslTransform works fine. Is there some known issue with big templates? Strangely enough, the same XslCompiledTransform loads successfully in a win32 application. 回答1: Ahh, you know the problem here is more due to IIS (I assume that it is a web app as you are trying it in a Win app too). IIS (from Win2003 onwards) 'stupidly' only reserves a quarter of the normal stack

Merging two XPathDocuments using XmlCompiledTransform

给你一囗甜甜゛ 提交于 2019-12-12 18:12:40
问题 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 two documents. I know that XslCompiledTransform turns off the XSL document() function by default. I have turned that on using XsltSettings when I create my

XslCompiledTransform.Load raises Object reference not set to an instance of an object

为君一笑 提交于 2019-12-12 02:50:24
问题 While loading xslt in XslCompiledTransform, I am getting Object reference not set to an instance of an object. I fetched following xslt from database: - <xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"> <xsl:template match=\"/\"> <html> <body> <h2>My CD Collection</h2> <table border=\"1\"> <tr bgcolor=\"#9acd32\"> <th style=\"text-align:left\">Title</th> <th style=\"text-align:left\">Artist</th> </tr> <xsl:for-each select=\"catalog/cd\"> <tr> <td> <xsl:value

fastest in-memory cache for XslCompiledTransform

可紊 提交于 2019-12-08 01:46:50
问题 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

Problem with XSL sorting

给你一囗甜甜゛ 提交于 2019-12-07 15:50:32
问题 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

How do I resolve <xsl:import> and <xsl:include> elements with relative paths when using xsltc.exe XslCompiledTransforms?

风流意气都作罢 提交于 2019-12-07 06:31:58
问题 As part of our web application's build process, I have set up our XSLT stylesheets to be built with Microsoft's xsltc.exe compiler whenever we run a full compile. During local development this has worked great, as the code is compiled and hosted in the same location. However, once this was put on the build server, problems arose. The build server will compile the XSLT stylesheets just like I do locally, but then a script runs that deploys the compiled code to our internal staging web server.