xslt

How do I make xsl transformation indent the output?

I'm using xalan with the following xsl header: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:redirect="http://xml.apache.org/xalan/redirect" extension-element-prefixes="redirect" xmlns:xalan="http://xml.apache.org/xalan"&gt; <xsl:output method="text" indent="yes" xalan:indent-amount...

move xsl sibling node inside parent?

How can I get from this: <Include xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt; <Component Feature="toplevel"> <File Id="fil8A88F8B155E29670FCA1B83F0E99E635" /> <TypeLib Id="{DC88F377-25DD-49C8-99D9-1FD8AE484362}" > <Interface Id="{5D12ED70-0B5A-49C4-A8A3-FC4C209295BA}" /> <Interface Id...

Parameters not being passed into template when using the .Net transform classes

I am using the .Net XslCompiledTranform to run some simple XSLT (see below for a simplified example). The example XSLT is meant to do simply show the value of the parameter that is passed in to the template. The output is what I expect it to be (i.e. <result xmlns:p1="http://www.doesnotexist.com"&gt; <valueOfParamA>valueA</valueOfPa...

Replace underscore between words (reg.exp)

Hey, I need a regular expression to solve the following problem (links to similar problems is also appreciated, related tutorials etc.): "__some_words_a_b___" => "__some words a b___" "____" => "____" "some___words" => "some words" So I want underscores between words to be replaced with space and keep leading and trailing underscor...

basic operations for modifying a source document with XSLT

All the tutorials and examples I've found of XSLT processing seem to assume your destination will be a significantly different format/structure to your source and that you know the structure of the source in advance. I'm struggling with finding out how to perform simple "in-place" modifications to a HTML document without knowing anything...

Could not find function: resolve-uri

When i am trying to transform xml it gives me erro that Could not find function: resolve-uri where resolve-uri is a xpath function . below is my xslt line which will use resolve uri function . <xsl:variable name="filename" select="resolve-uri(concat($dir,'/',$xmlFileName,'_',position(),'.xml'))" /> Can anybody please help me.Is it ...

XSLT transformation to produce valid XHTML: a namespace issue

I have seen this resource link text but I still have troubles generating a valid XHTML document using MSXML parser. I have in input the following document: <?xml version="1.0" encoding="UTF-8" ?> - <html xml:lang="it" xmlns="http://www.w3.org/1999/xhtml"&gt; - <head xmlns=""> <meta http-equiv="Content-Type" content="text/html; c...

How to retrieve xsl:output media-type value from xsl file via ASP.NET

Is there a way to retrieve the media-type value? e.g. like OutputSettings.OutputMethod used to get xsl:output method. ...

Sorting multiple XML elements within a node, by attribute

I've tried several of the solutions that I've found here, but none seem to work on the model that I'm using. In my example XML, I'm trying to sort the mixed up chapters, into their proper sequence. Source XML: <?xml version="1.0" encoding="utf-8"?> <library> <book> <title>A Fascinating Tale</title> <chapt...

What is the scope of xsl apply-imports?

My original idea about apply-imports was that if there are two templates which matches the same node, then using apply-imports in a template with higher priority runs the template with the lower priority. But I recently find out that it's important how are imports organized. Two cases interests me particularly. Will apply imports work...

Hide elements and 'View more' using jQuery

Hi all, JavaScript is not my strong point, but then I'm not sure I'm hitting this from the right direction. Firstly, I have some XSLT which produces HTML tables with event information in them. I assign a numerical ID to each table which matches the XSL position(). What I want to achieve is to show only the first 10 tables, until the u...

How to get the information and sort, a subset of elements with only identifiers using XSLT?

Hi, I'm new to XSLT and I can't resolve the following problem: I have a xml file like this: <root> <subset> <e id="A"></e> <e id="C"></e> </subset> <data> <info id="A" order="3" name="ANode"></info> <info id="B" order="4" name="BNode"></info> <info id="C" order="1" name="CNode"></inf...

A way to split a huge XML file into smaller xml files with XSL

Hi, I get a huge XML file containing a list of TV broadcasts. And I have to split it up into small files containing all broadcasts for one day only. I managed to to that but have two problems with the xml header and a node being there multiple times. The structure of the XML is the following: <?xml version="1.0" encoding="UTF-8"?> <br...

what is the best free editor for xslt and mybe xsl:fo and xml?

Hello im looking for free IDE to work with xslt and xml's and even xsl:fo is there any out there? ( i really didn't found any free tool ..) ...

XSLT version 1 URL encoding

Hi, Is there a URL encoding function in XSLT version 1? I need something similar to encodeURIComponent function in javascript? Seeing as this is not possible as I'm using .NET platform as the XSLT is applied to a Sharepoint page. Is there a way to code this buy calling the javascript encode function within the XML, snippet below: <xsl...

XSLT and MVC Certification

Hello, I want to learn xslt and also asp.net mvc, but I'd like to have an exam so I can get a certification. Are there exams for xslt or mvc from Microsoft or from another company? Thanks. ...

XSLT string parsing

Hi, Im new to XSLT for the 'PrimarySubject' below I need to replace'&' characters to %26 and ' ' characters to %20 that it contains. <xsl:template name="BuildLink"> <xsl:param name="PrimarySubject" /> <xsl:text>?PrimarySubject=</xsl:text> <xsl:value-of select="$PrimarySubject" /> </xsl:template> Is there string repla...

How to feed an xml database with tags obtained thru html forms ?

Hello! Not a programmer, I begin with xml, html forms and xslt on Mac. I plan to use a form to post short texts in a xhtml page and invite end users to add some annotations to the said text. The users would select a specific part of the text posted and each annotation would stand for one specific chain of characters. My goal is to c...

XSL transformation generating output from other nodes

I have the following XSL template (I omitted the template for Organization, let me know if it's necessary): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt; <xsl:output method="html" indent="yes" omit-xml-declaration="yes"/> <xsl:tem...

How can I dynamically set the default namespace declaration of an XSLT transformation's output XML?

I can do it, but not for the default namespace, using the <xsl:namespace>. If I try to do it for the default namespace: <xsl:namespace name="" select"myUri"/> it never works. It demands that I explicitly define the namespace of the element to be able to use the above null prefix declaration. The reason I want this is because I have a ...