Solved

Using EXSLT Templates example

Posted on 2004-10-13
5
191 Views
Last Modified: 2008-03-10
I am looking for an example of using the EXSLT functions (http://exslt.org/dates-and-times) to add times. Using VB.Net 2003.

<?xml version="1.0"?>
<time>
      <now>2004-05-17T11:12:00</now>
</time>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
exclude-result-prefixes="date">
<xsl:import href="http://localhost/exslt/date.xsl" />
   <xsl:template match="/">
   <xsl:variable name="now" select="date:date-time()"/>
   <xsl:variable name="rolloff" select="date:add($now,'PT30M')" />
      Current date is <xsl:value-of select="$now"/>
      Rolloff is <xsl:value-of select="$rolloff"/>
   </xsl:template>
</xsl:stylesheet>

---------------------------------------------
It seems to die on the import. I have tried using a file:///c:/path , but that would not work either.  Just looking for a simple XSL template to add the date/time. There are other XSLT functions I'd like to use also, so I didn't want to just write the java to do this.
0
Comment
Question by:lrr81765
  • 2
5 Comments
 
LVL 26

Accepted Solution

by:
rdcpro earned 500 total points
ID: 12303805
Oleg Tkachenko wrote a good article on implementing EXSLT in .NET last August:

http://msdn.microsoft.com/XML/BuildingXML/XMLStylesheets/default.aspx?pull=/library/en-us/dnxml/html/practexslt.asp

it's quite thorough.  Also, the EXSLT.NET community has nice ready-made assemblies for you!

http://www.gotdotnet.com/workspaces/workspace.aspx?id=201eb290-5bf0-4452-9bf7-d21d39268f36

One other thing to remember, in some cases when you use import, or when you use the document() function to access external resourcse, the XSLT transform must run with elevated privileges.  Make sure your code access security is correct...


Regards,
Mike Sharp
0
 

Author Comment

by:lrr81765
ID: 12304537
Mike -
Thanks for the response. I have looked at both of those articles and have the EXSLT.NET library, however, I cannot use it in this particular instance (can't change the app the does the transform).

It looks like the EXSLT.org templates *should* be able to be included, and that's what I think that I need.

I used the caspol -security off  and had no effect.
0
 
LVL 26

Expert Comment

by:rdcpro
ID: 12305772
You may have to manually copy the code into your own templates, then.  or copy the named templates separately.

Can you import *any* template?

Regards,
Mike Sharp
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Quest Defender - XML > HTML POST Data 9 29
Nessus Scan 1 64
Removing information on Duplicate XML Nodes 24 66
RSS Feed Enclosure URL 1 66
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now