Solved

Using EXSLT Templates example

Posted on 2004-10-13
5
204 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 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
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, …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
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: …

724 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