xslt

Publishing toolchain

Hello all, I have a book project which I'd like to start sooner than later. This would follow an agile-like publishing workflow, i.e: publish early and often. It is meant to be self-publsihed by me and I'm not really looking to paper-publish it, even though we never know. If I weren't a geek, I'd probably have already started writting ...

How do I ADD an Attribute to the Root Element in XML using XSLT?

I want to match a root Element “FOO” and perform the transformation (add a version attribute) to it leaving the rest as it is. The Transformation I have so far looks like this: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://schemas.foo.com/fooNameSpace"&gt; <xsl:template match="//FOO"> ...

XSLT Document function returns empty result on Maven POM

Greetings! I want to extract some properties from different Maven POMs in a XSLT via the document function. The script itself works fine but the document function returns an empty result for the POM as long as I have the xmlns="http://maven.apache.org/POM/4.0.0" in the project tag. If I remove it, everything works fine. Any idea how th...

How to pass a string containing both single and double quotes as a parameter to XSLT in PHP?

Hi, I have a simple PHP-based XSLT trasform code that looks like that: $xsl = new XSLTProcessor(); $xsl->registerPHPFunctions(); $xsl->setParameter("","searchterms", $searchterms); $xsl->importStylesheet($xslDoc); echo $xsl->transformToXML($doc); The code passes the variable $searchterms, which contains a string, as a parameter to th...

XSLT generating attributes if source-Element is in parameterfile

Hi, i got an xml-file with some elements. For some of these is an aqvivalent in a parameter xml-file along with some other elements. I want to add these other elements from parm-file as parameter to output file if element-names are matching. (the Attributes should only be generated if an element "InvoiceHeader" exists in the source-xml....

Casting strings to numbers using XSLT

There is a task to output some data taken from database using XSLT. The application current locale is ru_RU, so decimal separator is comma. It looks like <data> <row> <date value="28.04.2010"/> <clicks value="281"/> <depth value="1,7"/> <row> <row> <date value="29.04.2010"/> <clicks value="15"/> <depth valu...

Oracle performance problems with large batch of XSL operations

I have a system that is performing many XSL transformations on XMLType objects. The problem is that the system gradually slows down over time, and sometimes crashes when it runs out of memory. It seems that the slow down (and possibly memory crash) is around the dbms_xslprocessor.processXSL function call, which gradually takes longer and...

XSL unique values per node

ok i have this xml <roots> <root> <name>first</name> <item type='test'><something>A</something></item> <item type='test'><something>B</something></item> <item type='test'><something>C</something></item> <item type='test'><something>A</something></item> <item type='other'><something>A</something></item> <item ...

Display different xsl:attribute depending on the ending of a string

Dear All, I have the following xsl code in an xsl document <A target="_blank" style="text-decoration=none"> <xsl:attribute name="href">viewdoc.aspx?doc=<xsl:value-of select="URLFilePath"/>&amp;mode=inline</xsl:attribute> <xsl:attribute name="prefix"><xsl:value-of select="File...

Using XSL-FO and HTML?

Hi, I'm trying to transform some XML-data to HTML with XSLT for my bachelor thesis. My professor wants me to consider XSL-FO too, or at least to write some word about it. But I'm very noob to this. So my questions are: Can I combine FO with HTML? Can I use FO istead of HTML and CSS? If yes, how will my browser render this? Are there ...

Comparing XML in SSRS

I'm new to SSRS. We'll have two slightly different chunks of XML in a single row of an SQL Server database table. In an SSRS report we'll want to show only the differences between the XML chunks. I don't know how to do this, but I suspect the XML Type in SQLServer 2005 might be useful, or XSLT transformations in SSRS. Could anyone point ...

XSL unique values per node per position

this get ever more complicated :) now i face another issue in last question we managed to take unique values from only one parent node now with: <?xml version="1.0" encoding="ISO-8859-1"?> <roots> <root> <name>first</name> <item> <something>A</something> <something>A</something> ...

XSLT: Is there a way to "inherit" canned functionality?

i am once again having to cobble together a bit of XSLT into order to turn generated XML into (rather than simply generating HTML). i'm having huge deja-vu this time again. i'm once again having to solve again basic problems, e.g.: how to convert characters into valid html entity references how to preserve whitespace/carriage returns...

Generating PDF document using XSLT

I have one huge XML document. I have set of XSL representing each node in the XML. These XSL also have java script to generate the dynamic content. It uses images which are in seperate images folder and it uses fonts as well. At present, I have a program which displays all the nodes that can be transformed and user click on one of the no...

XSLT: Transforming into non-xml content?

Is it possible to use XSLT to transform XML into something other than XML? e.g. i want the final non-xml content: <Content> <image url="file1.png"> <image url="file2.png"> ... <image url="filen.png"> <EndContent> You're notice this document is not xml (or even html), but it does have <elements>. Is it possible, using XSL...

Actually XSLT Lookup (Store variables during loop and use in it another template)

This question actually asks something quite different. See the comments to @Tomalak's answer to understand what the OP really wanted. :( Is there a way to store a variable/param during a for-each loop in a sort of array, and use it in another template, namely <xsl:template match="Foundation.Core.Classifier.feature">. All the classname ...

XML and XSL connection

I have a problem between XML and XSL files. In XML file, there are some elements such as *<school><student studentID="12345"><name>Stud I</name><takes>CMPE471</takes><takes>CMPE412</takes><takes>CMPE100</takes></student><student studentID="67890"><name>Stud II</name><takes>CMPE471</takes><takes>CMPE412</takes></student><course courseCode...

Upload files to SSRS server

I'm currently using the RS command to automate uploading an SSRS report. I have created a VB.NET program and it works well. Problem now is that I need to upload an XSLT file together with this report. Anyone knows any way of doing this, either using VB or even directly to the SSRS SQL Server db? Thanks ...

Set attribute to all child elements via xsl:choose

Hi, assuming I got following XML file : <?xml version="1.0" encoding="ISO-8859-1" ?> <MyCarShop> <Car gender="Boy"> <Door>Lamborghini</Door> <Key>Skull</Key> </Car> <Car gender="Girl"> <Door>Normal</Door> <Key>Princess</Key> </Car> </MyCarShop> I want to perform a transformation so the x...

Walk/loop through an XSL key: how?

Is there a way to walk-through a key and output all the values it contains? <xsl:key name="kElement" match="Element/Element[@idref]" use="@idref" /> I though of it this way: <xsl:for-each select="key('kElement', '.')"> <li><xsl:value-of select="." /></li> </xsl:for-each> However, this does not work. I simply want to list all t...