Solved

Using EXSLT Templates example

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

815 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

8 Experts available now in Live!

Get 1:1 Help Now