xslt

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

XSL FO dual page number in the same fo:page-sequence

I have a sequence of pages with one flow that overflow in many pages. I need to have dual page number: one sequence that start from 1 in the firs page and increment by one till the last page and one that reset every "chapter" change. Chapter 1 Page(total) 1 Page(in chapter) 1 Page(total) 2 Page(in chapter) 2 Page(total) 3 Page(in ch...

XslCompiledTransform fails for XSLT with many xsl:when conditions

I'm just in the process of upgrading a ASP.Net 1.1 application up to .Net 3.5 and one of the changes I've made is to use XslCompiledTransform rather than XslTransform. I was running through some test XSLTs to ensure all was well when I found an XSLT that failed using the new method. After a bit of investigation I found that the XSLT had...

MOSS ItemStyle.xsl parameter

Hi, I am trying feed the site URL as a path into HTML rendered by the ItemStyle.xsl. Could anyone please give me some pointers? I need to know how I can extract the site URL from ItemStyle.xsl. Many Thanks, Nav ...

How do I insert XML into another XML file with XSLT?

Hello, I looked at this thread to find out how to insert XML into XML with XSLT http://stackoverflow.com/questions/862954/insert-xml-node-at-a-specific-position-of-an-existing-document But I have a problem since I need to insert XML between two grand child nodes. For example I want to insert <s>...</s> between <r>...</r> and <t>...</t>...

How can I write an XSLT that will recursively include other files?

Let's say I have a series of xml files in this format: A.xml: <page> <header>Page A</header> <content>blAh blAh blAh</content> </page> B.xml: <page also-include="A.xml"> <header>Page B</header> <content>Blah Blah Blah</content> </page> Using this XSLT: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.o...

Sorting an XML file through XSL

I have an XML file that I want to sort by an attribute. The file is structured as shown below: <wb xmlns:cf="http://www.macromedia.com/2004/cfform"&gt; <a:form name="chart"> <a:input FIELDNUMBER="09" INDEX="2" LEFT="200" /> <a:input FIELDNUMBER="08" INDEX="3" LEFT="200" /> <a:fieldset FIELD="a" FIELDNAME...

Recursive XSLT, part 2

Ok, following on from my question here. Lets say my pages are now like this: A.xml: <page> <header>Page A</header> <content-a>Random content for page A</content-a> <content-b>More of page A's content</content-b> <content-c>More of page A's content</content-c> <!-- This doesn't keep going: there are a predefined num...

xsl transform: problem with Ampersand URL parameters

I'm having issues with transforming XSL with parameters in a URL. I'm at a point that I can't change the C# code anymore, only can make changes to xsl file. C# code: string xml = "<APPLDATA><APPID>1052391</APPID></APPLDATA>"; XmlDocument oXml = new XmlDocument(); oXml.LoadXml(xml); XslTransform oXslTransform = new XslTransform(); oXs...

How to pass parameter value to XSL?

Suppose I have a XSL as follows: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" indent="yes"/> <xsl:param name="sortKey" select="'firstname'"/> </xsl:stylesheet> Then a XML as follows <?xml version="1.0" encoding="UTF-8"...

XSLT - Adding a class to something with a class?

When using XSLT how do I apply a class to an element which already has a class? The way I'm doing it it replaces the class that is already present? How would I add the class in addition to the existing class? My code is as follows: <xsl:if test="data[@alias = 'off'] = 1"> <xsl:attribute name="class">off</xsl:attribute> </xsl:if> <xs...

How to determine the inner context node within an XSLT select

Hi there! I'm trying to determine a subset of nodes stored in the variable objs by using a user defined function cube:is_active: <xsl:variable name="active_cubes" select="$objs[cube:is_active(XXX) = 'TRUE']"/> Since the function does not allow a local context I'm required to pass it as a parameter (denoted by XXX). However, the ...

Variable increment in XSLT

hi, i've an xml file like <node> <elm val="data1"/> <elm val="data2"/> <elm val="data3"/> <elm val="data4"/> <elm val="data5"/> <elm val="data6"/> <elm val="data7"/> </node> i need to write an xslt for this xml file to display in a table fomat like 1 dat1 2 dat2 3 dat3 4 dat4 5 dat5 6 dat6 7 dat7 please help m...

Preserve certain html tags during XSLT

I have looked up solutions on stackflow, but none of them seem to work for me. Here is my question. Lets say I have the following text : Source: <greatgrandparent> <grandparent> <parent> <sibling> Hey, im the sibling . </sibling> <description> $300$ <br/> $250 <br/> $200! <br/> <p> Y...

Remove all nodes from xml excluding specific nodes using XSLT

Hi, I have a bunch of xml files with a varying amount of data nodes in them and I want to change the files using XSLT to include only specific nodes. Example: <?xml version="1.0" encoding="UTF-8"?> <SomeName> <identifier> <UID> 1234 </UID> </identifier> <MainNode1> <SubNode1> <Subnode1a>DATA1a0</Subnode1a> ...

Is it possible to color-code and format an XML document using XSLT?

Has this ever been done before? Is it possible to write an XSLT that will turn an XML document into color-coded, formatted, HTML? ...

Xalan redirect:write , use either of two element values to create name of new .xml file depending on null values.

So I have the following code: <redirect:write select="concat('..\\folder\\,string(filename),'.xml')"> Where "filename" is a tag in the xml source. My problem occurs when filename is null or blank. And this is the case for several of the xml filename tags. So what I am trying to implement is a checking method. This is what I have done:...

Libraries to convert xml into JSON and vice versa.

I need to transform one document formated in xml into JSON and vice versa. I belive this is a common requirement and perhaps there's still one library that does that work. Know any? ...

XSLT line counter - is it that hard?

I have cheated every time I've needed to do a line count in XSLT by using JScript, but in this case I can't do that. I simply want to write out a line counter throughout an output file. This basic example has a simple solution: <xsl:for-each select="Records/Record"> <xsl:value-of select="position()"/> </xsl:for-each> Output would...

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