xslt

xml xslt question

Hi folks, I have an xml that has text within "word" elements e.g <word>Police</word> <word>confirmed</word> <word>they are</word> <word>questioning</word> <word>a</word> <word>man</word> The problem is when I apply the xslt the text appears like "Policeconfirmedthey arequestioningaman". Here is the xslt snippet that does this transf...

XSLT max node value problem

Hi, I have a xml given below: <root title="الصفحة الرئيسة"> <item title="الصفحة الرئيسة" itemuri="tcm:8-29-4" ShowInNav="True" type="sg" pageuri="tcm:8-10592-64" sLink="/ara/index.aspx"> <item title="من نحن" itemuri="tcm:8-779-4" ShowInNav="True" type="sg" pageuri="tcm:8-9934-64" navorder="00500" sLink="/ara/about/index.aspx">...

Date and time conversions xslt

Hi Folks, My problem is that I receive for example a date in a concatenated format: Ex: 20050728 And I have to retrieve it in a readable format through my xslt. Ex. 28 July 2005 I also have a similar question regards time. Ex: 0004 To be displayed as 00:04 How is this done? Thanks for the help! ...

Using XSLT to process business rules?

A coworker of mine mentioned that one use of XSLT is processing business rules. He mentioned that there were systems that allowed users to write business rules in some kind of text format, and then the program uses XSLT to process the text and apply the rules at run-time in the application. Can someone shed some light on this subject fo...

Benefits/Disadvantages of using XSL to render entire web pages

I am in the preliminary stages of planning a project with a client to redo their current website. I took a look at their current site to see what issues they are currently dealing with and upon inspection I noticed that every page is being rendered entirely using XSLT. I am familiar with XSLT, I have used it to render custom controls tha...

xslt: remove duplicate xml header

html Tidy gives this as output for some reason: <?xml version="1.0" encoding="utf-16"?> <?xml version="1.0" encoding="utf-16"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta name="generator" content= "HTML ...

How do I generate RTF from Java?

Hi, I work on a web-based tool where we offer customized prints. Currently we build an XML structure with Java, feed it to the XMLmind XSL-FO Converter along with customized XSL-FO, which then produces an RTF document. This works fine on simple layouts, but there's some problem areas where I'd like greater control, or where I can't do...

xsl create xmlns:xsi namespace and attribute

Hi, I want to create the following element: <exercises xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mySchema.xsd"> If I use something like this: <xsl:element name="excercises"> <xsl:attribute name="xmlns:xsi" namespace="http://www.w3.org/2001/XMLSchema-instance"/&gt; Then it creates soemthin...

Doing a pivot using XSLT

I have an xml file like this: <root> <item> <name>one</name> <status>good</status> </item> <item> <name>two</name> <status>good</status> </item> <item> <name>three</name> <status>bad</status> </item> <item> <name>four</name> <status>ugly</status...

xslt transform and combine *.xml

I want to pull a series of relationships out of xml files and transform them into a graph I generate with dot. I can obviously do this with a scripting language, but I was curious whether or not this was possible with xslt. Something like: xsltproc dot.xsl *.xml which would produce a file like diagraph { state -> state2 state2 -...

xsl remove all text

How can one remove all text, but leave the structure intact? for example: <animals> <animal id="1"> <type>cat</type> <food> <fav>miauwmjam</fav> <quantity unit="day">50g</quantity> </food> </animal> </animals> transformed into <animals> <animal id=""> <type></type> <food> <fav></fav> ...

XML Diff and Merge

Hello, I think i have a rather unique problem to solve. Well, i cant find enough information using Google. So here it goes, I work on a JEE SOA application which stores XML documents as XML using Oracle XML DB. Whenever the XML changes, i increment the version and throw the previous version into a different table. The requiremen...

Merging MbUnit and NUnit tests and displaying in CruiseControl

We have a CruiseControl server running various AntUnit, MbUnit and NUnit tests via Ant. In order to merge the outputs from them all we have the following in the CruiseControl config: <log dir="logs/${project.name}/"> <merge dir="${q7.build.tests.dir}/reports" pattern="*.xml" /> <merge dir="${q7.build.tests.dir}/reports" pattern="**...

How do I profile and optimize an XSLT?

I have an XSLT for viewing XML files in the browser. The XSLT is naively written and currently takes a long time to execute (several minutes). My XML file is of modest size (~1 MiB), and other XSLTs for the same document that do different processing execute much more quickly. So I know it isn't the size of the XML that is the problem,...

xslt, javascript and unescaped html entities

i have a tiny little problem with xslt, js and html entities, eg. within a template: <script type="text/javascript"> <xsl:value-of select="/some/node"/> for (var i = 0; i &lt; 5; i++) { // ^^^ js error } </script> <script type="text/javascript"> <xsl:value-of select="/some/node"/> for (var i = 0; ...

Multiply 2 numbers and then sum with XSLT

Hi everyone, I am having a difficult time trying to do something that seems like it should be really easy to do. I basically want to multiply 2 numbers in a node and then sum the total of those numbers for all the nodes. Here is the XSLT code I have tried. <xsl:value-of select="sum(Parts/Part/Quantity * Parts/Part/Rate)"/> This code ...

HTML rendered incorrectly in .NET

I am trying to take the string "<BR>" in VB.NET and convert it to HTML through XSLT. When the HTML comes out, though, it looks like this: &lt;BR&gt; I can only assume it goes ahead and tries to render it. Is there any way I can convert those &lt;/&gt; back into the brackets so I get the line break I'm trying for? ...

XslCompiledTransform vs. XslTransform and how about an OOM for good measure?

So for a while I've been using XslCompiledTransform because that's what Microsoft tells me I need to use as XslTransform is deprecated. Recently I had to use it with a transform that has nearly 100,000 lines (generated xsl - of course). When I used my application I was shocked to see an OOM pop up. No matter what I did - OOM is all I ...

get xpath from xsl variable

I am trying to get some xpath from xsl variable using xsl ver 1.0 . That’s my variable: <xsl:variable name ="myVar"> <RefData RefTag="test1" bbb="false" /> <RefData RefTag="test2" bbb="false" /> <RefData RefTag="test3" bbb="false" /> <RefData RefTag="test4" bbb="true" /> <RefData RefTag="test5...

XSL/XPath Indentation

What conventions (if any) do you use for indenting XSL code? how do you deal with really long, complicated XPaths can you plug them into your XML editor of choice? is there some open source code that does the job well? For some background, I use nxml-mode in Emacs. For the most part its OK and you can configure the number of spaces ...