xslt

xslt replace function

Hi , I am using fn:replace(string,pattern,replace) function to replace ',' to '.'. URI i used for the function is http://www.w3.org/2005/xpath-functions. But i m getting an exception saying System.Xml.Xsl.XsltException: Cannot find the script or external object that implements prefix 'fn' Can anybody tell me what is the issue. T...

Define PHP-Function in XSL and calling it. Possible? How?

Like the title tells: Is it possible to write a PHP-Function in a XSL-Document and call it afterwards? I have no case, where I wanna do that. Its just a thing it came into my mind while learning XSL. In XSL you can compose something like: <xsl:processing-instruction name="php"> ...some php... </xsl> The PHP code will be run in yo...

using xsl to generate html for excel needs more formatting

I'd like to set the background color for some tags. Neither CSS background-color or attribute bgcolor seems to work. Is there a mso- CSS that will give me background color? Perl, XSL only, No Microsoft products. It should work for OS X and Windows, with current versions of Excel. xml: <d>Y</d> html: <td class="Status Y" bgcolor="yell...

How to convert default mysql modtimes into UTC date time using xslt

I need to convert default mysql modtimes into UTC formated datetimes using xslt. I have an xml document that contains dates that originated as mysql modtimes in the format: 2010-06-30 15:20:43.0 They are now in an xml document within an element "datestamp" 2010-03-16 13:52:56.0 In order to be published via an oai-pmh feed they need to...

Problem with XSLT rendering HTML

Hello, I am writing an XSLT file to output some HTML onto a web page (using Sitecore CMS). I am running into a problem with the following: <a href="../videos/video.flv" class="videolightbox jackie-hover" data="{width:400,height:200}" title="Title goes here">Text goes here</a> This causes the following error: Expected token '}', found...

Sum of culture specific values in xslt.

Hi, I have an xml like <MainNode> <Data SubjectID="19233"> <SubNode CS="100,1" > <AB V="PSDF"/> </SubNode> </Data> <Data SubjectID="19234"> <SubNode CS="111,1"> <AB V="PSDF" /> </SubNode> </Data> </MainNode> When i try to sum the value of attribute "@CS" i am getting "NaN" as result. Can anyone help me to solve...

How create makefile in windows

How create makefile doing folow - select from mysql in xml forman, transformation with xslt. ...

How to place if condition based on attribute value within for-each loop

I have a loop in xsl and depending upon the attribute value, i want to write some text. XML is as follows: <ROWS><ROW oid="28439"><EFL eid="8" fid="27672" count="2"> <MK id="3" val="0"/> <MK id="11" val="0578678 "/> </ROW></ROWS> XSL is as follows: <xsl:for-each select="EFL/MK"> <xsl:value-of select="@id" />: ...

ASP.NET: How to convert schema to Excel xsl

Hello all, I have the following xml schema: <?xml version="1.0" encoding="utf-8"?> <xsd:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0"> <xs:elemen...

xsl iterate through list of alphabet

I need to iterate through the alphabet a-z, and for each one, print the letter, and then place some code that i already have working to display all items in my database that begin with that letter. Currently, i'm using a select to retrieve the first letter of all the item names which i display. However, the requirement is to display all ...

How do I select a particular node or element in an XML with XSLT transformations?

My XML is <row> <entry>1.</entry> <entry>foo</entry> <entry>morefoo</entry> </row> <row> <entry>2.</entry> <entry>2foo</entry> <entry>2morefoo</entry> </row> using XSLT, i'm trying to represent this information in a html table, and i want to have a Serial no. column. How do i go about selecting the value of only the first...

Need help with XML/XSL table formatting

Let's say I have a list of 500 names in XML tags. I want to display this list in a table using XSLT. In the XSLT table I want to have a maximum of three rows; I don't care how many columns I have - I plan to put the table into a scrollable div. If my list of names grows to 1,000 I still want only three rows, but the amount of columns ...

Is it possible to apply a template on xsl parameter before applying the tempates on the xml.

Hi All, I have a xsl parameter which a string. I want to parse that string, split it and for each substring value I want to apply the template in the xsl. Is this possible? If so, Can you please advise an optimistic solution? Thanks ...

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

xslt - get last row from a foreach loop (split into 3 columns)

Hi everyone. I'm looping through 1-20 <li>'s using xslt and I'm trying to figure out how to add a class to the last row of the list, when displayed in a 3 column grid type format. At the moment, I'm using this code to add a class of col-last to every 3rd column in the list. <xsl:if test="not(position() mod 3)"> <xsl:attribute name="...

Render escaped XML on browser

Hi, For the below xml i want to render the unescaped text parts on browser from xslt e.g.: <one> &lt;text&gt; </one> I want the markup rendered on browser to be: &lt;text&gt; But when I use the apply templates which looks like below <xsl:template match="text()" mode="literalHTML"> <xsl:copy-of select="."> </xsl:copy-of> </...

How to only convert an XML file's attribute using XSLT, and leave the other content?

I have a xml file as below, and now I want to use the XSLT to transformer it, keep all the elements and attributes, but if it happen to the attributes with the value started with "SQL:", then execute the sql and replace the attribute value with the resolved SQL(it involve the http://msdn.microsoft.com/en-us/library/533texsx(VS.90).aspx. ...

How to convert flat list to the tree

I have the following xml: <root> <Element1> <Hierarchy attr="value"/> <Hierarchy attr="value"/> <Hierarchy attr="value"/> <Hierarchy attr="value"/> </Element1> <AnotherElement> <YetAnotherElement> <Hierarchy attr="value"/> <Hierarchy attr="value"/> <Hie...

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

XSL & XPath - Select Element Name of Attribute

Hi! I have a rather specific question perhaps.. I have a user that will enter in some criteria on a form, and then it builds an XPath from their input. Let's say their input creates the following: //*[@color='red']/@* Which essentially means they want to see all attributes of any element with the @color = red. I can display exactl...