xslt

How to create an active link in RSS?

In RSS, for example if I wanna add a link for the channel: Part of the RSS code: <link> <a href="http://www.nytimes.com/2009/04/10/technology/internet/10google.html?ref=technology"/&gt; </link> And now here is the XSL code: <span> <xsl:value-of select="channel/link"/></span> The problem here is that when I preview the code, the l...

What's the difference between XSLT and XSL-FO ?

What's the difference between XSLT and XSL-FO ? Every resource I've read deal with them as if they were 1, or at least very closely tied.. Thanks in advance ...

Writing effective XSLT

What are the principles and patterns that go into writing effective XSLT? When I say "effective" I mean that it is Well-structured and readable Simple, concise Efficient (i.e. has good performance) In short, I'm looking for the best practices for XSLT. I've already seen the question regarding efficiency, but efficient code loses it...

Loading attribute in XPATH, problem

I've got a question about loading attribute in XPATH. I write short XML code to test: <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet type="text/xsl" href="testDate.xsl"?> <element attribute="1/1/2100"> Hung </element> My XSL code: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="ht...

<xsl:variable> Print out value of XSL variable using <xsl:value-of>

I'm trying to output a variable's literal string value, after it is being set depending on whether a node exists or not. I think the condition check logic is correct. But it is not outputing the values... <xsl:variable name="subexists"/> <xsl:template match="class"> <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy> <xsl:ch...

How to change the text in an element using xsl.

How do I apply a change to text in an element without losing its child elements. For example: I have this xml that I would like to apply a change to the text inside the "p" element.... <section> <p >Awesome LO</p> <p > Begin with an interesting fact, thought-provoking <keyword>question</keyword> <context> ...

Is it possible to flip and rotate text using XSLT?

I would like to take the contents of an XML tag and have it displayed flipped both horizontally (mirror image) and vertically (as a column) when viewed through a stylesheet. Is this possible without using random third party libraries? <mytag>Random Data</mytag> ...

XSLT create new HTML tag

How do I create a new HTML tag/node in XSLT ? I get the node/tag name from another variable. ...

SAXON.NET XSLT 2.0 Processor

I am using the open source Saxon XSLT processor for .NET to execute some 2.0 transforms. I reference the saxon9api.dll as I would any other dll, and can compile code against this. However Visual Studio does not show any intellisense making the IDE as useful as notepad. The saxon9api.dll is using the IKVM Java for .NET platform, and I w...

How to remove spaces from the end of text in an element. (XSL)

Does anyone know what XSL code would remove the trailing whitespace after the last word in an element? <p>This is my paragraph. </p> Thanks!! ...

Very simple XSLT string question

How would I do "substring(variable,1,1) between a-z or A-Z" then do X else do Y using XSLT? I know that one option would be using regex but I would expect there to be something that wasn't quite so much overkill. ...

Xsl: How can I Group and sort based on sum?

I have the below xml <ResultCollection> <Result Id="551550" Pass="23" Fail="0" Owner="Dong"/> <Result Id="551565" Pass="4" Fail="3" Owner="Dong"/> <Result Id="551567" Pass="61" Fail="0" Owner="Mei"/> <Result Id="551580" Pass="10" Fail="1" Owner="Dong"/> <Result Id="551580" Pass="0" Fail="4" Owner="Sen"/> <Result Id="55...

xslt: How can I create a dynamic table?

Given this xml <Documents> <Section> <SectionName>Green</SectionName> <Document> <FileName>Tier 1 Schedules</FileName> </Document> <Document> <FileName>Tier 3 Schedules</FileName> </Document> <Document> <FileName>Setback Schedule</FileName> </Document> <Document> <FileName>Tier 2 Governance</...

Using XSL to list all fields of an item in Sitecore CMS

I'm using a debug device in sitecore (6) that will output a 'developer' view of a page when the url is appended with a certain query string (which activates the device). On the page, I have item name, template, branch master, workflow info etc. I'd like to list all the fields on the item using the xsl render - preferably not including t...

xslt: How could I use xslt to create a table with multiple columns and rows?

How would I take this xml and create a table with a column for each "section" element and then display all the "document" elements in that column using xslt? <Documents> <Section> <SectionName>Green</SectionName> <Document> <FileName>Tier 1 Schedules</FileName> </Document> <Document> <FileName>Tier 3 Sch...

Muenchian? XSLT to denormalize/pivot/flatten xml file?

Given an input xml file with following structure: <root> <record row="1" col="1" val="1" /> <record row="1" col="2" val="2" /> <record row="1" col="3" val="3" /> <record row="1" col="n" val="4" /> <record row="2" col="1" val="5" /> <record row="2" col="3" val="6" /> <record row="2" col="n" val="7" /> <record row="n" col=...

XSLT to denormalize/pivot/flatten xml file? Part 2

(Note: I have posted a variation on my earlier question as suggested) Given an input xml file with following structure: <widgets> <widget shape="square" material="wood" color="red" /> <widget shape="square" material="metal" color="blue" /> <widget shape="square" material="plastic" color="green" /> <widget shape="squar...

XPath ordered priority attribute search

I want to write an XPath that can return some link elements on an HTML DOM. The syntax is wrong, but here is the gist of what I want: //web:link[@text='Login' THEN_TRY @href='login.php' THEN_TRY @index=0] THEN_TRY is a made-up operator, because I can't find what operator(s) to use. If many links exist on the page for the given set of...

How to select nodes dynamically in XSLT

I have an XML file: <?xml version="1.0" standalone="yes"?> <Questionnaire> <Temp_GridTypeTable_6> <Column2>Select Yes/No</Column2> </Temp_GridTypeTable_6> <Temp_GridTypeTable_1> <Column2>Rank 1,2,3</Column2> </Temp_GridTypeTable_1> <Temp_GridTypeTable_1> <Column1>I needed the income</Column1> <Column2>Why did y...

Is there a way to have browsers ignore or override xml-stylesheet processing instructions?

I'm trying to write a bookmarklet to help some QA testers submit useful debugging information when they come across issues. Currently I can set window.location to a URL that provides this debugging information, but this resource is an XML document with an xml-stylesheet processing directive. It would actually be more convenient if the t...