xslt

How do I access properties from parent document to use in children

I am new to Umbraco CMS. PLease help. I have a Umbraco website in which I created a DocumentType called 'Master'. The 'Master' page lets user input a goal and amount for a fund raising initiate they are undertaking. On the 'Master' page I have a Macro which automatically does the math to generate a percent that will be used throughout...

XSLT: Convert base64 data into image files

I have seen several questions on how to encode an image file in base64, but how about the other way around - how do I reconstitute a picture from a base64 string stored in an XML file? <resource> <data encoding="base64"> R0lGODlhEAAQAPMAMcDAwP/crv/erbigfVdLOyslHQAAAAECAwECAwECAwECAwECAwECAwECAwEC AwECAyH/C01TT0ZGSUNFOS4wGAAAAAxtc09QTVNP...

XSLT: Obtaining or matching hashes for base64 encoded data

I need to find a way to find a way to find the hash for the base64 encoded data in the XML node //note/resource/data, or somehow otherwise match it to the hash value in the node //note/content/en-note//en-media@hash See below for the full XML file Please suggest a way to {obtain|match} using XSLT 4aaafc3e14314027bb1d89cf7d59a06c {f...

How to render a self closing HTML tag with attributes in XSLT??

Well I want to render a self closing tag say <img> tag like this <img src="xyz.jpg" /> But I don't know how to do that...I mean how to render a self closing tag. What I'm having so far is below:- Here is the XML: <c:Image src="xyz.jpg"></c:Image> And here is the XSLT: <xsl:output indent="yes" omit-xml-declaration="yes" method="ht...

Prepending some text to a WCF response message body

I want to prepend the following text to the response body of a WCF operation: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="transform.xslt" type="text/xsl" ?> What is the best way to do this? An additional requirement is that the XSLT filename should be spec'd using an attribute on the operation method. I am trying t...

XSLT / Xpath: Selecting a preceding comment

I have XML in the following format which I want to reformat: <blocks> <!-- === apples === --> <block name="block1"> ... </block> <!-- === bananas === --> <block name="block2"> ... </block> <!-- === oranges === --> <block name="block3"> ... </block> </blocks> My problem is I can't figu...

XML and XSLT and setting namespace.

I need to add an xmlns to the root element in the output of this XSLT transform. I've tried added <xsl:attribute name="xmlns"> but it's disallowed. Has anyone got any ideas how I could solve this? <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:template match="/"> <xsl:variable name="roo...

Testing SOAP endpoint through junit throws SAXParseException (soapenv:Envelope)

Hi all, I've try to implement integration tests for a working application (spring, hibernate, soap, cxf). I build an SOAP-XML by hand and handle it to my endpoint. Like this: private Source createRequest(String domainName, String email, String userId, String password) { String content = ""; content += "<soapenv:Envelope xmlns:s...

Xslt task not working as expected

I have an XSLT transform that I developed in VS. It works great when I use VS to run it (via XML->Show Xslt Output). However, when I execute it via the MsBuildCommunityTasks Xslt task I get wildly different results. Specifically, the output is only the contents of a handful of elements I don't even reference in my XSLT. I guess the def...

Sharepoint 2007 Data view Webpart custom parameters

I'm sort of new to the custom parameters that can be setup on a DataView Webpart. There are 6 options: - None - Control - Cookie - Form - QueryString - Server Variable I think that None, Cookie and QueryString speak for themselves and are pretty straightforward. The issue comes from the other 3. There isn't much documentation as to wha...

XSLT transformations on very large files

We are using XSLT to generate reports of our data. The data is currently stored in Oracle as XML documents (not using the XML type, but normal CLOB). We select the right XML documents and create a single document: <DATABASE> <XMLDOCUMENT> ... </XMLDOCUMENT> <XMLDOCUMENT> ... </XMLDOCUMENT> ... </DATABASE> In some cases, the c...

Does anyone know of an XSL library for creating Excel files?

I would like to use XSL to create excel .xml files that Excel 2003 can open. Does anyone know of a XSL template library that I can use for the purpose? ...

XSL variable number of child nodes...

Hey All, I've got some XML elements with a number attached as more are available. Such as this: <Images> <Image1>C:\Path\To\AnImage</Image1> <Image2>C:\Path\To\AnotherImage</Image2> </Images> The amount of Images in each XML doc is variable. How can I make sure that my XSL file will show all elements inside the tag? I al...

XSLT output does not reflect on Firefox

Hi, I have created a Practice.xsl file to transform the source Practice.xml to an html from javascript and add the generated html to n empty DIV element, which is working fine with IE But same html is not rendered correctly on Firefox. here is the Practice.xml <feed> <feedback> <user>Naresh</user> <date>12 Oct, 2009</date> <comm...

XSLT Apply sort to second value if first is empty

I have a for each which loops round news item nodes. Among other properties these news items have two attributes for created date. System added date and a user entered created date (to override the system date). I would like the list sorted by created date with the preference on the user entered date. Below is my humble invalid attempt!...

Sharepoint (MOSS) XSL - PageUrl parameter not being found/displayed

I have a Data View Web Part, on a custom edit Page for a list. I want to grab the current URL and pass it to the next page, so I can return to the editing screen. I have followed these instructions to display the current page URL: http://www.stevesofian.net/post/XSLT-Tip-Get-Current-Page-URL.aspx Inside of Sharepoint Designer, the Url ...

Hooking into the Transport layer of WCF

I want to prepend the following text to the response body of a WCF operation: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="transform.xslt" type="text/xsl" ?> Problem is that the Message class uses XML Readers and Writers to specify the contents of the message. Inserting this text as the first line after the tag makes...

How do I overflow the contents of a column into the next column using XSL-FO?

I have a table with three columns in which I'm trying to get some long paragraphs to flow dynamically from the first column into the second and then into the third. Currently, the table will continue on a next page when the first column overflows instead of moving into the second column and so I get several pages filled with only a singl...

Can additional criteria be added to an XSL select that is generating a key?

I have an XML document of store locations which have a Type node indicating the type of store and an existing set of templates for adding a key to each Location based on it's state which then adds these to an HTML in order of their state. What I need to do is exclude all of the states from display that do not have a Type of 1. It's eas...

No XSLTProcessor() support in Safari?

For whatever reason, I can't get XSLTProcessor() to work all the time. Here is my JS: ... xsltProcessor = new XSLTProcessor(); xsltProcessor.importStylesheet(xmlRequest.responseXML); // Pass variables xsltProcessor.setParameter(null, "sectionNumber", section); xsltProcessor.setParameter(null, "entryNumber", elementNo); // Tr...