xslt

Less-than operator causes error "not well-formed" in xsl-if

I'm going through the w3cschools XSLT tutorial, and I am at this page: xsl-if. On that page (in red) is the text <xsl:if test="price &gt; 10">. This works. I modified the code to use "&lt;" and that works fine too. I tested <xsl:if test="price > 10"> (note the use of > instead of the &gt;). This works too. But this fails: <xsl:if test=...

xsl:apply-template to only nodes with specific attribute value

Hello, I have an XML document which I'm subjected to an XSLT. The structure is similar to: <root> <item value="1"> <object/> </item> <item value="2" /> <object/> </item> </root> My goal is to end up with a transformed XML similar to: <root> <parent> <object-one value-one="1"/> </parent> <parent> <object-two...

XSLT 1.0 word count with HTML

I am looking to call a template that will trim down a field to 30 words. However, this field contains HTML and the HTML should not count as a word. ...

Sitemesh like functionality with XSLT?

I recently asked a question about using XSL/t for creating a site layout and child pages Here.. Where the layout would decorate the child page. I want to expand on that idea and come up with SiteMesh like functionality. Note that I'm going to have a very small number of xsl layout files, most of my xsl files should be for the child pages...

In XSLT, how come I can't set the select-attribute of a value-of using xsl:attribute, and what's a good alternative?

I have a constant and a variable that I wann mouch together to select a specific node, this is what I want to do: <xsl:attribute name="value"> <xsl:value-of> <xsl:attribute name="select"> <xsl:text>/root/meta/url_params/ <xsl:value-of select="$inputid" /> </xsl:attribute> </xsl:value-of> </xsl:attribute> How come it doesn'...

XSL Taking XML transforming it into Excel

Hi everyone, New guy here so bear with me. Ive got a basic XSL file that will read my xml data. Im trying to put xml into Excel. Heres my issue. With a small XML file it seems to convert it easly, BUT with this XML file that had several nodes ( I think they are called), when I call up the data, its not right. I want to only show info ...

SQL -> MongoDB Export Performance Issues

I'm trying to set up an automated process to regularly transform and export a large MS SQL 2008 database to MongoDB. There is not a 1-1 correspondence between tables in SQL and collections in MongoDB -- for example the Address table in SQL is translated into an array embedded in each customer's record in Mongo and so on. Right now I ha...

How to specify xml documents to transform with resource collection in ant?

I'm trying to use ant to use XSLT to preprocess three specific stylesheets in my project. The Ant documentation for the xslt task says that it should be able to accept any resource collection. Specifically, it says: Use resource collections to specify resources that the stylesheet should be applied to. Use a nested mapper and the tas...

How do I transform an XML-File into a FO-file using XSL?

I need to tranform a basic xml file into a FO file using xsl. The xml looks like this : <?xml version="1.0"?> <column-chart-stacked-full> <title>Provincie Antwerpen</title> <x-axis-title>Gasmeters</x-axis-title> <y-axis-title>Verbruik</y-axis-title> <clusters> <cluster number="1"> <bar> ...

Timezone conversion in xslt

I have to convert this GMT format to EST in xslt 1.0. <Date>Mon, 11 Aug 2009 13:15:10 GMT</Date> is there any of doing that? ...

Can I use XSLT to transform a OpenOffice ODT content (content.xml) to HTML?

Is this possible? / Jonas ...

How to use a function from one xsl in another

I have two xsl files: "one.xsl" and "two.xsl" one.xsl: <xsl:function name="x:trans" as="xs:string"> <xsl:param name="str"></xsl:param> <xsl:variable name="res1" select="x:translate_string($str)"/> <xsl:sequence select="$res1"/> </xsl:function> </xsl:stylesheet> I want to use function "x:trans" in "one.xsl" How d...

Replace \r\n Newlines using XSLT and .NET C# VS 2008

I use VS 2008, .net 3.5 for generate page html using XSLT. I have Message, that contains \r\n (newlines) I use this in XSL file: <b>Message: </b><xsl:value-of select="Message"/><br/> I need replace \r\n by <br/> in xsl. I have seen several references but not get solution for my issue: I use this code C# before I call to transform X...

XSLT breaks jQuery/Prototype Script in Firefox

I am working on a school project. It's an internet page with XML / XSLT. For the design we thought about an image fading effect in the background. I made it as you can see and it works perfectly on IE7. But checking it in FF 3.6 throws some suspicious errors in firebug und does not work. For example: alert($('menu_bg').innerHTML); ...

Sorting a subtree and storing it in an xsl:variable

I'm working with an XSL stylesheet, and I'm trying to use the method shown here to store a sorted subtree as a variable. I'm using saxon 8.7 vis the xml-maven-plugin to transform my XML file. Here's the code that I have: <xsl:variable name="miniDays"> <xsl:for-each select="//day[position() > $firstPosToShow]"> <xsl:sort se...

How to filters the record using xslt parameters

Hi Guys, I am using xml and xslt to generate desired html. In my previous post, I was able to generate the all the records, however I am little confuse how to get filter data according xslt parameter values. I have two controls in my page first is for selection and second is for displaying the records as per the values passed from the ...

How to remove trailing zeros in XSLT

Hi, I have a node element as 1.0123000. I am using an XSLT for transformation. I need the output as 1.0123. Any one have any idea how to do it in 1.0 version of XSLT? Thanks in advance, jo ...

How to count output lines with xslt?

I'm outputting text with XSLT. I need to count the number of lines of each section and write it out to my output file. How this could be done? My output is like this: HDR+aaa:bbb' AAA+78901234567890+String1:String2' BBB+123+String' CCC+321:1212' DDD+112211' DDD+121122' XXX+number_of_records+78901234567890' AAA+1234567890+String1:Strin...

removing and inserting tags in HTML

Hi, I need to convert HTML file to iXBRL format. iXBRL format is basically html with some embedded nodes or some information of html file wrapped under ixbrl tags. For this, I will need to SEARCH and REMOVE some nodes from HTML file and WRAP some nodes under iXBRL tags. Can I use XML DOM in C# to achieve this objective. Am I right in a...

Converting simple markdown(string) to html with xslt

Im transforming my XSLT-stylesheets into documentation, and I want a rich experience wihtin the commentnodes for each code-chunk, therefor I want to convert the following comment and output as xhtml: String: # This is a title with __bold__ text and *italic* # This is just a normal line - list point with some __bold__ - list point wit...