xslt

xslt parent element position

Hi I have the following xml to be transformed. But I don't how to get the primary driver tag value in the transformed xml. Primary driver should be based on the driver nodes position. Can somebody help me? <drivers> <driver> <first_name>Doug</first_name> <last_name>Harry</last_name> <vehicles> <vehicle> ...

xslt regular expressions to match xml entries and display

I know it is so simple to some of you. All I want to do is look through an xml doc and print out the xml entries that contain specific string fragments. The string value is passed to the xslt and the xml doc is looked at and if a word begins with the string expression it displays it. What I have errors with the following message... ...

inserting space in xslt

Hi I am using xslt to show the links on my webpart and i have added plus image next to my link.But I would like to add some space between them. I have added ,but this is not really working. Am i missing anything here? Please find my code below. Thanks. <xsl:choose> <!-- do _self --> <xsl:when test="contains(Link,'x...

Pass href dynamically in an XML file

How can I dynamically specify the href value in the line <?xml-stylesheet type="text/xsl" href="first.xsl"?> in an xml? I would like to substitute "first.xsl" dynamically. Thanks for your help. ================== Apologies for messing this up/making it difficult for you to help ==== My XML is: <?xml version="1.0" encoding="utf-8"...

Need help preforming an XSL Transform from XML to HTML in ASP.NET MVC

I just learned about XSL and XSLT a few days ago and now I'm trying to put it to work based on a question I had earlier today (want to have formated XML displayed on my website). Here is the code I'm trying (in a View): XDocument xmlInput = XDocument.Parse(item.Action); XDocument htmlOutput = new XDocument(); using (System.Xml.XmlWrit...

How do I use Elastic MapReduce to run an XSLT transformation on millions of small S3 xml files?

More specifically, is there a somewhat easy streaming solution? ...

Will jQuery fail with client side XSLT

I am looking to offload some processing to the client via client side XSLT. If I do this will my current JavaScript and jQuery still work? ...

How to link up XML file with XSLT file?

The examples at http://en.wikipedia.org/wiki/XSLT or http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&amp;xsltfile=cdcatalog seem to be independent XML and XSLT files. Don't they have to be linked? Or do you somehow put them into a same file? Otherwise, how does one file know how to suck in data from the other file? ...

Can PHP communicate with XSLT?

I want to use a combination of xml & xslt as a templating system. The question that I want answered is: can xslt and PHP communicate with each other (i.e share variables)? ...

Grouping using XSLT 1.0

My XML looks like <xml version="1.0" standalone="no"> <Alerts AlertsName=""> <Alert UserId="13" OwnerId="13" OwnerName="jasprice" OwnerEmail="[email protected]" Scope="I"> <Assets> <Asset> <AssetTaxonamy> <AssetTopics> <AssetTopic Type="Global business">Globalisation</AssetTopic> </AssetTopics> </AssetTaxonamy> <Asse...

Find maximum value of all child elements and get its parent element in XSLT

Using the below XML, I need to figure out which person worked more hours in each site. For instance in the below XML, person 1 worked 8 hours in site 1 but person 2 worked only 6 hours. So result should contain person 1 and site 1 in transformed XML. If the hours are equal, select first person. EDIT: I want this to be implemented using...

Need help fixing XSLT document

Hi! I have two problems with the below code that I need help fixing: 1) It doesn't include the root node when returning results from the XPath expression. (I've tried a couple things, but it messes up the results even more..) 2) I need help fixing the formatting of the results. I need the same nodes with the same attributes to be list...

Find maximum value of all child elements and get it’s parent element in xslt

This question is related to this post http://stackoverflow.com/questions/3461728/find-maximum-value-of-all-child-elements-and-get-its-parent-element-in-xslt. I asked my question incorrectly. Actually I need output little different. I need to match site node id with worksite node and find out the person who worked more hours for that site...

Changing namespace for XML file in XSL Translation

So I have an input file that uses my company's namespace in the default namespace (xmlns="companyURL") but I want my output file to use something other than the default namespace (xmlns:cmp="companyURL"). So I construct my file using the cmp namespace, but then I want to copy some of the inner elements: <xsl:element name="cmp:container"...

XSLT: Retrieve element that contains a particular string, or first element if absent

I have an XML list of "devices". <devices> <device>NOKIA-43</device> <device>HTC-7</device> <device>SAMSUNG-376</device> <devices> Using XSLT, I want to retrieve the first "HTC*" device if there is one, or the first device if there are no HTC devices. What XSLT code would do this? Thank you! ...

Which browser can show XML data transformed by XSLT?

say, if there is a file that's call data.xml, and a file that is format.xsl (or is it format.xml ?), which is to transform the XML data and format it as well using CSS, then which browser can display it? Which file should be opened? (the .xsl or the .xml?) Actually I saw in another example that the XSLT file's first line is to href="f...

What I got data files as data.xml, how to add the stylesheet link to those data files?

It looks like if the data files fetched from data source already contain <?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <cd> <title>Empire Burlesque</title> ... then the correct way to make the data displayable on a browser is to create a .xsl file, and then make the .xml file contain one more line (the second line below): ...

Is using XML and XSLT a good way to make a webpage?

I just learn of ways to use XML data file and XSLT to create a webpage (transform from XML to HTML or XHTML). But I have never seen a webpage that has the source code of XML with a link to an XSLT file. Is it not a good solution? ...

Convert dateTime to unix epoch in xslt

Hi. I have a dateTime variable, and I want to convert it to a decimal value of epoch. How can this be done? I tried using: seconds-from-duration($time, xs:dateTime('1970-01-01T00:00:00')) but it just returns 0. Please advice. Thanks. ...

xslt: value of text associated with element

If I have an XML file that includes <param name="foo" value="5000" >foo is a way of making pasta sauce</param> <param name="bar" value="3000" >bar is controlling the beer taps</param> and I want to use XSLT to process this into an HTML file, with the name and value attributes and the text as a description, how can I get the XML node t...