xslt

Traversing an arbitrary C# object graph using XPath/applying XSL transforms

I've been looking for a component that would allow me to pass an arbitrary C# object to an XSL transform. The naive way of doing this is to serialise the object graph using an XmlSerializer; however, if you have a large object graph, this could cause problems as far as performance is concerned. Issues such as circular references, lazy l...

xslt count previous elements that have the local-name() equal to 'FootNoteReference'

How can I count how many previous FootNoteReference nodes there are in an xml doc such as this... <MyDoc> <title>&lt;Big Title&gt;</title> <head>Objective</head> <head2>&lt;Heading&gt;</head2> <head>Introduction</head> <Para> asdf asdf asdf asd<FootNoteReference />asdf asdf asfd asfd </Para> <head>Overview</head> <Para> &lt;Begin wit...

Pretty printing XML with javascript

I have a string that represents a non indented XML that I would like to pretty-print. For example: <root><node/></root> should become: <root> <node/> </root> Syntax highlighting is not a requirement. To tackle the problem I first transform the XML to add carriage returns and white spaces and then use a pre tag to output the XML. ...

Problem summing a total in XSLT Template

Hi everyone, I am having a problem trying to simply sum some values using XSLT. I a template online and have modified it for my needs. (link text) No matter how I try, I cannot get the template to sum the numbers. I either end up with a total of "0" or a concatenation of the numbers I want summed. If someone could take a look and point...

How can I break a table row in xsl after a specified count?

Hi I have the following xsl that sorts my xml alphabetically: <xsl:template match="/"> <xsl:apply-templates /> </xsl:template> <xsl:key name="rows-by-title" match="Row" use="translate(substring(@Title,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')" /> <xsl:variable name="StartRow" select="string('&lt;tr &gt;')" /> ...

Error using JSTL XML taglib - attribute xml does not accept any expressions

I'm getting the following error when I try to use the JSTL XML taglib: /server-side-transform.jsp(51,0) According to TLD or attribute directive in tag file, attribute xml does not accept any expressions I'm looking into the tlds etc, but if anyone knows what this is an can save me some time, it'd be appreciated! If it helps, I get t...

How can I convert convert docx or wordml xml files to xsl-fo?

I've been looking for a method to convert docx or wordml xml to xsl-fo. I read this post: http://stackoverflow.com/questions/156683/what-is-the-best-xslt-engine-for-perl but I'm having exceptional problems getting apache-fop going. I was able to download the bins and run it locally but the formatting was a little off and it didn't ma...

Architecture Critique: SQL Server FOR XML into XSLT for Rich HTML Interface

Can I get some constructive feedback about the following architecture? Simplified Architecture Summary: Return XML from your SQL Server (using FOR XML) and pass it straight into a XSL transform to produce a rich HTML web site. What are the pro’s and con’s of such a system when compared with a conventional 3-tier ASP.NET architecture?...

When to use xml with xsl instead of HTML?

I like .NET webcontrols and you manipulate things, that's common consensus, but XML and XSL is so great, because you have UI logic that is platform & language-independent, so one day I change the app to php, java or whatever and i can reuse all the presentation logic. Moreover, XSL has the possibility to call .NET (or whatever) methods ...

AddExtensionObject - Performance

.NET XSLT engine allows passing objects to the XSLT processing engine through the AddExtensionObject method. Can someone comment on the performance of using this to retrieve localized strings to be used in the XSLT? ...

XSL That Returns the XML unchanged

Hi - I am looking for a XSL snippet that simply returns the XML unaltered. It sounds trivial but I can't seem to find an example anywhere on the web. Any help out there? ...

Are there libraries to perform xslt transformation in erlang?

I'm really new to erlang and I'm wondering how to manipulate xml. I've found erlsom but I need to do some simple transformation on a xml. I'm looking for an xslt (even 1.0) library, but I haven't found anything and reduced myself to do the transformations by hand working on the DOM, or whatever you can call a structure representing the...

XSLT Transformation Problem with disable output escaping

I have an xml in which i have stored some html under comments like this <root> <node> <!-- <a href="mailto:[email protected]"> Mail me </a> --> </node> </root> now in my Transform Xslt code of mine i am giving XPathNavigator which is pointing to node and in xslt i am passing the comment value of as a paramete...

What is the appropriate way to embed potentially non-well-formed html in an xml document ?

The marketing people want to have the ability to write direct inline HTML in the (xml based) CMS. xhtml compliance and the like potentially goes down the drain, but they're the boss(es). The CMS uses a regular xml/xslt transformation pipeline. Currently we just use a single node with a cdata node containing all the nastiness, created us...

XSLT distinct elements and grouping

Given the following xml fragment: <Problems> <Problem> <File>file1</File> <Description>desc1</Description> </Problem> <Problem> <File>file1</File> <Description>desc2</Description> </Problem> <Problem> <File>file2</File> <Description>desc1</Description> </Problem> </Problems> I need to produce someth...

checking value of a variable inside a higher-precendence variable in XSLT

I need to be able to check what the "current" value of a variable is inside a redeclaration of that same variable in a different xslt that includes the other. main.xslt: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:import href="other.xslt"/> <xsl:...

Will XSLT work well with AJAX?

This might be a stupid or obvious question, but our whole site is rendered using XSLT to transform xml which is created on the fly from database queries and other pieces. Im starting to push a lot of ajax into the site to make it more dynamic, is there a good tutorial on xslt and ajax? ...

mozilla client side XSLT not displaying. (Using jQuery too)

I want to use firebug to debug and help be quickly finish some XSLT layout issues, but I cannot get the following code to perform and display the client side XSLT in Firebox (everything is fine in IE): $().ready(function() { var oXMLHTTP var oXSLT if ($.browser.mozilla){ oXMLHTTP = document.implementation.createDocument(...

Is there an XSLT buddy available somewhere?

I think a lot of people know about tools like RegexBuddy. Is there something similar for XSLT? ...

xsl code to list a given attribute of specific child elements

I have some XML code that looks like this <SEARCHRESULTS> <FUNCTION name="BarGraph"> <PARAMETER name="numList"></PARAMETER> <PARAMETER name="maxValue"></PARAMETER> <CODE>Some code</CODE> </FUNCTION> </SEARCHRESULTS> And I want to extract a list of parameter names for each function, so far I've got the following xsl cod...