xslt

Convert scientific notation into double with XSLT(FO)

Hello, the XML i would like to transform contains something like 7.3248378E7, which is not supported natively by the XSL-FO processor (ends up in NaN in the PDF file). Is there a nice way (which is the opposite of a dirty hack) to convert this number format? Thanks a lot. ...

Efficient recursion in functional programming vs. inefficient recursion in different paradigms

As far as I know recursion is very elegant but unefficient in OOP and procedural programming (see the wonderful "High Order perl", Mark Jason Dominus). I had some informations that in functional programming recursion is fast - keeping its elegance and simplicity. Could someone confirm and possibly amplify this? I am thinking in terms of...

Dynamically switching XSLT stylesheets in the browser?

The short version: Is it possible to switch to alternate XSL stylesheets in the browser, a la CSS stylesheet switching? The long version: I've always admired the CSS Zen Garden; it excellently showcases the power and flexibility of stylesheets. However, it also shines a light on one of the great weaknesses of CSS: a quick View Source ...

Is it possible to generate a XSL-FO template from a PDF?

Given a PDF document, is it possible to generate a XSL-FO (FOP) template? Obviously, this would be a one-time thing - the generated template would just be a starting point for creating a proper template that pulls in the appropriate data. For me, the ideal tool for doing so would be a Java-based one and should be executable from the co...

Removing duplicates in xsl

I have the following XML and I want to process it so that I do not get duplicates in the result set. I have simplified the problem to make it easier to understand. Also how can I use the results of one template as part of the input for another? This: <LINES xmlns:set="http://exslt.org/sets"&gt; <STDINSTRSEQ>0</STDINSTRSEQ> <STDINST...

outputting XML encapsulated literal using XSLT

I want to convert the RDF/XML file into a table of 3 columns, namely "Subject" "Predicate" and "Object", these are known as RDF triples. the RDF/XML file is as shown below: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:h="http://www.w3.org/1999/xhtml"&gt; <rdf:Description rdf:about="http://www.w3.org/TR/2004...

Getting the stylesheet directory from within the XSL file- for configureable xml location

I have a xsl file for an xml. The location of the the xml files should be configurable (that's done by configuring the href path to stylesheet in the xml) but the xsl is using some images and some othe javaScript files and need to hav teh path to them. The path is right near the stylesheet file so once I can get the xsl directory I can g...

SharePoint XSLT Problem -

Hi there, I am trying to do some highlighting on some SharePoint XSLT Results. BElow is the XML that i am getting. The Problem that i am getting is that the Template Match blocks are not matching the child nodes of UM If someone can see where i am going wrong that woould be great. Thank you Chhris <rows> <row> ...

How a compiled XSLT works on IIS?

My XSLT was compiled via xsltc, the performance is hugely improved. However, I am wondering how the compiled XSLT works on IIS? Will there any cached of the compiled XSLT instance on the IIS after 1st JIT'ing. As I am seeing my page slightly slow in response from server, but if the page after being called once, subsequent access to the p...

Is there a tool that creates xsl:fo from xsl so it will be the same output ?

Hello all Is there any tool that takes xsl file and converting it to the same xsl:fo ? I have html file that is converted from xsl+xsl and now I like to take the xsl and to create xsl:fo For fop and I really don’t want to write xsl:fo now ...

Xerces + Python?

Does anyone know if there's an available python library compatible with Python2.6 that exposes the Xerces functionality and its XML DOM capabilities? I would define the desired capabilities as: XML DOM select by Xpath & XSLT processor. ...

Endless runtime for a script that sometimes works

After I execute this code asp scripts quite working. <!-- #include file="Connection.asp" --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <% function Page() { var db = new DBConnection; this.DAL = db.retriveDAL("Content"); var url = new String(Request.ServerV...

[XSLT]: Rendering a node sequence as M x N table

@Oded: Sorry to have been poor in my exposition... My input document has a fragment like this: <recordset name="resId" > <record n="0">example 1</record> <record n="1">example 2</record> <record n="2">example 1</record> .... <record n="N">example 1</record> </recordset> containing an arbitrarily long node sequence. The attribute "n" ...

Add attribute to result of xsl:apply-imports

Hi, I have an XSL stylesheet (A) that imports another one (B). A overrides a template (t) in B, and invokes B's template with apply-imports: From A: <xsl:template match="t"> <xsl:apply-imports/> </xsl:template> From B: <xsl:template match="t"> <p><!-- Do something --></p> </xsl:template> I now want A to add an attribute t...

Random Items in XSLT

I'm customizing a Google Search appliance, which uses XSLT to present results to the user. Our design calls for one of several images to be included randomly on the results page. Is there a way to use randomness in XSLT? (Pseudo-randomness is just fine for this application.) Calling random templates would be fine, as would just being ab...

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...

Getting XslCompiledTransform.Load to load a file in a SharePoint List

Hi all: I'm having difficulties getting XslCompiledTransform.Load method to take a server path. I googled around and found that I need to do something like: xslt.Load(System.Web.HttpContext.Server.MapPath(xslPath), XsltSettings.Default, new XmlUrlResolver()); But it returned an error saying HttpContext is null. I also tried: xslt....

how to parse two xml tags in the same level using a for-each method using xslt ?

I am converting a xml using xslt. Original XML is <Content> <book> <customData> <CustomDataElement> <title>book-name</title> <value>Java</value> </CustomDataElement> <CustomDataElement> <title>genre</title> <value>Programming</value> </...

xslt import/include 2 files with the same template

Hello guys, I've got an interesting question on XSLT import/include. I have 2 XSLT files with the same rule. Receipt XSLT: (is run by itself) <xsl:template match="Booking" mode="extraStyle"> <link rel="stylesheet" href="../css/receipt.css" type="text/css" media="screen"/> </xsl:template> EmailCommon XSLT: (serves as template libra...

Need to convert an ISBN value into an Amazon search query link using XSLT

I am using XSL to transform a resource attribute, it will check whether or not it contains "urn:ISBN". If it does, then it will need to get the ISBN number value, and return it as an Amazon search query. For example resource="urn:ISBN:0752820907" then change into http://www.amazon.com/gp/search/ref=sr_adv_b/?field-isbn=0752820907 ...