xslt

is numerical and is alpha/numerical in XPath or XSL

Hi! I am wondering if it is possible to use XPath or XSL to determine if a XML node value is numerical or alpha/numerical. (It is user entered data.. so it could be either..) I was searching for some sort of function in XPath to do this.. but I couldn't find any. for example: <example> <test1 attribute="123">12dfffg23</test1> ...

Counting distinct items in XSLT

I have XML like this: <assessment> <variables> <variable> <attributes> <variable_name value="FRED"/> </attributes> </variable> </variables> <variables> <variable> <attributes> <variable_name value="MORTIMER"/> </attributes> </variable> </variables> <variables> <variable> <attributes> <variable_n...

Using a custom class file in Umbraco XSLT

I'm trying to reference a custom class file in XSLT code. I deployed it as a DLL file to the /Bin directory. Keep getting this error: System.Xml.Xsl.XslTransformException: Cannot find the script or external object that implements prefix 'urn:sso'. CS File Declarations: namespace SSOUtilities { public class sso XSLT Re...

Applying templates to elements in a variable/sequence

When I use "apply-templates" and select a variable sequence, does the template act upon the context of the element in the sequence, or does it act upon the context of the element in the document? In the below example, it seems to do either, or none, but I don't understand why. <root> <a/> <b/> <c><a/></c> <a/> </root> <?xml version="...

How to pass parameters to XSLT ?

I have a problem. I have an XML file that contains information about 100 courses. I have an XSL file that nicely displays the list of 100 courses. But what if I want to only display 1 course. Can I pass a parameter to the XSLT file to tell it to only display "ENGL 100" ? The XML looks something like this: <document> <menu> <it...

How to prevent line-wrapping by XSLT?

I have some XML like this: <root> <do-not-sort> <z/> <y/> </do-not-sort> <sortable> <e f="fog" h="bat" j="cat"> <n n="p"/> <m n="p"/> </e> <d b="fop" c="bar" k="cab"> <m o="p"/> <m n="p"/> </d> </sortable> </root> I want to sort the children of the...

Unknown chr being output after XSL Compiled Transform

Hi, my code is outputting some weird character at the very start of my XSLT output XML and neither Visual Studio 2008 or notepad show it up. But it's definitely there because VS lets me delete it and will then auto-format the XML properly. How do I stop this? Here's my code: // create the readers for the xml and xsl XmlReader re...

Why is this XML being output by this XSLT? I'm using the XslCompiledTransform....

Could someone tell me why this is happening, please? My XML is: <?xml version="1.0" encoding="utf-8" ?> <example xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="XMLCompositeQuoteswithSelect.xsd"> <title>some text goes here</title> <atopelem>a top elem</atopelem> <date>today</date> <a...

Xslt how to style conditional odd/even rows

I've an html table written using xslt transformation that looks like this <table> <xsl:for-each select="someNode"> <xsl:if test="testThis"> <tr> <!-- <xsl:call-template name="conditionalRowStyle"/> --> <td>something</td> </tr> </xsl:if> <tr> ...

XSLT: Using copy-of to output xml

Hi, I am using the copy-of element in xsl to print some xml to client, but the xslt outputs the unescapes the escaped xml characters to the output e.g. if the xml being transformed is <one attr="http://one.com/page?param1=value1&amp;amp;param2=value2">    <child>text</child> </one> and if i use the copy-of to output this node <xsl:c...

XSLT - Output contents of a file (embed contents of a .css in generated .html)

Hi, is there a way to output the contents of a file in XSLT? Background: I have an xml file as input for a xslt stylesheet and generate an html file, which links to a css. So far so good. Now I want to change my xslt in a way that the contents of the css is embedded within the html file (using a <style> element). However, I would like...

Counting distinct items in XSLT independent of depth

If I run the following XSLT code: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:output method="text"/> <xsl:key name="kValueByVal" match="variable_name/@value" use="."/> <xsl:template match="assessment"> <xsl:for-each select=" /*/*/variable/attributes/variable_name/@value ...

background-color not covering full screen with xsl in xhtml

When I tried to convert my website to xhtml, things went perfectly until I realized that IE doesn't support it. I went to the xhtml FAQ's section about IE, and tried out the workaround there, using an identity transformation to trick IE into rendering it as html in quirks mode. Unfortunately, this seems to make firefox (and possibly oth...

Rendering xhtml compliant pages with XSLT won't render correctly past inline javascript block

I'm currently in the process of updating a (lot of) old xsl+html code to render xhtml compliant code but am running up against a problem where pages include inline javascript. Some of the javascript can be removed from being inline and placed into linked js files. However, there are a number of places where xsl elements are used inside...

Removing blank lines in XSLT

Hi, I'm using: <xsl:template match="material_id | location_code"></xsl:template> To get rid of elements in the source XML called material_id and location_code, but whitespace lines remain, leaving an output XML something like: <entries> <Identity>conflab1</Identity> <price>24.36</price> <pricedate>15-Jul-2010 13:35:18 ...

Can I insert one variable into other variable in Xsl? Thanks

<xsl:variable name="id"> <idNum>0607V45621014F</idNum> </xsl:variable> <xsl:variable name="pathId" select="Orders/Order[ORD_Num='$id/idNum']"/> ....not select the idNum an other..not.. <xsl:variable name="XmlFile" select="YG.xml"/> <xsl:value-of select="document($XmlFile)/aziende/azienda/ragione_sociale"/> or other...not.. <xs...

Counting distinct items in XSLT and listing only once

I have the following XML: <assessment> <section> <item> <attributes> <variables> <variable> <variable_name value="MORTIMER"/> </variable> </variables> </attributes> </item> <item> ...

PostgreSQL 8.4 XML, XSLT and XPath possibilities / documentation.

The available PostgreSQL material on XML, XSLT and XPath is limited. There are the official docs from the PostgreSQL team, however these cover only a few pages of content and I've never been convinced that their docs are as comprehensive as they could be. There are also some bits and bobs on sites kicking around, however there is not to...

Convince Firefox to parse HTML embedded in XML (after XSL is applied)

I have some XML files of this form: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="biomirror.xsl"?> <Thread> <Title> Some thread title </Title> <Posts> <Post> <Author> Me </Author> <Body> This is the post body, which <b>may</b> have embedded XHTML, in...

Can I pass the result of an xslt template as a param to another template?

I am trying to basically recreate the functionality of an ASP.NET master page with an XSLT template. I have a "master page" template that contains much of the page html stored in an .xslt file. I have another .xslt file specific to a single page, that takes in xml representing the page data. I want to call the master page template from ...