xslt

XSLT Transform Efficiency

I am a support engineer and our company's product allows XSLT transforms to customize outputs. I made a xsl transform for this purpose. It works well for source files of typical size (several 100k), but occasionally a really huge (10M) source file will come by. In such case, the output is not generated even if I let it grind several day...

How to select unique nodes in XSLT

I found this page describing the Muenchian method, but I think I'm applying it wrong. Consider that this would return a set of ages: /doc/class/person/descriptive[(@name='age')]/value 1..2..2..2..3..3..4..7 But I would like a nodeset only one node for each age. 1..2..3..4..7 Each of these seem to return all of the values, ...

Is there an XML language for defining/authoring SQL database schemas?

Is there a dialect of XML for defining the tables, indexes and relations of a relational database, and a "compiler" or stylesheet to transform that definition into SQL CREATE statements (DDL)? EG, something that might look like: <Table Name="orders"> <Column Name="order_id" Type="varchar" Size="20"/> ... etc ... </Table> I'd ...

XSLT XALAN Example

Hi, I want yo use the EXSLT - DYN:EVALUATE in a style sheet. I have added the names pace but I don't know where the .xsl file I need to import is. I don't believe I have XALAN installed to point the import to. How would I install this? Once installed and I point it to the .xsl will it pick up the function and apply it? I am running Wind...

Memory-efficient XSLT Processor

I need a tool to execute XSLTs against very large XML files. To be clear, I don't need anything to design, edit, or debug the XSLTs, just execute them. The transforms that I am using are already well optimized, but the large files are causing the tool I have tried (Saxon v9.1) to run out of memory. ...

XSLT IE6 default processor

What is the default XSLT processor for IE6. Does it support EXSLT? Is there anyway to make it support it? ...

XML to WordML using XSLT 1.0 - replace html tags within xml content with wordML formatting tags

I am creating a WordML document from an xml file whose elements sometimes contain html-formatted text. <w:p> <w:r> <w:t> html formatted content is in here taken from xml file! </w:t> </w:r> </w:p> This is how my templates are sort of set up. I have a recursive call-template function that does text replacement against the so...

How to Convert complex XML structures to DataSet with multiple tables

What is the best way to convert an XML document to a .NET 2.0 DataSet. The XML document contains complex structures with parent-child relationships and should be transformed into multiple tables in the DataSet. The DataSet tables should also maintain the relationship among tables. right now, I've to write custom XSLT to do this transform...

Strip WordML from a string

Hi, I've been tasked with build an accessible RSS feed for my company's job listings. I already have an RSS feed from our recruiting partner; so I'm transforming their RSS XML to our own proxy RSS feed to add additional data as well limit the number of items in the feed so we list on the latest jobs. The RSS validates via feedvalidator...

How to convert all html escaped characters in a tidied xhtml string, so it loads in an XmlDocument?

In a .net web application I talk to a 3rd party CMS api which gives back html. I need to convert it to well formed xml, so I use an .NET wrapper around HTML tidy. This generates a nice DOM, but things go wrong when characters such as &nbsp; are used. I need those to be converted to their code format like &#160; in order for an XmlDocume...

GZip HttpResponse using XSL Transformer - Java

I have the following code below in my Servlet, but when IE hits the page, it returns a blank html page. If I use the response.getOutputStream() directly in the StreamResult constructor, the page loads fine. What am I missing? response is an instance of HttpServletResponse and xsl is an instance of Transformer from XSLTC TransformerFac...

Dealing with param values

I am attempting to compose a style sheet that, given an XML input (obviously) and a parameter that specifies a "target", will produce a list of commands that match that target. Here is the style sheet as written: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:param name="tar...

XSLT problem

Hi I have a XML below <?xml version="1.0" encoding="utf-8" ?> <siteMap> <siteMapNode id="tcm:11-5821-64" parentid="tcm:11-5-4" depth="0" url="/" title="Home" showLeftNav="true" page_type="false" showSecureContent="false" navOrderSGTitle="Root" externalURL=...

XSL alternating colors question

I would like to create an HTML table with row colors changing based on position and content. But instead of alternating every row, I'd like to be able to group rows together, so that I can have some XML like this: <itemlist> <item group="0">Conent...blah blah</item> <item group="0">Content...who cares</item> <item group="1">Co...

Java XSLT Transformation Failing due to xsl:include

I have a Java maven project which includes XSLT transformations. I load the stylesheet as follows: TransformerFactory tFactory = TransformerFactory.newInstance(); DocumentBuilderFactory dFactory = DocumentBuilderFactory .newInstance(); dFactory.setNamespaceAware(true); DocumentBuilder dBuilder = dFactory.newDocumentBuilder(); Cl...

XSLT selecting attribute of ancestor; "../.." works, "ancestor::<tagname>" doesn't

I'm running through an XML document, selecting all the elements, and creating links based on the ancestor which is usually two nodes up in the tree, but occasionally 3 or 4 nodes up. For the majority of the elements, using <xsl:value-of select="translate(../../@name,$uc,$lc)" /> works just fine, but for the cases where the ancestor ...

Does Python 2.5 include a package to natively transform an XML document?

In my Python app, I have an XML document that I'd like to transform using my XSL file. I'm currently using xml.etree to generate the XML document, but I haven't found anything within Python 2.5 that will allow me to natively transform my XML document. I've already found one library (libxslt) which can execute the transformation, but I ...

Preserving attribute whitespace in XSLT

Disclaimer: the following is a sin against XML. That's why I'm trying to change it with XSLT :) My XML currently looks like this: <root> <object name="blarg" property1="shablarg" property2="werg".../> <object name="yetanotherobject" .../> </root> Yes, I'm putting all the textual data in attributes. I'm hoping XSLT can save ...

Dynamic Header , xslt

I have a webpage with a dynamic list. I want the headers to be configurable. To start with the headers are named as "column1,column2....columnn" . On clicking on any of these header i open up a DHTML modal window where I select the header name from a predefined list so that I can assign this header name to the selected column. So I am re...

SSN format in XSLT?

I could use some help creating an XSL template that will take a string of numbers (i.e., 123456789) and format that string into a Social Security Number format (i.e., 123-45-6789). I found one example on the Internet, but it seemed overcomplicated. I'm new to XSLT, so please keep that in mind when replying. Thank you! ...