xslt

sharepoint data view web part xslt without schema

I'm trying to use a data view web part (via SPD 2007) to consume the results of a SOAP-based web service and render portions of said results using XSL transforms. The problem I'm having is that the designer isn't much help because the schema for the web service doesn't actually include the elements of the results, so there's no way to d...

How to edit the XSL for RSS Viewer Webpart

I am using a blog site as a source for my RSS Feed. As I see the RSS feed, its showing up as the following :: Blog: Posts Test Thursday, March 04, 2010 - Body: With 25 four's and 3 sixers Sachin crosses 200 (147 balls) runs in an single ODI innings. Creates another world record. Watch the final over where he got it double hundred wit...

Excel spreadsheets with XML

Hi, I'm creating excel spreadsheets for reports using the XML method, where you export a valid Microsoft formatted XML, and then export it to Excel. So far everything works as it should, but I'm having some trouble with the colours. I've created one style such as: <Style ss:ID="s64" ss:Parent="s25"> <Font ss:FontName="Tahoma" x:...

XSLT: Check if any group of elements have a child element with a specified value

Consider the following XML: <AllMyDataz> <Data> <Item1>A</Item1> </Data> <Data> <Item1>B</Item1> </Data> <Data> <Item1>A</Item1> </Data> </AllMyDataz> In my transformation I only want to do something if any of the "Data" elements contain a child element Item1 with the value of "A". I also ...

How to transform XML as a string w/o using files in .NET?

Let's say I have two strings: one is XML data and the other is XSL data. The xml and xsl data are stored in database columns, if you must know. How can I transform the XML in C# w/o saving the xml and xsl as files first? I would like the output to be a string, too (HTML from the transformation). It seems C# prefers to transfor...

Is it possible to use XSLT extensions (sitecore extensions) in XSLT editor in VisualStudio?

I'd like to use vs2008 to edit sitecore's xslt it is a regular xslt with normal .net extensions. Is it possible to add the extension objects to the xslt processor context in visual studio 2008 or visual studio 2010? It can be done easily in code using AddExtensionObject. But I'm not sure how to accomplish the same thing in visual studi...

Find absolute position of xml tag with XSLT

I have this XML document where I want to modify using XSLT to a different format. The problem I'm currently facing is finding the absolute position of a tag relative to root and not to the parent. For instance take the following example: <book> <section> <chapter> </chapter> </section> </book> <book> <section> <ch...

How to extract leaf nodes and path of parent elements from an XSD

I'm trying to transform an XML Schema document and extract a list of all leaf element names and the path of their parent elements, i.e. the names of each element that ref's the current element, and the element that ref's that one, on up to only element that's not referred to by another ref attribute. I'm not getting anywhere, so I don't ...

Using CGI to Generate both XML and XSLT

Is it possible for the XML output of one CGI script to make use of XSLT output generated by another script? I ask mainly because I can't test it right now. Basically, I'd like to know if it's possible or valid for some page.cgi to produce: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="style.cgi?"?> <root> ... </root> ...

XSLT to Compare XMLs using local-name()

Hi, I'm new XSLT but i want to be able compare to XMLs using XSL. The problem the nodes may be changed so i need to make it using lacal-name(). But i can't seem to be able to do it. Please check the below and help me thanks. <xsl:output method="xml" indent="yes"/> <xsl:param name="Doc1" select="Root/items/*" /> <xsl:param n...

Selecting string/literal from a specified child node element using XSLT

this is the excerpt of the XML file. <rdf:RDF> <rdf:Description rdf:about="http://abc.org/JohnD"&gt; <video:Movie xml:lang="en" xmlns:video="http://example.org/movie"&gt;Avatar&lt;/video:Movie&gt; </rdf:Description> <rdf:Description rdf:about="http://abc.org/JohnD"&gt; <foaf:interest xml:lan...

How to find a word within text using XSLT 2.0 and REGEX (which doesn't have \b word boundary)?

I am attempting to scan a string of words and look for the presence of a particular word(case insensitive) in an XSLT 2.0 stylesheet using REGEX. I have a list of words that I wish to iterate over and determine whether or not they exist within a given string. I want to match on a word anywhere within the given text, but I do not want t...

xslt disable-output-escaping turns non-latin characters into question marks "...???????????..."

Hi, I'm using xslt do display Solr response in html, my xsl file is in UTF-8 and non-latin characters (arabic) are nicely displayed, the problem is that when I use disable-output-escaping="yes" to parse html tag, the non-latin chars become a series of question marks ????????? Any clue ? Thanks in advance ...

Turning XSLT into a simple HTML snippet.

The XML <?xml version="1.0" encoding="utf-8" ?> <data> <events /> <tour> <section id="3" handle="tour">Tour</section> <entry id="15"> <title handle="dummy-entry-1">Dummy Entry 1</title> <description mode="formatted">Lorem ipsum dolor sit amet...</description> <photo siz...

XSLT: Splitting none continues Elements/Grouping continues Elements

Need some help with this problem in implementing with XSLT, I had already implemented a Java code of this one using SAX parser, but it is a troublesome due to customer request to change something. So we are doing it now using an XSLT with doesn't need to be compiled and deployed to a web server. I have XML like below. Example 1: <Sho...

How to check if an apply-template filled variable is a string or (possibly) empty node in XSLT?

I need a test for a variable which would evaluate to true in two cases: There is a string inside which contains any non white space characters There is any node (which can be possibly empty) and the variable is filled with apply-template call result. I tried test="normalize-space($var)" but this doesn't cover the empty tag possib...

Grouping every 3 items in xslt 1.0

I'm having troubles to figure out a way to group items xslt 1.0. I have a source xml similar to the one below: <client name="client A"> <project name = "project A1"/> <project name = "project A2"/> <project name = "project A3"/> <project name = "project A4"/> </client> <client name="client B"> <project name = "projec...

Working with XML & XSL

FIRST EDIT I'm fetching the Child 1 tag into a DropDownList in a C# form, Plz suggest the best practise code (C#) for deleting the Parent tag & all it's child tags in an XML file. Example: <Parents> <Parent> <Child 1>Something</Child 1> <Child 2>Something</Child 2> <Child 3>Something</Child 3> <...

Outputting value of xsl:variable with xsl:value-of problem.

I think I may have a misunderstanding of <xsl:variable\> and <xsl:value-of\> so perhaps someone can correct me! I'm attempting to tweak some hardcoded banners to be a bit cleaner so I thought it would be a good idea to create an <xsl:variable> containing the banner link and image code, then use <xml:value-of> at the various places where...

I would like to filter XSL output based on a Radio button selection

Here is my example I am trying to filter by year based on user selection: I assume some js or jQuery code would be needed: XML file: <?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <cd> <title>Empire Burlesque3</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> ...