xslt

In XSLT, how can you get the file creation/modification date of the XML file?

I would like to know the file creation/modification date of the XML file currently being processed by my XSLT code. I am processing an XML file and producing an HTML report. I'd like to include the date of the source XML file in the HTML report. Note: I am using C# .NET 2008 and using the built-in XslCompiledTransform class. I have sin...

XSLT/Java: ERROR: 'Cannot find external method 'max' (must be public).'

I am copying an example from XSLT Cookbook: 2nd Edition (O'Reilly: Mangano, 2006) where Mangano creates a tree diagram with SVG. As a way to quickly test this code, I am simply transforming the XML using JSTL's <x:transform/> tag, and running it in Jetty 6. The XSLT seems to be getting hung on calling java:java.lang.Math:max, saying: ...

XSLT : Merge duplicate scenario

Hi, I have an XML like this <ContractInfo ContractNo="12345"> <Details LastName="Goodchild"> <Filedata FileName="File1"/> </Details> </ContractInfo> <ContractInfo ContractNo="12345"> <Details LastName="Goodchild"> ...

XSL character escape problem

Hi, I am writing this because I have really hit the wall and cannot go ahead. In my database I have escaped HTML like this: "&lt;p&gt;My name is Freddy and I was". I want to show it as HTML OR strip the HTML tags in my XSL template. Both solutions will work for me and I will choose the quicker solution. I have read several posts online...

XSL tags inside javascript block

Hi, I need my XSL to add dynamic content to a javascript block. I am wondering if this is possible. Here is an example of what I want to do. The following code does NOT work: <script> // Loads the video. var s1 = new SWFObject("player-viral.swf","ply","670","350","9","#ffffff"); s1.addParam("allowfullscreen","true"); s1.addParam("a...

master stylesheet sharing in XSLT

i would like to create a master template in XSLT, which could be stored in a separate file. Every other Page stylesheets share it, with xsl:import. master.xslt <xsl:template match="Page"> <html> <head> </head> <body> <call-template name="Content"/> </body> </html> </xsl:template> <xsl:stylesheet> page....

Script block in XSL not being rendered

I can't get a <script></script> block in my XSL template to be rendered. It is simply being ignored by the parser, the block itself and anything inside it. By the way, I am using the DotNetNuke report module. Any ideas on how to solve this? Thanks. ...

Using xslt, transform one xml document based upon the contents of a second xml document

I have one set of documents that implicitly define the allowed fields for a second set of objects that have to be transformed into a third set of documents ( which "rules" document to use depends upon the content of the file being transformed) e.g. <!-- One example rules document --> <document object="obj1_rules"> <field name="A"/> <f...

Summing numbers with comma as decimal separator in XSLT?

I have an XML file where the number are comma-separated <foo> <bar val="1,23"/> <bar val="4,56"/> <bar val="7,89"/> </foo> I would like to make a sum over /foo/bar/@val values in XSLT, but I am a bit stuck the formatting. Does anyone knows what would be the proper syntax? ...

How do I nest xsl:for-each from different parts of the xml document?

I am putting an XSL together than will create a NAnt build script using as input an XML file that defines all of the items that need to be built. We have a lot of very similar projects with standard layouts and defined standards for handover areas and so having an XML file that defines what the developers want to happen rather than desc...

xslt document function question

If one is using the document function and opening up files that might not exist e.g. <xsl:variable name="input" select="document($A)/document/input"/> what is the graceful way of handling the error? I would like a default value for the variable if the file can't be opened. ...

Print php array in xslt

Is there any way to print a php array in xslt? I'm working with php sessions and trying to print the hole array in the xslt stylesheet. ...

HTTPWebRequest for XML containing an XSLT

I'm using the HttpWebRequest object to make a get call to a site/web service that uses XML/XSLT as its front end. When I view the source in Firefox the XML comes up, but when I make the request in my program the transformed document is returned to me. As the transformed document is very useless to me, how can I make the request and get...

How to do with pointing the target html when doing xml transformation?

Hello everyone. I want to generate a treeview from xml by xsl. In the output html, there are 2 frames: treeframe for the treeview and contentframe for displaying the content of the nodes when I click on the tree. I wrote a tree.xsl to generate the tree from the xml, a result.html who constructs the frameset and has js function, popul...

"xmlns" Attribute Makes My XSLT Return Blank Values

Hi, I have an XML file that I am trying to transform via an XSL file. As soon as I add an non-blank xmlns attribute to the root element of my XSL, the transformation just brings me back blank data for everything. If I remove or blank out the xmlns attribute, I get back what I expect. Can anyone tell me why this is happening so I can ...

stack overflow exception using template asp.net

We are using FW2.0 web application which is developed using VS2005. Our win2003 server had Windows update on last week with FW3.5 SP1, after that we struck-up in web application login issue. Basically our application works with both windows authentication as well anonyms But after install the FW3.5 SP1, the windows integrated authenti...

lower case the first character of a string using only xslt 1.0

I have seen patterns for translating a string into lower (or upper case) using the translate function for folks stuck using xslt 1.0. Is there a elegant way of just making the first letter of a string lowercase? TestCase => testCase ...

what is common implementation for server-side XSLT + .Net?

What are the common class structure for using XSLT + .Net? (server-side XSLT) My aim is to avoid standard webforms, tending to pure MVC, but still keep all the opportunities of ASP.net (caching, session management etc). Is it better to implement it as handler(s), or on Page level, or as Control? Does it absolutely depends on particular ...

Converting XML elements to XML attributes using XSLT

We have a current system that outputs an XML file which is in the following format: <INVENTORY> <ITEM> <SERIALNUMBER>something</SERIALNUMBER> <LOCATION>something</LOCATION> <BARCODE>something</BARCODE> </ITEM> </INVENTORY> I need to use this data to load into the standard .NET 2.0 grid. But the grid needs the X...

Need help displaying xml as html

I'm trying to use the Macromedia XSLTransform class to convert XML returned from Amazon Web Services to HTML. Here's the PHP page that calls the transform: <?php require_once('includes/MM_XSLTransform/MM_XSLTransform.class.php'); $restquery = "http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&amp;AWSAccessKeyId=[myid]&amp;...