xslt

access xslt elements from codebehind

How can i set value(in code behind) for an element declared in the xslt ? Here is my xslt <xsl:for-each select="Header/Item"> <td class="rowHead" style="vertical-align:bottom;"> <a href="#"> <xsl:attribute name="id"> <xsl:text>aColumnText</xsl:text> <xsl:value-of select="@count"/> ...

XSL parent child problem

I have a xml build of <elig> <subscriber code="1234"/> <date to="12/30/2004" from="12/31/2004"/> <person name="bob" ID="654321"/> <dog type="labrador" color="white"/> <location name="hawaii" islandCode="01"/> </subscriber> </elig> In XSL I have: <xsl:template match=...

XSLT: processing only selected nodes

An XSLT-newbie problem: I need to substitute a text value in XML-file. All other nodes must be left unchanged. Here's my input file (in.xml): <?xml version="1.0" encoding="UTF-8"?> <root> <level1 attr1="val1"> <level2>in</level2> </level1> </root> Here's my XSLT-transformation (subst.xsl): <?xml version="1.0" encoding="U...

How can I do string operations in XSLT?

I have the following code block in my xslt; <xsl:when test="StatusData/Status/Temperature > 27"> <td bgcolor="#ffaaaa"> <xsl:value-of select="StatusData/Status/Temperature" /> </td> </xsl:when> But as you might guess when the value is 34,5 instead of 34.5 it is recognis...

XPATH or XSL to match two node-sets using custom comparison

EDIT: I also have access to ESXLT functions. I have two node sets of string tokens. One set contains values like these: /Geography/North America/California/San Francisco /Geography/Asia/Japan/Tokyo/Shinjuku The other set contains values like these: /Geography/North America/ /Geography/Asia/Japan/ My goal is to find a "match" betwe...

Rename nodes with XSLT

I am trying something very simple, but for some reason it does not work. Basically, I need to rename some nodes in an XML document. Thus, I created an XSLT file to do the transformation. Here is an example of the XML: EDIT: Addresses and Address elements occur at many levels. This is what caused me to have to try and apply an XSLT. The...

How can I properly hide a list of XSL processed XML elements using javascript

Good morning. I have an XML file which contains lists of warning and errors from a build output. I have successfully been able to write XSL to iterate over the separate lists of warnings and errors to have them display in my browser. What I'd like to do next would be to add a bit of javascript in order to add a link/button to be able ...

xsl:template match doesn't find matches

I'm trying to convert some Xaml to HTML using the .NET XslCompiledTransform and am running into difficulties getting the xslt to match Xaml tags. For instance with this Xaml input: <FlowDocument PagePadding="5,0,5,0" AllowDrop="True" NumberSubstitution.CultureSource="User" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentatio...

Any big sites using Client Side XSLT?

Lately, I've been pondering the somewhat non-mainstream architecture of building raw XML on the server side, and then using an XSLT stylesheet on the client to transform the XML into the full UI. Of course, a fallback mechanism would have to exist if the client was not capable of client side XSLT, in which case we'd just transform it fo...

How to get a filtererd datatable from a XSL transform

I am trying to run a DataTable through an XSL tranform and then put the results back into a DataTable. My DataTable is coming up empty. Any help would be great. Dim finalExelList As New DataTable Dim xlsMyList = New XPath.XPathDocument(New StringReader(myList.DataSet.GetXml())) Dim trans As Xsl.XslCompiledTransform = New Xsl.XslCompiled...

XSD schema: Meta data driven generation with XSLT

I'm regularly creating an XSD schema by transforming a proprietary data model of a legacy system. This works out pretty good. However, the legacy system only allows me to specify very basic attributes of a parameter, such as the data type (int, string etc.). I would like to enhance the XSL transformation with a mechanism that allows me ...

Transforming HTML with XSL and modifying form attributes

I would like to parse HTML document and replace action attribute of all the forms and add some hidden fields with XSL. Can someone show some examples of XSL that can do this? ...

Dealing with Method Calls/XSLT Tranform in ASP.NET

I've got an ASP.NET page that uses code similar to the following: <asp: repeater> <tr><td><b>LabelName</b></td><td><%# SomeMethod(parameter) %></td></tr> </asp: repeater> These Labels are presently hardcoded, but there is an XML document that contains something like the following: <label type="LabelA" name="LabelName" />> ...

Output result of xsl:value-of in an xml attribute

I have an XML input file and I'm trying to output the result of a call like: <xsl:value-of select="Some/Value"/> into an attribute. <Output Attribute="Value should be put here"/> My problem is since I'm outputing XML the xsl processor won't allow me to write: <Output Attribute="<xsl:value-of select="Some/Value"/>"> How do y...

How to 'select' from XML with namespaces with XSLT?

I have an XML document something like ::: <?xml version="1.0" encoding="utf-8"?> <?mso-application progid="Excel.Sheet"?> <Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="urn:schemas-mi...

XSLT $param name in div

Hi, I have A $param that I am passing into a template. I wish to use the value of this parameter as class name for a div. The class is not taking the value of the parameter but taking the parameter name (in the html page it is $param). Is there any way I can use the value of a parameter as a class name? Thanks John ...

invalid QName when transforming a .net XSLTransform

I have a piece of XML that is structured similar to this: <root> <score name="Exam 1"><value>76</value></score> <score name="Exam 2"><value>87</value</score> </root> and I would like to transform it to look like this: <root> <Exam 1>76</Exam 1> <Exam 2>87</Exam 2> </root> Following this article I am using ...

How do I remove the BOM character from my xml file

I am using xsl to control the output of my xml file, but the BOM character is being added. Thanks ...

How to remove <b/> from a document

I'm trying to have an XSLT that copies most of the tags but removes empty "<b/>" tags. That is, it should copy as-is "<b> </b>" or "<b>toto</b>" but completely remove "<b/>". I think the template would look like : <xsl:template match="b"> <xsl:if test=".hasChildren()"> <xsl:element name="b"> <xsl:apply-templates/> </xsl...

xslt template optimization

Hi I have a following xslt code : <xsl:template match="table_terms_and_abbr"> <informaltable frame='none' colsep='none' rowsep='none'> <tgroup cols='2' align='left'> <colspec colnum="1" colwidth='1*'/> <colspec colnum="2" colwidth='1*'/> <xsl:apply-templates/> </tgroup> </...