xsltprocessor

Why is that the xsl stylesheet is applied by the browser only when the extension is xml

For Eg. <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="mathml.xsl"?> <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head>...</head> <body> <h1>Example</h1> .... <math xmlns="http://www.w3.org/1998/Math/MathML"&gt; <mi>x</mi><mo>+</mo><mn>3</mn> </math> </body> </html> If the above file is nam...

How to create a XML with a Specific Encoding using XSLT and XMLWRITER

I am trying to apply a XSL style sheet on a source xml and write the output to a target xml file. The xsl removes the xml comments present inside the source xml. The target xml file has UTF-16 encoding in the header. But still i want the output xml to be utf-8 encoding. The code i used is XmlWriterSettings xwrSettings = ...

Speed / Thread Safety / Queuing in XSLTCompiled transform

Hi, I'm pulling my hair out (what remains), with performance issues with XSLTCompiledTransform in our live environments. Locally on developer machines and UAT the problem is slightly noticeable, however in the live environment performance can become agonisingly slow. Background: HTTPModule delivering the website (processModel extend...

How to chain/nest XSL Transforms in .NET

Context: .NET Framework 3.5 I realize how I can perform a single XML transformation using XSLT, but didn't find any good examples on chaining XML transformations. Input: - XML document as XPathDocument. - File paths to multiple XSL files. Expected output: - preferably XPathDocument/IXPathNavigable, representing the XML with all transf...

Ruby error on non-ruby site

A friends of mine have a shared hosting with many sites hosted. There is ruby on rails, php, xslt/xml sites using mysql or postgress. Today one of the xslt sites displays this error: Passenger error #2 An error occurred while trying to access '..../config/environment.rb': Cannot stat '..../config/environment.rb': Permission denied (13) ...

pass Node to Xerces' setParameter()

Hi all, I try pass a node as xsl stylesheet parameter to Xerces XSL Transformer transformer.setParameter("settings", nodeSettings); in xsl: But i receive the following Exception: javax.xml.transform.TransformerException: java.lang.RuntimeException: Invalid conversion of 'com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl'...

C# XSLT Transformation Out of Memory

All, I have the below code for Transforming an XML Document using an XSLT. The problem is when the XML Document is around 12MB the C# runs out of memory. Is there a different way of doing the transform without consuming that much memory? public string Transform(XPathDocument myXPathDoc, XslCompiledTransform myXslTrans) { t...

have domain specified inside the links of pages generated with Umbraco

Not sure the title explains what I want to do, so here goes: I have a website constructed with Umbraco 4.5.x and the links in the pages use relative paths. I want to have the domain prepended to these links and don't know how to do that; I didn't really used Umbraco so I am a newby at this :(. What I want to do is replace links like: <...

Java XML transformation interface

I need to transform a XML. Usually I would use Saxon and a XSLT 2.0 stylehsheet for this. The transformations I have to do involve side-effects and are stateful and manipulate the contens of nodes, so implementing a XPath function doesn't make that much sense. I decided to implement a transformer class for this purpose. I found javax.xm...

xsl param fails in PHP 5.3x

I have an in PHP 5.3 that is failing when something is its contents. For context I do a XSL transformation on one DOMDocument and insert the results as a parameter into another DOMDocument that is then transformed. This has worked fine until now. <h5>lets see: <xsl:value-of select="string-length($content)" /></h5> returns 0. $cont...

Can chrome be made to perform an xsl transform on a local file?

I was looking into xslt and started testing with the examples on w3schools. However, when I save the xml and xsl in files and try opening them locally, chrome won't perform the xsl transform. It just shows a blank page. I have added the <?xml-stylesheet type="text/xsl" href="style.xsl"> tag to the xml document, and firefox renders it a...

Using C# to do xslt transform ignoring xsl:output

I am doing an xslt transform inside my c# program. When I run the xslt on its own it outputs just fine, but when I run it from within my c# program it always leaves off the: <?xml version="1.0" encoding="UTF-8"?> At the top of the resulting xml document. My XSLT file looks like: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet ...

Is the Android Browser capable of performing an xsl transform?

I have an xml file I wish to transform using an xsl-document, but I can't seem to make it work on even the latest available Android versions. I tried adding an tag to the xml, but that didn't work in either the native browser or in Dolphin Browser. Is there a way to script the transform to happen client-side, or is the only option to ...

XSL XML banner ok in IE/Firefox not showing in Chrome

I have a following code: <script type="text/javascript"> if (window.ActiveXObject) { var xml; xml=new ActiveXObject("Microsoft.XMLDOM"); xml.async=false; xml.load("http://www.mypage.com/some.xml"); var xsl = new ActiveXObject("Microsoft.XMLDOM") xsl.async = false xsl.load("http://www.mypage.com/some.xsl") document.write(xml.transfor...

XSLT - How to get IE consitional statements working in an XSTL

I've noticed IE conditional statements don't work in the transformed XML document. How do I get IE 6 and above to process them. Code as follows '<!--[if IE 6]><style type="text/css" media="all">@import "/css/ie6.css";</style>' Thanks. ...

XSLT 2.0 replace function behaves wrong

The XSLT 2.0 template <xsl:template match="/"> <xsl:value-of select="replace('aba', 'a', 'b')" /> </xsl:template> is expected to return 'bbb', which it does correctly when processed using saxonb-xslt on my Ubuntu 10.04 system. But when I issue exactly the same command on my Debian 5.0 system the output is 'abb'. In other words, th...

Browser behaviour with XSL - Firefox different from IE / Chrome

I have the following simple XSL style sheet: <?xml version="1.0" encoding="windows-1252"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0"> <xsl:output encoding="utf-8" method="html" /> <xsl:template match="/"> <xsl:text disable-output-escaping="yes"> &lt...

API choice, should I return XPathNavigator or XmlDocument

I'm building a new API for an existing service. The methods in it will be called from with in XSLT as .net extensions however I can see me needing to use the same API to do some .net XML juggling too. I've been toying which how best to write this all night. For it to be XSLT friendly I'll be returning XML in a XPathNavigator object so t...

Back Button in IE shows plain xml instead of loading xsl stylesheet

IE has weired behaviour when pressing back button. When trying to open a webpage server seds a 302 responce that redirects client to Login xml page with xsl stylesheet. After user successfully logged in some page is loaded. However, when user presses "back button" and reaches Login page, IE shows only xml values as plain text instead of ...

Upgrade PHP XSLT to 2.0

Is it possible/easy to upgrade PHP's to use XSLT 2.0? Current set up: xsl XSL enabled libxslt Version 1.1.24 libxslt compiled against libxml Version 2.6.32 EXSLT enabled libexslt Version 1.1.24 ...