xsltprocessor

Why can't I get XSLT to work in chrome?

I have a XSLT sample copied straight from http://www.w3schools.com/xsl/xsl_transformation.asp, which I can't seem to view in Google Chrome. However, it seems to work fine in IE. Does anyone know why this would be? EDIT: The online version works fine, but the local copy does not. ...

How do i check if a node is a child of another node?

I want to get all "generateId" values of the text nodes which are a child of a specific node whose attribute "id" value is known. I can i test for this condition using XSL? ...

What is the difference between as="element()+" and as="element()*" in XSL?

What is the difference between using as="element(data)+" and as="element(data)" in xsl:variable. The below XSL solution works if use "+" but not when i use "". Can some one clarify. ...

How do i modify the text content within a specified set of nodes using XSL?

I have a list of node ids. I want to append "-Selected" to all the text nodes within the given set of node ids. Please let me know how we can achieve the same using XSL? Input: <node1 id="a"> <node2 id="b"> <node3 id="c">Text node0</node3> <node4 id="d"> <node5 id="e">Text node1</node5> <node...

How to retrieve the id attribute of the root node of a xml using XSL?

How to retrive the id attribute of the root node of a xml using XSL? ...

PHP and XSLTProcessor Misbehavior

Hi all, Simple question: Why is a PHP function called from an XSL Stylesheet just returning the last argument passed: foo.xsl: <xsl:template match="/"> <xsl:value-of select="php:function('date','c')" /> </xsl:template> PHP: ... $xsl = new XSLTProcessor(); $xsl->registerPHPFunctions(); $xsl->importStylesheet($fooStylesheet); e...

Component returned failure code: 0x80600011 [nsIXSLTProcessorObsolete.transformDocument]

So, I'm using the XSLT plugin for JQuery, and here's my code: function AddPlotcardEventHandlers(){ // some code } function reportError(exception){ alert(exception.constructor.name + " Exception: " + ((exception.name) ? exception.name : "[unknown name]") + " - " + exception.message); } function GetPlotcards(){ $("#conten...

Why does Saxon evaluate the result-document URI to be the same?

My XSL source document looks like this <Topology> <Environment> <Id>test</Id> <Machines> <Machine> <Id>machine1</Id> <modules> <module>m1</module> <module>m2</module> </modules> </Machine> </Machines> </Environment> <Environment> <Id>prod...

How to find problem with PHP XSLTProcessor when return from transformToXML is false and libxml_get_errors returns nothing

I'm working on the code below to allow HTTP user agents that cannot perform XSL transformations to view the resources on my server. I'm mystified because the result of transformToXML is false, but the result of libxml_get_errors() is an empty array. As you can see, the code outputs the LibXSLT version ID and I'm getting the problem on W...

XSLT transformations in Ruby and JRuby

Simple question: are there any solid XSLT libraries that work in both Ruby and JRuby? REXML works in both, but does not have XSLT support. ruby-xslt doesn't work in JRuby. The latest Nokogiri betas do support JRuby, but the support is still buggy and throws occasional NullPointerExceptions for XML input that works fine in Ruby. (In pa...

How to create a HTML5 + SVG document using the PHP XSLTProcessor

For a little project about XML I try to use HTML5 as it has SVG and WAI-ARIA Support. I also want to use a XSL stylesheet for my document. But I can't get a valid HTML5 document with a nested SVG. Here are some version I tested so far: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999...

Error message in XSLT with C# extension function

Hi! I am received the following error while trying to implement a C# extension function in XSLT. Extension function parameters or return values which have CLR type 'Char[]' are not supported.** code: <xsl:variable name="stringList"> <xsl:value-of select="extension:GetList('AAA BBB CCC', ' ')"/> </xsl:variable> <msxsl:script l...

Translate XSL files with PHP and gettext

Is it possible to translate XSL files using PHP and gettext? I'm building a web application where most of the user interface code is in XSL files. I'm using PHP gettext to translate PHP pages and an app called Poedit to translate the texts. All this works very well! I would need a way to translate the XSL files too, preferably so that P...

How do I configure Poedit to read XSL files

This is one line in my code: <xsl:value-of select="php:function('gettext','Hello world')" /> How do I get Poedit to automatically find the text string from the .xsl file? ...

Consume Government Webservice

I'm attempting to pull information from the publicly accessible Recreation Information Database. The feed I'm trying to parse through is http://www.recdata.gov/feeds/RecElements/getAllRecElementsForOrgID_-1.xml (large file) It seems that the feed is a complex xml document which looks like it has a lot of references to information simila...

How to prevent line-wrapping by XSLT?

I have some XML like this: <root> <do-not-sort> <z/> <y/> </do-not-sort> <sortable> <e f="fog" h="bat" j="cat"> <n n="p"/> <m n="p"/> </e> <d b="fop" c="bar" k="cab"> <m o="p"/> <m n="p"/> </d> </sortable> </root> I want to sort the children of the...

PostgreSQL 8.4 XML, XSLT and XPath possibilities / documentation.

The available PostgreSQL material on XML, XSLT and XPath is limited. There are the official docs from the PostgreSQL team, however these cover only a few pages of content and I've never been convinced that their docs are as comprehensive as they could be. There are also some bits and bobs on sites kicking around, however there is not to...

XSL template processes all descendants, not just children

Given the following XML and XSL transformation, I'd expect two <node/> elements in the output containing the texts first and second. This expectation is based on the following reasoning: The template with match="/root" will execute first. The <xsl:apply-templates/> instruction in this template will apply the most specific templates for...

getting xpath 2.0 functions to work in any browser at all

I want to use XPath 2.0 functions, like these: http://www.w3schools.com/xpath/xpath_functions.asp In a browser XSL transform. I can specify the XSL version as 2.0 in the stylesheet tag, but this doesn't seem to activate the 2.0 XPath functions (at least in Firefox). So for example this: <xsl:value-of select="node-name(//testnode)"...

Using a remote stylesheet that includes other stylesheets with relative paths

I'd like to do an XSL transform on a DocBook document using lxml.etree.XSLT. Although the documentation mentions that etree.XSLT() takes a first parameter of xslt_input, I can't seem to find any docs on what this parameter is meant to be. Passing it a file that is open for reading seems to work; passing it a filename in a string does n...