xslt

XSLT disable output escaping when disable-output-escaping is not supported

Hi folks, Since disable-output-escaping doesn't work on firefox (and isn't going to), whats the next best way of including raw markup in the output of an XSTL transform? (Background: I've got raw HTML in a database that I want to wrap in XML to send to a browser to render. I've got control of both the XML and the stylesheet, but no c...

HELP with XML to XML transformation using XSLT.

Am a rookie trying XSLT and XML tranformations for the first time. To start off, i tried a simple sample programs. I expected the Output in Tree format (maintaining the hierarchy) instead i just get " KING" in single line... What could be the problem? PS: I use XMLSpy. Any guideline would be great full. Thanks :) Input XML: <ROWSE...

Split node list to parts.

xml: <mode>1</mode> <mode>2</mode> <mode>3</mode> <mode>4</mode> <mode>5</mode> <mode>6</mode> <mode>7</mode> <mode>8</mode> <mode>9</mode> <mode>10</mode> <mode>11</mode> <mode>12</mode> i need to separate it on parts (for ex. on 4): xslt: <xsl:variable name="vNodes" select="mode"/> <xsl:variable name="vNumParts" select="4"/> <xsl:...

Copy existing XML, duplicate element and modify

Hi, I have a tricky XSL problem at the moment. I need to copy the existing XML, copy a certain element (plus its child elements) and modify the value of two child-elements. The modifications are: divide value of the 'value' element by 110 and edit the value of the 'type' element from 'normal' to 'discount'. This is currently what I hav...

XSL two for-each loops for same node

Problem I have is I want to loop round the parents making them bold then get the children via the id:pid (parent id) and list them. My second loop doesn't work. XML XSL <xsl:choose> <xsl:when test="@PARENT_OBH_ID"> <b><xsl:value-of select="@TITLE"/></b> <xsl:for-each select="FOOTER"> -<xsl:value-...

The elements do not fall into document('').

<?xml version="1.0" encoding="windows-1251"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:output method="html" indent="no" encoding="windows-1251"/> <xsl:template match="/"> <xsl:for-each select="document('')//w"> <xsl:value-of select="@e"/> </xsl:for-each> </xsl:template> <my...

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

split sting in xsl for content with /

I have some content being pulled in from an external xml with xsl. in the xml the title is merged with the author with a backslash seperating them. How do I seperate the title and author in xsl so I can have them with differnt tags <product> <title>The Maze / Jane Evans</title> </product> to be <h2>The Maze</h2> <p>Jane Evans</...

How to use parameter variable in xslt

Hi I am new to xslt so please let me know whats wrong with my syntax here. If I compare with a Constant value of '880.50' I get the desired result. But if I try to do the samething with parameter being passed I get nothing. The code snippet is as under. <xsl:template name="ShowJourneyLegs" > <xsl:param name="TotalFare" /> <Key...

MS Word to Stylesheet

Is there an easy way to automatically convert a bunch of MS Word documents to xslt stylesheets that can be displayed in the browser? What I have is a large collection of forms in Word format that have to be displayed in the browser, or sent to the user, with known fields populated from a data source, edited by a user and, finally, print...

Add two hexBinarys with XPATH 1.0

Hi, my xml document looks somewhat like that (Values are both xsl:hexBinary): <Offsets> <Offset> <Name>ErrorOffset</Name> <Value>DD</Value> </Offset> <Offset> <Name>OtherOffset</Name> <Value>FF</Value> </Offset> </Offsets> <Value> <Name>Error1</Name> <Code>0...

Compiling .xsl files into .class files

I'm currently working on a Java web project (Spring) which involves heavy use of xsl transformations. The stylesheets seldom change, so they are currently cached. I was thinking of improving performance by compiling the xsl-s into class files so they wouldn't have to be interpreted on each request. I'm new to Java, so I don't really kno...

XSL - Get attribute of previous element

In the if block below I want to be also test whether @Timestamp is smaller than the previous Message's timestamp. How can I achieve this? <xsl:for-each select="Message"> <xsl:sort select="position()" data-type="number" order="descending"/> <xsl:variable name="newclass"> <xsl:if test="@Timestamp + 60 &gt; $ctimestamp">ne...

Lowercase conversion in XSL

Hello, I have an XML like <emps> <emp id='3432'> <fname>Jack</fname> <lname>Dawson</lname> <emp> <emp id='1122'> <fname>Jack</fname> <lname>Thompson</lname> <emp> <emps> I am developing a web application which searches this xml based on the first name entered and comes up with a resultant page. To achieve this I have written an x...

Colorize Unique Elements in XML using XSLT

I currently have an XML document which basically consists of several conversations between people just like an IM conversation. I have each conversation displaying how I want to so far, except I want each name to be a unique color for readability. How I have it is that the XML is transformed into HTML with CSS. I'd like to use XPath a...

XML + Xslt -> Xml with PHP

Hi, I know that there are really a mass of XML XSLT php merging threads at SO. But php specific i could not found what might my problem: $xml = new DOMDocument; $xml->load("f.xml"); $xsl = new DOMDocument; $xsl->load('test.xsl'); // init and configure processor $proc = new XSLTProcessor; $proc->importStyleSheet($xsl); // import xsl do...

How do I include the proper XML / HTML definitions in a file generated by XSL?

As I understand it, you need to include the following code at the top of your HTML files to make sure they're parsed properly: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> ....

convert xml document to comma delimited (CSV) file using xslt stylesheet.

I need some assistance converting an xml document to a CSV file using an xslt stylesheet. I am trying to use the following xsl and I can't seem to get it right. I want my comma delimited file to include column headings, followed by the data. My biggest issues are removing the final comma after the last item and inserting a carriage retur...

Looping through all attributes of a XML element in XSLT

Hey everyone, I am trying to use <xsl:for-each select="@*"> to grab all the attributes of a given element but when i do that my <xsl:choose> statement doesn't execute. Here is the element that I'm working with: <textBox id="Airfare" value="" label="text 1"/> Here is the XSLT template I'm using: <xsl:template match="textBox"> <div> ...

Using XSLT to find nodes given a set of parameters

Sorry about the title — wasn’t sure how to word it. Basically I have some XML like this: <countries> <country handle="bangladesh"/> <country handle="india"/> <country handle="pakistan"/> </countries> And some XSLT like this (which doesn’t work): <xsl:template match="/countries"> <xsl:param name="popular"/> ...