xslt

XPath selection

I'm having trouble writing an XPath expression to select nodes that contain certain elements, while excluding siblings of this element that I'm not interested in. I suspect this can't be done with XPath alone and that I will need to use XSLT. Using this source document <items> <item id="foo1"> <attr1>val1</attr1> <attr...

XSLT sum of values based on data in two different tables

XML: <Budget> <Table1> <AllocID>1</AllocID> <Amount>1000</Amount> </Table1> <Table1> <AllocID>2</AllocID> <Amount>2000</Amount> </Table1> <Table1> <AllocID>3</AllocID> <Amount>3000</Amount> </Table1> <Table2> <AllocID>1</AllocID> <Split>100</Spli...

generate javascript using xml and xsl

I have tried every solution I found on here and even a larger Google search but nothing seems to work. Here is my problem... I have data that is in XML that I would like to visualize using the Google Visualization API. I was hoping I could simply use XSL to generate what I need instead of doing anything with data sources (I have my re...

Copying part of one XML DOM to another for XSL transformation (.NET)

The scope of XML and DOM in .NET 3.5 is so large that I'm having trouble coming up with a simple solution to my problem without using too many lines of messy code. Since people here always come up with some elegant solutions, I thought it would be a good question. How do I take in an XML file (that I created and saved earlier in the pro...

How does one use EXSLT modules in XMLSpy?

I'm trying to use the EXSLT modules (specifically, math), in an XQuery document. How do I enable support for this in XMLSpy? Where would I place the downloaded EXSLT libraries to make XMLSpy aware of them? ...

Converting XML to escaped text in XSLT

How can I convert the following XML to an escaped text using XSLT? Source: <?xml version="1.0" encoding="utf-8"?> <abc> <def ghi="jkl"> mnop </def> </abc> Output: <TestElement>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;abc&gt;&lt;def ghi="jkl"&gt; mnop &lt;/def&gt;&lt;/abc&gt;</TestElement> Currently, I'm trying...

Map XML data from different XML Schema

Hi, We've an XML contains data. We need to extract data from it and move it in to a different XML. Both XMLs are different in structure. We have Altova and we want to do this job by using it. Any solution on this; which Altova tool will be best for this job and how? Thanks. ...

Debugging Nant Build scripts in VS 2005

HI, We are using NANT build scripts in our project. The scenario is as follows, In my Application I create an application( this is basically UI based, the user drags, drops widgets etc, these are stored as xml internally). then while I say Build application, we use NANT scripts to call XSLT transform, I do not know if it is possible to...

xml transformation - add attributes to previous node depending on current node.

I've got an ejb-jar.xml that doesn't have an 'id' attribute in the tag. What would be the best way to fix this? Could XSLT be used for this? <session> <ejb-name>EJB1</ejb-name> <local-home>x.E1LH</local-home> <local>x.E1L</local> <ejb-class>x.E1EJB</ejb-class> <session-type>Stateless</session-type> <transaction-type>Contai...

.NET 3.5 RSS and XML Stylesheets

Can you add an XML-stylesheet to the RSS feed generated through the new System.ServiceModel.Syndication namespace? ...

Delete and concatenate child nodes using XSLT

hey everyone my xml looks like this: <someElement> <DB> <DBELEMENT> </DBELEMENT> <DBELEMENT> </DBELEMENT> </DB> <GROUP> <OBJECT> <something type="name"> <value>some value </value> </something> <something type="desc"> <value someattribue="AA"> <StyledElement> ...

Transforming one XML format to another via XSL

The existing format is <A> <B> <C>hello</C> <C>how</C> <C>are</C> <C>you</C> </B> </A> I want to transform it to something like this <start> <A> <B> <tag1> hello </tag1> <tag2> hello </tag2> </B> </A> <A> <B> <tag1> are </tag1> <tag2> you </tag2> </B> </A> </start>...

Factorial in XSLT limit?

Hi. I have the following factorial function implemented in XSLT: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:output method="text"/> <xsl:template match="/"> <xsl:apply-templates> </xsl:apply-templates> </xsl:template> <xsl:template match="facto...

How do I generate an HTML file using XSL?

Hello, As I understand it, using XSL to generate documents has two parts: 1) An XML document which references an XSL stylesheet 2) An XSL stylesheet Let's say that I want to generate a document using XSL, and then send it to a friend. Without relying on the stylesheet being available on the internet, and without including the styleshe...

Generic Xml Document manipulation

We have xml documents that contain lots of flagged nodes like isProduct, isActive , isMandatory where the node text may be True or False. It is needed to manipulate the documents and keep their structure but convert the above nodes into a verbal representation like below: < isProduct >True</ isProduct > ===> <Type>Product<Type> < ...

XSLT. load xml document that contains escape characters

I use XSLT to transform an XML document which I then load on to a ASP.NET website. However, if the XML contains '<' characters, the XML becomes malformed. <title><b> < left arrows <b></title> If I use disable-output-escaping="yes", the XML cannot be loaded and I get the error "Name cannot begin with the '' character". If I do not di...

Matrix transposition in XSLT

I'm trying to go from this kind of input: <col title="one"> <cell>a</cell> <cell>b</cell> <cell>c</cell> <cell>d</cell> </col> <col title="two"> <cell>e</cell> <cell>f</cell> <cell>g</cell> </col> ... to this HTML output with XSLT: <table> <tr> <th>one</th> <th>two</th> </tr> <tr> <td>a</td> <td>e</td> </tr> <...

Eliminating duplicate same-level elements in XSLT

I'm looking to display a list of same-level node names, without duplicates. Let's say I have <a> <b> <c /> <d /> <d /> </b> <b> <e /> <c /> <f /> </b> </a> I'd want c,d,e,f to be displayed. I've found several solutions to a similar problem, eliminating duplicate siblings...

How come resolve-QName() is an unknown XSLT function when using XslCompiledTransform ?

I try to transform a WSDL 1.1 to WSDL 2.0 using the XSLT 2.0 stylesheet from W3.org WSDL 1.1 to WSDL 2.0 convertor. I'm working in .NET (C#) using the XslCompiledTransform. Anyone has an idea why I get the "resolve-QName() is an unknown XSLT function" exception ? Any workarounds ? Thx ...

XSL : how to select a unique nodes in a nodeset

I have been reading on the different question talking about selecting unique nodes in a document (using the Muenchian method) but in my case I cannot use keys (or I do not know how) because I am working on a node set and not on the document. And keys cannot be set on a node-set. Basically I have a variable: <xsl:variable name="limitedS...