xslt

MSXML - Namespaces info not persisting

I am using MSXML 6.0 to perform a transform of my own XML into another XML format. I am not sure if I maybe just don't understand exactly how MSXML works, but I believe I have noticed some strange behaviour with it.... I am adding in the namespaces to my XML doc using the setProperty method e.g. XmlDocument.setProperty('SelectionNamesp...

xslt key and match

I am pretty new to xslt, sorry for the confusion i caused and may waste your time... Actually what I am really trying to do is: I have two queries, first query (orders/order) <query name="orders" rowElementName="order"> select ordernumber, subtotal, total from tablex </query> return something like: ordernumber subtotal ...

xsl reference to external xsl file

Hi all, I have a question about xsl. I have 1 huge xsl file (+4000 lines :p) and I would like to split the file in different parts. I use the xsl file to map some schemas in BizTalk and it would be more performant if I split it in parts, so I can re-use the parts. Anyway, don't mind the BizTalk stuff, how can I reference from my main xs...

How to use XSL variable in xsl:apply-templates?

I have a reasonably complex call to xsl:apply-templates: <xsl:apply-templates select="columnval[@id and not(@id='_Name_') and not(@id='Group') and not(@id='_Count_')]"/> The expression is reused in other places like ...

xslt - subtracting days

Hi, Is it possible with xslt to take a date field and subtract N number of days from it? If so, can you please provide me an example? Thanks in advance for your help! Matt ...

Saxon XSLT 2.0 and RFC 822 date format

Hi, What is the right way to format xs:dateTime to RFC 822? ...

XSLT: Modify attribute value based on sibling attribute value

I have the following XML: <?xml version="1.0" encoding="UTF-8"?> <ODM FileOID="some oid" Description="some desc" CreationDateTime="2010-10-06T22:35:00-06:00" FileType="Snapshot" > <Study OID="S_TEST"> <GlobalVariables> <StudyName>Study_Name</StudyName> <StudyDescription> Some study des...

XSLT: When element exists add it and change value otherwise add element with value

Hi Everbody, My problem is that in some xml files an element exists and in another it does not. When the element exists, it's value should be changed. If it does not exists, it should be added. Here is an example for better understanding: <root> <group> <element1>SomeValue1</element1> <element2>SomeValue2</element2...

XSL - Removing the filename from the path string

I've got a SharePoint problem which I need some help with. I'm creating some custom ItemStyles to format the output of a Content Query Webpart (CQWP) but I need to insert a "view all" button into the output. View all needs to point to: http://www.site.com/subsite/doclibrary1/Forms/AllItems.aspx All the individual files in the document ...

Select the current value in a dropdownlist using XSL and SharePoint

I'm using the row edit template below. The problem I have is that the current value is not selected when the row edit XSL template is used. The value defaults to the first item in the list. What is the best way to get the current value to be the selected item in the template below? I thought having DataValueField="{@type}" and DataTe...

Tranforming XSLT text element with "one space character" yields empty content

I've got this incoming XML I'm transforming (with XSLT in ASP using msxsm6): <Cell> <Data xmlns="http://www.w3.org/TR/REC-html40"&gt; <Font>Text1</Font> <Font> </Font> <Font>Text2</Font> <Data> </Cell> If the template for <Font> is: <xsl:template match="Font"> <xsl:copy/> </xsl:template> The transform ...

XSLT, JSTL e JSF

I have a xml file which I want to transform in a jsf code page. To do that I've created a xsl file. xml: <?xml version='1.0' encoding='ISO-8859-1'?> <questionario xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='Schema2.xsd'> <componente nome='input'> <id>input1</id> </...

Saxon XSLT 2.0 ignore whitespace

Hi, I'm using text output method. And I need to ignore all whitespaces in template. <xsl:template ...> text </xsl:template> I'm receiving in output "     text", but I need only "text". Thanks. ...

Create a new XMLDocument by filtering an existing document in c# using xpath

Hi I have a situation where I receive an XML (document) file from an external company. I need to filter the document to remove all data I am not interested in. The file is about 500KB but will be requested very often. let say the following file: <dvdlist> <dvd> <title>title 1</title> <director>directory 2</director> <p...

Passing arguments to Visual Studio's XSLT debugger

I'm debugging a transform with Visual Studio. The application that uses the transform normally also passes in some parameters: XslTransform xslTransform = new XslTransform(); xslTransform.Load(myXslt); XsltArgumentList transformArgumentList = new XsltArgumentList(); transformArgumentList.AddParam(paramName1, String.Empty, paramValue1); ...

Transform nested xml items with xslt

Hi, How can I transform nested XML elements with xslt, keeping the structure? Let's say I have an XML document like this: <?xml version="1.0" encoding="UTF-8"?> <root> <node> </node> <node> <node> <node> </node> </node> </node> </root> And I would like to get something like this: <?xml version="1.0" enco...

XSLT libray for v8/Node.js

After some quick Googling, I found that there are some XML libraries available for v8/Node.js: http://github.com/ry/node/wiki/modules#parsers-xml However, after drilling down into these modules, it seems that they only provide support for parsing XML documents, and manipulating them with DOM. I'm wondering if anyone is aware of an XSLT ...

XSLT Number test

I am having a problem where the value of the $current variable came in as '6E144270003'. My original goal was to just test for a number, but '6E144270003' passed the number() test because it is a valid 'scientific notation' (as was pointed out to me here). I need a valid test to allow data containing only integers (can include the deci...

Grouping XML nodes by Month and Year in XSLT

Update I'd like to appologize to the people who provided answers, I seem to have caused all sorts of confusion. To avoid complicating things even further, I've removed the previous code and have added new information. Read on... I'm working on a custom Blog in Umbraco. Umbraco spits out XML as the output which is then read using XS...

XSL, get current working directory

I'm looking for a concrete example of an XSL stylesheet storing the current working directory into a variable. I need this because in my situation, I need to import certain library stylesheets using a relative path. Knowing the path my processor is choosing as the current directory would be sufficient. EDIT Nothing vendor specific p...