xslt

How do I check for the existence of an external file with XSL?

I've found a lot of examples that reference Java and C for this, but how do I, or can I, check for the existence of an external file with XSL. First, I realize that this is only a snippet, but it's part of a huge stylesheet, so I'm hoping it's enough to show my issue. <!-- Use this template for Received SMSs --> <xsl:template name=...

Performing client side XSLT when you only have the XML with an XSL reference tag

I have been wrestling with the following problem for a couple of days and need a bit of guidance as client side web development is not my forte! I have a Struts action that returns XML as part of the response, this action was initially called from the src attribute of an iframe which performed an xslt and turned the xml into HTML using ...

XSL - How to disable output escaping for an attribute?

I've had the following <a> tag: <a href="http://myserver/_forms?url={@FileRef}&amp;amp;id=5"&gt;...&lt;/a&gt; One of the files is called "File's got apostrophe.xml". The output of the XSL is: <a href="http://myserver/_forms?url=/blah/File&amp;amp;#39;s got apostrophe.xml&id=5">...</a> The problem is that the apostrophe is HTML-esca...

XML to XHTML - Best Method?

Not wishing to be subjective but I have a need to get data from an XML source and convert it to (X)HTML. From my understanding I can do this with PHP (or other server-side scripts), Javascript, or XSLT. My feeling is that it would be more appropriate to use XSLT as it is dealing with an XML source and this is the purpose for which XSLT e...

What is the difference between as="element()+" and as="element()*" in XSL?

What is the difference between using as="element(data)+" and as="element(data)" in xsl:variable. The below XSL solution works if use "+" but not when i use "". Can some one clarify. ...

How do I include a web.config custom section schema without having to update each dev machine?

Hi, I've added a new custom section to the web.config of an application. I have also created a corresponding schema file for the new section definition. How do I include the schema reference in the web.config so that any developer editing the section has intellisense enabled when dealing with my new custom config section? I've seen ...

Finding Specific Descendant Nodes With XSL:Key

Given the following code: <database> <table name="table1"> <column name="id"/> <column name="created_at"/> </table> <table name="table2"> <column name="id"/> <column name="updated_at"/> </table> </database> I want to be able to test using an xsl:key if specific table has a specific column by...

Alternative to Altova's MissionKit

Anyone know of any good alternatives (other than those listed below which really are only good at specific XML development tasks)? The Why (if you're interested): I've been doing XML development on and off for years now, but someone brought XMLSpy to my attention recently, and it is awesome - the price isn't. Lately I've been using a c...

How do i select all the text nodes within a specific element node using XSL?

How do i select all the text nodes within a specific element node using XSL? Input xml: <node1 id="1"> <node2 id="2"> <node3 id="3" /> <node4 id="4"> <node5 id="5">Text node1</node5> <node6 id="6">Text node2</node6> </node4> </node2> <node7 id="7">Text node3 <node8 id="8">Text node4</node8> <node9 id="9">Text node5</node9> ...

XSLT special characters

In the following XSL transformation how do I output the '<' and '>' symbol? Input XML: <TestResult bugnumber="3214" testname="display.methods::close->test_ManyInvoke" errortype="Failure"><ErrorMessage><![CDATA[calling close() method failed - expected:<2>]]></ErrorMessage> XSLT: <xsl:template match="TestResult"> <xsl:variable nam...

Java / XSL: Transformation result different between jre 1.5 and jre 1.6

I have just been working on an old Java app and switched the jre from 1.5 to 1.6. The app uses xsl to transform xml to html and this had been working fine until I changed the jre. Here is a extract from the xsl and xml: XML <link href="Uml&amp;#228;ut.txt" target="_blank"> <style tag="text">Umläut.txt</style> </link> XSL <xsl:t...

Render an url of type ?x=1&y=2 with xslt

Hello, Im trying to print, using a xslt sheet a url but im having problems with the chars = and &: This is the url that i want to render: <a href="whatever.aspx?x=1&y=2">whatever</a> Im getting that "=" is an unexpected token. How should i have to put the = and the & in a xslt sheet? Thanks in advance. Regards. Jose ...

BizTalk 2009 XSLT and Attribute Value Templates

I'm trying to make use of attribute value type in a BizTalk XSL transformation to dynamically setting attribute or other element names. Read more here: http://www.w3.org/TR/xslt#dt-attribute-value-template The following code is an example of an XSL template to add an attribute optionally. <xsl:template name="AttributeOptional"> ...

Custom xsl rendering for lookup field in list view (SharePoint 2010)

I'm trying to change rendering of a list column on list view page. After a few tutorials and some hair pulling I managed to create an xslt for a calculated and currency field (from fldtypes_XXXXXX.xsl): <xsl:template match ="FieldRef[@Name='MarkCalc']" mode="Text_body"> <xsl:param name="thisNode" select="."/> <xsl:value-of select="...

How do i modify the text content within a specified set of nodes using XSL?

I have a list of node ids. I want to append "-Selected" to all the text nodes within the given set of node ids. Please let me know how we can achieve the same using XSL? Input: <node1 id="a"> <node2 id="b"> <node3 id="c">Text node0</node3> <node4 id="d"> <node5 id="e">Text node1</node5> <node...

xslt help - my transform is not rendering correctly

Hi All, I'm trying to apply an xlst transformation using the following file. This is very basic, but I wanted to build off of this when I get it working correctly. <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-...

How to retrieve the id attribute of the root node of a xml using XSL?

How to retrive the id attribute of the root node of a xml using XSL? ...

Add a Carriage Return to the Output of an XSL Transformation

I am trying to use XSLT to convert an XML document to a text file and the text of the document looks fine. However, I need to add a carriage return after the end of each line (NOT A CRLF) and I seem to be failing in every attempt. I have tried adding just a CR at the end of the line like this: <xsl:text>&#xD;</xsl:text> I have trie...

What are good CLI tools for JSON?

General Problem Though I may be diagnosing the root cause of an event, determining how many users it affected, or distilling timing logs in order to assess the performance and throughput impact of a recent code change, my tools stay the same: grep, awk, sed, tr, uniq, sort, zcat, tail, head, join, and split. To glue them all together, U...

XPATH: select subset of xml file

In my case, I have: <booklist> <book id="1"> </book> <book id="2"> </book> <book id="3"> </book> ...... </booklist> How can i just return: <booklist> <book id="1"> </book> </booklist> if I use /booklist/book[@id=1], I can only get <book id="1"> </book> But I also need the document element. Thanks ...