xslt

XSLT: Add namespace to root element

I need to change namespaces in the root element as follows: input document: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <foo xsi:schemaLocation="urn:isbn:1-931666-22-9 http://www.loc.gov/ead/ead.xsd" xmlns:ns2="http://www.w3.org/1999/xlink" xmlns="urn:isbn:1-931666-22-9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...

XSL Doctype Issue

I'm having issues with an XSL template that is outputting to HTML. There is a javascript being rendered on the resulting HTML page that requires a strict doctype in order to work across all browsers. However, I cant get the doctype to show up. Any thoughts on this? Would it be possible to insert it dynamically, using javascript or ph...

XSL check param length and make a choice

I need to check if a param has got a value in it and if it has then do this line otherwise do this line. I've got it working whereas I don't get errors but it's not taking the right branch The branch that is wrong is in the volunteer_role template <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="htt...

How to group using XSLT

I'm having trouble grouping a set of nodes. I've found an article that does work with grouping and i have tested it and it works on a small test stylesheet i have I now need to use it in my stylesheet where I only want to select node sets that have a specific value. What I want to do in my stylesheet is select all users who have a use...

How to embed ${ text } into a XSLT

Thank you for taking the time to look at my post. I have an input tag that i need to have output-ed like so: <input type="hidden" name="success_redirect" value="http://www.webpage.com?var1=${root/option1}&amp;amp;var2=${root/option2}" /> but i cant get that into my xslt document without it eventually rendering to <input type="hidden...

How do i select all text nodes between two elements, using XSL?

I want to get the generate-id(.) of all the text nodes after node <m/> and before node </n>. I am looking for some generic XSL and not tightly coupled to the sample input pattern mentioned below. For any input pattern i want to get the ids of all the text nodes between node <m/> and <n/>. Sample input for better understanding: <a> <b...

MOSS Content Query Web part itemstyle.xsl

Hi, I have a Content Query Webpart (CQWP) pulling the URL and title from a NewsLinks list. The CQWP uses the XSLT style LVIS.News.Links defined in ItemStyle.xsl. I need to sort the title @Title0 field as commented out below because it causes an error. Does anyone know whats causing this error? - Many Thanks. The XSLT code is below: <...

XSLT inserting once off custom text

Hi all: The folloiwng is a pre-existing xml file. I was wondering how can I insert a element before the first element using xslt? <XmlFile> <!-- insert another <tag> element here --> <tag> <innerTag> </innerTag> </tag> <tag> <innerTag> </innerTag> </tag> <tag> <innerTag...

XSL using apply templates and match instead of call template

I am trying to make the transition from using call-template to using applay templates and match but i'm not getting any data displayed only what is between the volunteer tags. When i use call template it works fine but it was suggested that i use applay-templates and match and not it doesn't work Any ideas how to make this work? I can ...

Xsl and html text boxes

I'm trying to get xsl to drop a value into a text box via the html ... something like Name : <input id="Name" type="text" value=<xsl:value-of select="something"/> /> but that doesn't work (didn't expect it to) -- is there a way to make this work? ...

XSLT Get the first occurence of a specific tag

Let's say i have a full html-document as XML-input. How would the XSLT-file look if i only want to output the first (or any) image from the html? ...

Test first subnode from node.

XML: <mode> <submode>1</submode> <submode>2</submode> <submode>3</submode> <submode>4</submode> <submode>5</submode> <submode>6</submode> <submode>7</submode> </mode> <mode> <submode>7</submode> <submode>8</submode> <submode>9</submode> <...

XSL apply templates not working...could be XPath error

I have converted mny stylesheet to use apply templates instead of call templates and it worked fine for my other styesheet, which was more complicated, but this one doesn't seem to work even thought it is a much simpler template. All that it outputs is the sex node and the userlevel node. I think it has to do with my Xpath. All i want...

How do i modify the XSL to change the xml format.

In the below XSL every time the xsl:when gets satisfied I want to append as many <a> and </a> tags. But the data that needs to be populated inside the tags should be only once. I have shown the expected output at the end. <xsl:param name="insert-file" as="document-node()" /> <xsl:template match="*"> <xsl:variable name="input">My text<...

Setting a Global Doctype

Is it possible using PHP (I was thinking may the phpinfo file or a php.ini file) or an .htaccess file to set a doctype for an entire subdirectory? Basically, in a nutshell, I'm using a software that uses XSL templates to output data to a set of HTML files. Modifying the xsl:output tag to include the doctype breaks the template and ther...

XSL Reuse? YES! But: Element must not contain an xsl:import element! :-(

I am using a heavy stylesheet with a lot of recurring transformations, so I thought it would be smart to reuse the same chunks of code, so I would not need to make the same changes at a bunch of different places. So I discovered , but -alas- it won't allow me to do it. When trying to run it in Sonic Workbench I get the following error: ...

xslt + javascript -> a full functional small scale web site?

is it possible to build a full functional, small scaled website, without java or python or perl or php? and with xml files as simple data storage? therefore, i can move my website any where I want..... any experiences like this to share? thanks. ...

xslt broken: pattern does not match

I'm trying to query an xml file using the following xslt: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:bpmn="http://dkm.fbk.eu/...

how to transform xml with xslt preserving <br /> tags in a text

I want to transform (with jquery.xslt.js) xml to be preserving tags in text nodes. Xml looks like: <example> <text> Some text with <br /> and <img src="source" /> then text .... </text> </example> I want to have: <div class="example"> <p>Some text with <br /> and <img src="source" /> then text ....</p> </div> If I...

transformation of UML Diagrams to specification Z using xsl transformation

hi. I'm trying to transform some uml diagrams (of singleton , AbstractFactory ...) to Z specification , first i transformed my uml diagram to an xml file using starUML then i used an xsl program and saxon to transform my xml file to .tex( for Z ) , but it didnt work . if someone has an idea about how the xsl program should be written ...