Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8769257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:17:36+00:00 2026-06-13T17:17:36+00:00

my xsl looks like below : <?xml version=1.0?> <xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform version=1.0 xmlns:SimpleDateFormat=java.text.SimpleDateFormat xmlns:Date=java.util.Date exclude-result-prefixes=SimpleDateFormat

  • 0

my xsl looks like below :

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" 
xmlns:SimpleDateFormat="java.text.SimpleDateFormat"
xmlns:Date="java.util.Date" exclude-result-prefixes="SimpleDateFormat Date">

<xsl:variable name="s" select="SimpleDateFormat:new(MMM/dd/yyyy-HH/mm/ss/SSS)"/>
<xsl:variable name="date" select="Date:new(number($beginTime))"/>

So now how to call the method format(Date date) of instance ‘s’?

If I use <xsl:value-of select="s:format($date)" />, then the error is : prefix must resolve to a namespace : s.

But if I add the namespace like this : xmlns:s="java.text.SimpleDateFormat", the <xsl:value-of select="s:format($date)" /> will return default format, not the specified format.

So how can I get the specified format, like MM/dd/yyyy-HH/mm/ss/SSS ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:17:38+00:00Added an answer on June 13, 2026 at 5:17 pm

    The namespace you need to use is the one which refers to the object type, and pass the variable itself as the first argument in your call:

    BTW: You need to put the format argument between apostrophes:

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:SimpleDateFormat="java.text.SimpleDateFormat" xmlns:Date="java.util.Date" exclude-result-prefixes="SimpleDateFormat Date">
        <xsl:variable name="s" select="SimpleDateFormat:new('MMM/dd/yyyy-HH/mm/ss/SSS')"/>
        <xsl:variable name="date" select="Date:new()"/>
        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        <xsl:template match="*">
            <Test>
                <xsl:value-of select="SimpleDateFormat:format($s,$date)" />
            </Test>
        </xsl:template>
    </xsl:stylesheet>
    

    I hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i have an XSLT that looks like so: <xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform> <xsl:output omit-xml-declaration=yes
I have got an XSLT that looks like this: <xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform> <xsl:output method=xml
My xsl file: <?xml version=1.0 encoding=UTF-8?> <xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform xmlns:go=http://www.google.com exclude-result-prefixes=go> <xsl:include href=SomeLibrary.xsl/> <xsl:template
I have a xml that looks like below <xsl:template match=//xml> <xsl:for-each select=//z:row> <ul class
I've got xml that looks like what I have below. I can read the
I have a xml that looks like below one. I need your help to
I have some XML that looks like <?xml version=1.0?> <root> <![CDATA[ > foo ]]>
I have XML that looks like <?xml version=1.0?> <ROWSET> <ROW> <AAA_ID>43238</AAA_ID> <BBB_ID>9</BBB_ID> <CCC_COURIER>2</CCC_COURIER> <CCC_FAX>33.44</CCC_FAX>
Say I have an XML file which looks like this: <?xml version=1.0 encoding=UTF-8?> <Project
I have an xml document that looks like this. <?xml version=1.0?> <services> <service sn=1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.