Solved

Using EXSLT Templates example

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XSL - change date format 3 53
Convert Oracle data into XML document 2 76
Xsl-fo show PDF when no results are returned 2 23
xslt 1.0 - How to split value 8 43
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. 
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 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