xslt

Using XSLT as xhtml link extractor.

I'm starting using XSLT and write this scipt: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:output method="text" encoding="utf-8" /> <xsl:template match="span[@class='thumb']" > Link: <xsl:value-of select="$base" /><xsl:value-of select="a/@href" /> </...

In XSLT 1.0, how can I access attributes of a particular XML element when it is one of multiple elements with the same name?

I blame the Google Search Appliance for making me ask this question. Here is a snippet of the XML returned by the Appliance: <GSP VER="3.2"> <TM>0.073846</TM> <Q>test</Q> <PARAM name="entqr" value="0" original_value="0"/> <PARAM name="access" value="p" original_value="p"/> <PARAM name="output" value="xml_no_dtd" original_value="xml_no_...

How to detect the "parsing time" in XSLT transformation using C# code?

Hi all, I have written a C# code for triggering an XML to XML (XSLT) transformation. As the transformation depends upon the size of the XML and my Input XML file can vary from Kilo-Bytes to Mega-Bytes, I want to detect the "time taken to parse my input file and generate output" .. I can display the "value" via GUI or console, no problem ...

Better usage or alternative for starts-with in xpath.

I'm having a problem with a xsl transformation on a extended xml JUnit report file. I've extended the file as follows: <testcase classname="net.luminis.osgitest.test.adhoc.AdHocTest" name="testGetExportedPackagesByPackage" osgi-vendor-name="felix/1.8.0" time="3.212"> <osgi-specs> <osgi-spec version="4.1"> <sections> <section...

Tabular record display with XSLT i.e. Records display x columns, then new row...

I have the following XML: <?xml version="1.0" encoding="utf-8" ?> <data> <record> <id>1</id> <name>David</name> <age>40</age> </record> <record> <id>2</id> <name>Tully</name> <age>38</age> </record> <record> <id>3</id> <name>Solai</name> <age>32</age> </record> <record> <id>4</id> <name>Michael</name> <...

Generating XHTML from Servlet after XSL Transformation

Hi, I've written a servlet that takes some xml and xsl and produces a PDF, using ITextRenderer, and displays it on the screen. However, what I wish to do now is to display the resulting XHTML from the transformation on a webpage. I've created a new servlet which gets the xml and xsl as normal, but I'm unsure how to get the resultant XH...

Modifying rednered HTML in Sharepoint Server 2007

I'm receiving HTML and CSS mockups from a designer that's not in my city so the level a communication is not deep. He's giving me HTML and CSS that adheres to the HTML that's being rendered by Interwoven CMS. The problem is the HTML/CSS don't adhere to what my CMS (Sharepoint Server 2007) is rendering out. For example, when displaying a...

XSLT Rename Element

I have a XML document and I want to rename some elements via XSLT: <Assert @some attributes here> <conent> <And> <formula> <Atom> <opr> ... For example I want to rename <opr> to <op>. I have the following XSLT: <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates selec...

Transform XML into specified ordering (DTD -> XSD)

I have a project where the main file we are dealing with is an old XML file where the creator made a very unstructured DTD (All elements are optional, and can occur 0 or more times. Even better the application which reads the file actually expects many of the values as required). I have created an XSD based upon known application require...

[XSLT] Howto parse child elements to another related element

Good day to you, I use Castor to map network infrastructure into Java classes. My XML file looks like this: <SPECTRUM_Topology> <Topology> <!-- Device information --> <Device ip_dnsname="172.20.162.1" ... /> </Topology> <Update> <Device ip_dnsname="172.20.162.1"> <!-- Port information --> <Port ... /> ...

Asp website with vbsript functioning differently on different servers

Hi there, I am currently trying to move a web site from one server to another, one of the asp pages contains some vb script that looks like this: Dim oSearch 'AS Object Dim strXML 'AS String Dim strXSL 'AS String Dim oRS 'AS ADODB.RecordSet Set oSearch = Server.CreateObject("ETHERNET_PL.CETHERNET_PL") strXSL = Server.MapPath("...

Merging adjacent nodes of same type (XSLT 1.0)

Is it possible to merge every sequence of nodes of the same specified type? ('aaa' in this case) (not just first occurrence of sequence) Here is my XML input: <block> <aaa>text1</aaa> <aaa>text2</aaa> <aaa><xxx>text3</xxx></aaa> <bbb>text4</bbb> <aaa>text5</aaa> <bbb><yyy>text6</yyy></bbb> <bbb>text7</bbb> ...

XSLT 2.0 PHP support. When?

What are the chances to see XSLT 2.0 processors like saxon for php in the nearest future? ...

How to avoid a SAXParseException using Xerces when HTML file includes mdash?

I am using the Xerces implementation within JDK6 to perform XPath queries on an HTML 4.0 transitional document. With the following code: XPath newXPath = XPathFactory.newInstance().newXPath(); XPathExpression xpathExpr = newXPath.compile(expression); Object xPathResult = xpathExpr.evaluate(inputSource, XPathConstants.NODESET); Where...

Parsing date strings

I'm writing XSLT to transform an XML document from one DTD to another and in the process of doing so trying to tidy up some date strings. Each record in my source document has a date element that contains a string representation of a date. Some illustrative examples: 11 April 1995 14th April 1995 10 Sept 2002 14 Sep 2004 21-23 June 2...

Remove XmlNodes with xslt transformation

I need to rip some xml nodes from a xml document. The source is <root> <customElement> <child1></child1> <child2></child2> </customElement> <child3></child3> <child4></child4> </root> the result should be <root> <child1></child1> <child2></child2> <child3></child3> <child4></child4> </root> ...

XSLT: select distinct but slightly different to other examples

Hi. I have the following XML: <a> <b> <d>D1 content (can include child nodes)</d> </b> <b> <c>C1 content (can include child nodes)</c> </b> <b> <e>E1 content (can include child nodes)</e> </b> <b> <c>C2 content (can include child nodes)</c> </b> </a> Using XSLT 1.0, I nee...

(.net) Changes to included child XSL file is not picked up until parent XSL file is touched?

Ok so I've got a XSL file of handy templates in a file which a bunch of other XSL files include (using ) to keep my design nice and DRY. I'm using .net to run the XSL files against my XML. Trouble is when I make a change to the child XSL files and rerun my tranformations (ie refresh the browser) the change is not shown, it won't be unti...

xsl to produce summation value for each attribute

I want to use XSLT to calculate the summation value of amount the input is: <FileHeader> <Item amount="500" /> <Item amount="600" /> <Item amount="400" /> <Item amount="700" /> <Item amount="100" /> <Item amount="900" /> ...

xml creation with xslt (items per page with delta)

I'm using XSLT 1.0 to transform some XML documents. I have a problem to do one thing, in that I would need some help please: I have a set of items in my XML document something like : <item1>...</item1> <item2>...</item2> <!-- ... --> <itemN>...</itemN> I want to create something like this based on delta (items per page), for ...