xslt

getting attribute as column headers

I have the following XML: <DEVICEMESSAGES> <VERSION xml="1" checksum="" revision="0" envision="33050000" device="" /> <HEADER id1="0001" id2="0001" content="Nasher[&lt;messageid&gt;]: &lt;!payload&gt;" /> <MESSAGE level="7" parse="1" parsedefvalue="1" tableid="15" id1="24682" id2="24682" eventcategory="1003010000" content="Access...

xslt cookbook example not working

Hi I am working on this from xslt cookbook type my.xml <?xml version="1.0" encoding="UTF-8"?> <people> <person name="Al Zehtooney" age="33" sex="m" smoker="no"/> <person name="Brad York" age="38" sex="m" smoker="yes"/> <person name="Charles Xavier" age="32" sex="m" smoker="no"/> <person name="David Williams" age="33" sex="m" ...

xslt and xpath: match preceding comments

given this xml: <root> <list> <!-- foo's comment --> <item name="foo" /> <item name="bar" /> <!-- another foo's comment --> <item name="another foo" /> </list> </root> I'd like to use a XPath to select all item-nodes that have a comment immediately preceding them, that is I like to selec...

XSL-stylesheet URI using JAX-WS and Glassfish v3.

Hi there. I'm trying to use XSL-stylesheets in order to transform some generated XML-data to HTML-output. The architecture that I'm using is as follows: [Client Side] Web-Browser => [Server Side: Glassfish v3] JSP-pages -> Web-Services. My web service generates some XML-data, then I want to format it with XSL-stylesheet, pass the result ...

XML Pretty Printer Missing 2 Key Edge Cases

Using this xslt file found on this blog to pretty print xml using Nokogiri, everything almost works, but to the point where I can't use it for HTML. First, if a node is empty, it turns it into a self closing node, so: <textarea></textarea> gets converted to <textarea/> But that messes up the html tree when rendered. Second, if th...

Saxon PDF tutorials?

Does anyone know a good set of Saxon XML, XSLT, PDF (link text) tutorials for .net? ...

Optimisation <xsl:apply-templates/> for a set of tags.

How it is possible to reduce this record? <xsl:template match="BR"> <br/> </xsl:template> <xsl:template match="B"> <strong><xsl:apply-templates /></strong> </xsl:template> <xsl:template match="STRONG"> <strong><xsl:apply-templates /></strong> </xsl:template> <xsl:template match="I"> <em><xsl:apply-templates /></em> </...

How to get a non-XML output using JDOM XSLTransformer?

Hello, I have an XML file which I'd like to parse into a non-XML (text) file based on a XLST file. The code in both seem correct, and it works when testing manually, but I'm having a problem doing this programatically. I'm using JDOM's XSLTransformer class to apply the XSLT to the XML and it returns it in the format of a JDOM Docume...

XSL-FO: is XSL-FO dead technology and only used by niche companies?

I wanted to convert some xml to a magazine like pdf document. A lot like what Latext allows you to do however i was not able to find any new books or online tutorials on the subject. Is it worth investing in using this technology or not? Also, I looked at the Apache XSL-FO project and their last release was in august 2008. p.s. commerc...

JavaScript For Loop in XSL document

I have a peculiar problem with having a JavaScript for loop in XSL document. Here it goes: I am calling a JavaScript function on the click of a CheckBox. Following is what I wanted to do in the javascript function :: function SeelctAll() { for(var cnt = 0; cnt < 100; cnt++) { //Business Logic here. } } For th...

RSS MIME Type and XSL Translation

Back in the days when all the major browsers displayed RSS feeds as ugly XML, we implemented an XSL stylesheet so that, when a user browsed to the feed, it would do the following: Look pretty Explain what RSS was - it wasn't so widespread back then Provide a text box to copy the feed url in order to paste it into a feed reader ... just...

Cannot access updated Java object from Saxon XSLT processor

I am working with an open source version of the Saxon XSLT processor "Saxon 9.0.0.2J from Saxonica" and am trying to make use of the java extensibility for the first time. I am running into an issue I suspect may be a limitation on the open source version, but wanted to check first whether there might be something I am just missing here...

get another sequence elements'value in one sequence.

I have an XML file as below, and I want to transform it with xslt. <?xml version="1.0" encoding="utf-8"?> <root> <s1 name="kfb" /> <s1 name="kfb" /> <s1 name="kfb" /> <s1 name="kfb" /> <s1 name="kfb" /> <s1 name="kfb" /> <summary> <r1 value="1" /> <r1 value="5" /> <r1 value="c" /> ...

Explanation of converting exporting an XML document as a relational database using XSLT

I would like to better understand the basic steps needed to a take an XML document like this Breakfast Menu... <?xml version="1.0" encoding="ISO-8859-1"?> <breakfast_menu> <food> <name>Belgian Waffles</name> <price>$5.95</price> <description>two of our famous Belgian Waffles with plenty of real maple syrup</d...

Quick convert XML to Excel

What is the quickest (as in least effort, not super performance) way to convert 112K rows in XML to a Excel view. ...

ASP.NET, XSLT, extracting values from a CDATA section

Hi,i have a small problem i have xome xml with a cdata section. This CDATA section contains fragments of HTMl. I would like to extract some of the data inside this CDATA element. Right now i have a XSLT transformation that outputs the rest of the document as HTMl, but i need only a small part of the CDATA HTML, not the entire part - e.g....

Phone number transformation. Separate prefix in brackets.

There is an element: <phone>(987) 123-45-67</phone>. It is necessary to transform it in: <span><small>(987)</small>&#160;123-45-67</span>. How it can be made? ...

XSL last non-empty node

Given the following XML I need to place the contents of the suffix tag (minus the suffix tag itself) directly at the end of the last non-empty text node of a quote-block (as noted with comments in XML). My current code mostly works (stylesheet below) but I can't seem to correctly limit the the appended suffix content to just the last n...

How do I Emit Escaped XML representation of a Node in my XSLT's HTML Output

I'm transforming XML to an HTML document. In this document I want to embed XML markup for a node that was just transformed (the HTML document is a technical spec). For example, if my XML was this: <transform-me> <node id="1"> <stuff type="floatsam"> <details>Various bits</details> </stuff> </node> </t...

How to recursively delete some xml elements using XSLT

Hi, So I got this situation which sucks. I have an XML like this <table border="1" cols="200 100pt 200"> <tr> <td>isbn</td> <td>title</td> <td>price</td> </tr> <tr> <td /> <td /> <td> <span type="champsimple" id="9b297fb5-d12b-46b1-8899-487a2df0104e" categorieid="a1c70692-0427-425b-983c-1a08b658536...