xslt

XSLT increment variable

I have the following XML <data> <records> <record name="A record"> <info>A1</info> <info>A2</info> </record> <record name="B record"/> <record name="C record"> <info>C1</info> </record> </records> </data> how can I transform into following output, the problem is how can I count between on record, and...

using xsl to combine two sentences from xml, outputting as html

can I change the first letter of the second sentence to lowercase using the XSL template? Or is there a way to change the first letter of the second sentence to lower case in HTML (first-letter pseudo code DOES NOT work since it can only be the subject of the selector). i.e: In XLM: "Name", "*R*eturns the something of the something." ...

XSLT stripping comments

I have a weird problem. Using XSLT transformations with PHP and for some reason, the compiled template file that is printed to the user strips all comments from the code. This never occurred before and have been unable to debug this problem at all. Even at the source $xslt->transformToXML($xml), it is stripped comments now, when it wasn'...

Stripping all elements except one in XML using XSLT

Hello all, I would like to remove all elements from XML except content of element called <source>. E.g.: <root> <a>This will be stripped off</a> <source>But this not</source> </root> After XSLT: But this not I have tried this but with no luck (no output): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Tran...

using xslt to interpret flat xml into nested xhtml

I am attempting to write XSLT that will select immediate-siblings of a certain type, but stop when a different tag is reached. Here's the Source XML: <?xml version="1.0"?> <body> <proc>Test</proc> <alert>Test1: alert 1</alert> <alert>Test1: alert 2</p> <para>Test para 1</para> <alert>Test2: alert 1</alert> ...

C# XSLT Transformation Out of Memory

All, I have the below code for Transforming an XML Document using an XSLT. The problem is when the XML Document is around 12MB the C# runs out of memory. Is there a different way of doing the transform without consuming that much memory? public string Transform(XPathDocument myXPathDoc, XslCompiledTransform myXslTrans) { t...

XSL Test Question, what is this testing?

I have this line: <xsl:when test="document('foo.xml')/field_config/field_rename/field[@old_name = $name]/@new_name"> foo.xml: <field_config> <field_rename> <field old_name="Modified" new_name="modification"/> <field old_name="Created" new_name="creation"/> </field_rename> </field_config> In general, what is this testing? ...

XSLT: Grouping and sorting....how?

Hi... I have an XML file that looks like the following... <states> <state> <name>North Carolina</name> <city>Charlotte</city> </state> <state> <name>Alaska</name> <city>Fairbanks</city> </state> <state> <name>Virginia</name> <city>Leesburg</city> </state> <state> <name>Alaska</name> <city>Coldfoot</city> </st...

Techniques for XSLT exception handling

As of XSLT 2.0, as far as I know (correct me if I’m wrong), there’s no native mechanism in the language for exception handling. I have some stylesheets that attempt to do some processing on specified chunks of an input document, copying everything else unaltered. There are rare exceptional conditions that I can’t easily detect before I ...

have domain specified inside the links of pages generated with Umbraco

Not sure the title explains what I want to do, so here goes: I have a website constructed with Umbraco 4.5.x and the links in the pages use relative paths. I want to have the domain prepended to these links and don't know how to do that; I didn't really used Umbraco so I am a newby at this :(. What I want to do is replace links like: <...

xslt convert xml string in xml elements

Hello, here's a tricky one. I have the following XML <test> <testElement SomeAttribute="<otherxml><otherElement>test test</otherElement></otherxml>"> </testElement> </test> Using XSLT, I want to transform this XML to have the following result. <test> <testElement> <SomeAttributeTransformedToElement> ...

Java XML transformation interface

I need to transform a XML. Usually I would use Saxon and a XSLT 2.0 stylehsheet for this. The transformations I have to do involve side-effects and are stateful and manipulate the contens of nodes, so implementing a XPath function doesn't make that much sense. I decided to implement a transformer class for this purpose. I found javax.xm...

generating HTML from XSL-FO using Java

I have some PDF files generated based on some XSL-FO documents and I now need this content in HTML too. I am using FOP for creating the PDF files but this does not support HTML as an output format. My question is this: Is there a Java library of some sort that can create HTML files based on XSL-FO documents, or can I do this with throwi...

xsl param fails in PHP 5.3x

I have an in PHP 5.3 that is failing when something is its contents. For context I do a XSL transformation on one DOMDocument and insert the results as a parameter into another DOMDocument that is then transformed. This has worked fine until now. <h5>lets see: <xsl:value-of select="string-length($content)" /></h5> returns 0. $cont...

adding select-attribute using the "attribute"-tag in xslt not working

How come this does not work: <xsl:with-param name="message"> <xsl:attribute name="select"> <xsl:text>'Alla koder kopplade till den e-post-adressen är nu skickade till dig!'</xsl:text> </xsl:attribute> </xsl:with-param> ...

Tool to apply XSL to XSD?

I have an XSL file and an XSD file on my local disk. The XSL file is supposed to transform the XSD file to OWL format. What freeware tool can I use apply this transformation? Thanks. ...

How I can repeat an action X times with XSLT

I've to populate a total of 20 elements with XSLT. In my XML code I have a <select> with the values, there is anyway to not to write 20 forms? My XML: <output> <select> <id>1</id> <name>One</name> </select> <select> <id>2</id> <name>Two</name> </select> <select> <id>3</id> ...

Implementing a DSL with (subset) functionality of XSLT

My requirements are that I provide a way for Business Analyst-types to specify XSLT-like transformations without the complexity of XSLT or XPath. Basically there are incoming XML documents and the client needs to be able to specify situations where elements/subtrees should be edited/removed/replaced/added. It will essentially be a rule...

XSLT failing for unknown reason on xsl:value-of

I've been trying to create an xslt template, but it keeps silently failing like as if an exception is happening but is not being caught. The closing bracket is not being written out, invalidating the output; the XML file <?xml version="1.0"?> <gallery> <item> <file>IMAGEHEADER1.jpg</file> <thelink>michaeljackson12...

XSL - rounding/format-number problem

Hi guys, I'm trying to get the value of a number to 2 dec places from my xml. XML:<Quantity>0.0050</Quantity> XSL:<xsl:value-of select="format-number($quantity, '####0.00')" /> However XSL seems to have a problem with this value and outputs 0.00 in one area of the page and 0.01 in the other. Of course in this situation it is favourab...