xslt

Modifying an xslt to be namespace agnostic

I have a XSLT I've created to handle a particular xml document. However, now namespaces are being introduced in some, but not all of our documents. I'd like to use the same XSLT for these documents, however I'm having trouble modifying my stylesheet to be namespace agnostic. It's been suggested previously to modify my xpaths to *[local...

Is there a good tool for XSL previews?

Hi guys, I'm a LAMP web developer in Perl and at my current place we use some black magic in using Perl to retrieve the data, throw them into a XML and then pass the XML to an XSL file. And this is all handled magically by the almighty AxKit. Thus you can probably imagine that my XSL is full of XSLT lines, i.e. if test,@value etc. I wa...

Best XPath 2.0 Expression Evaluator (Eclipse)

What are the best XPath 2.0 Expression Evaluator for Eclipse? Any other standalone that is worth saying? ...

How can I build an alphabetical accordion with XSLT?

Given the following XML: <databases> <database> <title_display>Aardvark</title_display> </database> <database> <title_display>Apple</title_display> </database> <database> <title_display>Blue</title_display> </database> <database> <title_display>Car</title_display> </databas...

Alphabetical sorting with XSLT

Sample XML: <term> <name>facies</name> <translation language="en">facies</translation> <definition><num>1.</num> cara <num>2.</num> superficie externa, superficie anterior</definition> </term> <term> <name>factores angiógenos</name> <translation language="en">angiogenic factors</translation> <definition>descripció...

What is the best way to join multiple element values into a new string in xslt 2.0

Hi All, I need to join multiple element values into a new string separated with whitespace, what is the best way to do this? I am using xslt 2.0. Thanks in advance. ...

Java XSLT processors supporting XPath 2.0

What are the currently available XSLT processors supporting XPath 2.0 standard? ...

XML format-number problems when using   separators

We're working on a web page that should be able to display prices such that spaces are the grouping separators and commas are the decimal seperators... eg the value 1234567.89 should display as "1 234 567,89". (We're actually using &#160; so we get a non-breaking space.) This seems like the right XSL to do it, and it almost works, but ...

Open-source java XSLT 2.0 implementation?

I'm currently looking into using XSLT 2.0, but I cannot find any open-source java implementations (Saxon-B seems to fit the bill, but isn't schema-aware). Am I missing something? ...

Truncate XML with XSLT

Hello, I have a question for the clever people of the SO community. Below is a snippet of XML generated by the Symphony CMS. <news> <entry> <title>Lorem Ipsum</title> <body> <p><strong>Lorem Ipsum</strong></p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada au...

Can StringBuilder be emulated in XSLT?

I am trying to emulate StringBuilder behavior in an XSL. Is there a way to do this. It seems pretty hard given the fact that XSLT is a functional programming language ...

Can I link xslt to another xslt?

Basically I want to have one xslt to become my 'base' xslt and want to link this into child xslt files. Is this possible? The aim is to reduce code duplication. We will have many child xslt files for the various customers all with their own formatting and additional text etc and don't want to repeat the base code for each client xs...

<apply-templates /> best practices

with apply-templates is easy to write difficult for understanding code. are there rules to write apply-templates easy-to-read-and-maintain? for example, "avoid using //* in select", "try to write all apply-templates in one template" or "don't use apply-templates if it's possible" what looks natural, what ugly? ...

XSLT automatically converting escaped characters to string literals

Hi, I am working on an XSLT transformation to re-arrange XML blocks to validate NewsML files. Some of these files contains encoded characters (such as &amp; &quot; etc...). The problem is the XSLT transformation is converting these characters to their literal string (ie "and", "'"). This is causing problems. I do not want this to happe...

How to refer to current node value in XSL for-each test?

Let's say I have an XML doc like this: <books> <book>1110</book> <book>1111</book> <book>1112</book> <book>1113</book> </books> I'm trying to setup a condition that tests the value of the current node in the for-each, but I'm doing something wrong: <xsl:for-each select="/books/book"> <xsl:if test=".[='1112']"> ...

How do I handle xslt script code samples?

I'm getting fatal error http://www.w3.org/2006/xqt-errors#XPTY0004 in XSLT scripts I've created using Notepad, UltraEdit or Help text published to the web. These tools show nothing no strange characters, but the script breaks unless I manually edit the input so it is all on one line (usually need tor recreate every blank character). Tedi...

How to emulate C enumeration in XSLT with optional values

I'm trying to make a XSLT conversion that generates C code, the following XML should be converted: <enum name="anenum"> <enumValue name="a"/> <enumValue name="b"/> <enumValue name="c" data="10"/> <enumValue name="d" /> <enumValue name="e" /> </enum> It should convert to some C code as following: enum anenum { a = 0, b...

XSLT - Recursively Working Outwards

I understand how to process this doc (below) with XSLT from the outermost person element to the innermost. But I was wondering if: 1) If its possible to work from the deepest element out. 2) What that would look like given my example. <?xml version="1.0" encoding="utf-8" ?> <container> <person name="Larry"> <person name="Moe"> ...

Xslt apply import for particular imported file?

Is there a way to apply import for a particular imported file and not all the files imported? Basically only want to do apply import for a certain import based on some value evaluated. For example in pseudo, If value = "Medical" then Do Medical Imported File apply imports Else If value = "Transport" Then Do Transport Imported File app...

xsl for sharepoint calendar

I need to create a calendar which will join together data from a number of separate sharepoint team calendars (it's so that the press office in my organisation can see what's happening in each department side-by-side on the same page - what they would like is something like the ui for a shared google calendar). I have discovered that I ...