?
Solved

Using EXSLT Templates example

Posted on 2004-10-13
5
Medium Priority
?
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 26

Accepted Solution

by:
rdcpro earned 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
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. 
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

764 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