XSLT: Wrap some tags with another tag

I got some weird XML which I have to import elsewhere. The structure is like this example: <INVOICE> <HEADER_DATA_1> <HEADER_DATA_ITEM_1>foo</HEADER_DATA_ITEM_1> <HEADER_DATA_ITEM_2>bar</HEADER_DATA_ITEM_2> </HEADER_

Copy without namespace with criteria in xslt

I'm using this template for copying without namespace: <xsl:template match="*" mode="copy-no-namespaces"> <xsl:element name="{local-name()}"> <xsl:copy-of select="@*"/> <xsl:apply-templates sele

How to count the number of attributes of a node?

In XSL, how to count the number of attributes of a node? For example: <a/> has zero attribute. <a foo="1"/> has one attribute. <a foo="1" bar="2"/> has two attributes.Simply count(@*) for any element. XML In

catch the first occurrence value

I've the below XML. <chapter num="1"> <section level="sect2"> <page>22</page> </section> <section level="sect3"> <page>23</page> </section> </chapter> here i'm tryin

XSLT - Parameter as a series of nodes

My goal is to pass in the names of multiple files into an XSLT and process the files using document($myFile). I'm trying to pass the parameter through on the command line using the saxon engine and it keeps throwing errors. I know I could write out a

XSL default namespace with search file

I have a input xml with a default namespace. eg as below. <?xml version="1.0" encoding="UTF-8"?> <root xmlns="aaa"> <subroot> <country>aaa</country> <country>bbb</country> <country

for-each does not work for my xslt

I have a problem I couldn't solve despite extensive searching... This is a part from an XML. <contributors> <authors> <author>Willett, C G</author> <author>Tepper, J E</author> <author>Kaufman, D S</author>

XSLT how to ignore {} characters

I am creating an xsl file. I want to print below code as output <li class="td-nav-flyout {position:'containerleft'}"> But when I run the code java says "cannot compile stylesheet". Please help. Thanks in advance. -RiteshWhat abou

Selection of plain text xml

Given xml like this: <container> <item> <xmlText> <someTag> <otherTag> Text </otherTag> </someTag> </xmlText> </item> <container> I would like to select all text that is under item/xmlText. I wou

Use xsl: key to find an attribute of a matched child

Fairly new to XSL - so please forgive noobishness. I have an input XML document (this is actually the docbook form of the Jargon File, snipped significantly): <?xml version="1.0" encoding="ISO-8859-1"?> <glossary> <gloss

Why for-each does not always work?

When I use <xsl:for-each select="plm:PLMXML/plm:ProductRevision> and the value-of as in <td><xsl:value-of select="plm:UserData/plm:UserValue[1]/@value"/></td> follows the web page I am forming with the xsl works perf

How can I reference array values ​​in string.Format?

I am using XPath to exclude certain nodes within a menu. I want to expand on this to exclude nodes identified within an array. This works to exclude all the nodes in the menu with id 2905 whose type is not content: XmlNodeList nextLevelNodeList = cur

Read programmatically from the library

I have a document library named "xsl library" with a bunch of xsl's... and I need to read a file (anyone one) from there so I can use it transform a xml that renders a webpart... the layout out of a webpart is determined by the xsl... how can I

XSL help required

Hello Am a beginner to XSL hardly know few commands. I was trying out a sample where i have to format a number based on the entry in the XML. I want to use the format-number function to achieve the same. <Details> <Order>Bulk Order</Order&g

JUnit Report a single page XSLT for email

I have a Junit process that runs a bunch of data integrity tests every night, and I would like to have it email the results in a nicely formatted HTML email. The issue is the HTML formatter built into JUnit uses frames and an external stylesheet so i

returns html from a web service in asp.net

Is there anyway to return HTML from a web service in C#? If I have my XSLT transform output tag as XML then I'm geting the XML tag <?xml version="1.0" encoding="UTF-8"?> at the top of the returned page. Under that is my HTML and

.NET XSLT Transformation, is it really streaming?

I have an XML that I need remove empty elements from. I am trying to avoid using the DOM and am trying to do this as streams. I have this code, but I am not entirely sure how correct and optimized this is. StringBuilder xslt = new StringBuilder(); xs

Windows .NET control for editing XML / XSL?

Apologies if this has been asked before. Had a quick search and there's nothing that answers my question 100%. I've got some XSL stored in the database which I want the user to be able to edit within my .NET Windows application. I could just stick it

A large xslt smaller more granular

We have one large xslt that renders a whole shop area including products, manifacturers and does filtering based on price and cateogry on top of that. I'm using sitecore as a CMS and I'm having problems with caching. I have about 9000 items and some