Click here to Skip to main content
16,005,316 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionMultiple root elements [modified] Pin
Tomi8728-Aug-06 9:21
Tomi8728-Aug-06 9:21 
AnswerRe: Multiple root elements Pin
led mike29-Aug-06 6:19
led mike29-Aug-06 6:19 
GeneralRe: Multiple root elements Pin
Tomi8729-Aug-06 6:40
Tomi8729-Aug-06 6:40 
GeneralRe: Multiple root elements Pin
led mike29-Aug-06 7:35
led mike29-Aug-06 7:35 
Questionxml-excel Pin
fmardani25-Aug-06 3:32
fmardani25-Aug-06 3:32 
QuestionSorting nodes by a child node Pin
Malcolm Smart25-Aug-06 1:05
Malcolm Smart25-Aug-06 1:05 
QuestionHow do i control the format of a date output by XSL? Pin
Red_Wizard_Shot_The_Food24-Aug-06 0:48
Red_Wizard_Shot_The_Food24-Aug-06 0:48 
AnswerRe: How do i control the format of a date output by XSL? Pin
Dustin Metzgar24-Aug-06 4:20
Dustin Metzgar24-Aug-06 4:20 
You could possibly do it in XSL if there was support for XPath 2.0, but that's not likely. The SQL way is probably going to be the easiest. Also, if your stylesheet is only run though msxml, you can use a script. Here's an example:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:msxsl="urn:schemas-microsoft-com:xslt"
   xmlns:date-time="http://mycompany.com/mynamespace"
   version="1.0" 
   exclude-result-prefixes="date-time msxsl">

   ...
      <xsl:value-of select="date-time:GetMyDate()"/>
   ...
	
   <msxsl:script language="JavaScript" implements-prefix="date-time">
      <![CDATA[
         function GetMyDate()
         {
            var myDate = new Date()
            var y = myDate.getFullYear()
            var m = EnsureLength(myDate.getMonth() + 1, 2)
            var d = EnsureLength(myDate.getDate(), 2)
            var h = EnsureLength(myDate.getHours(), 2)
            var min = EnsureLength(myDate.getMinutes(), 2)
            var s = EnsureLength(myDate.getSeconds(), 2)
            var mil = EnsureLength(myDate.getMilliseconds(), 3)
            return y + "-" + m + "-" + d + "-" + h + min + s + mil
         }
         function EnsureLength(s,n)
         {
            s = new String(s)
            while (s.length < n)
               s = "0" + s;
            return s;
         }
         ]]>
    </msxsl:script>
</xsl:stylesheet>

The EnsureLength function I created because I couldn't find a string padding function in JavaScript.




Logifusion[^]
If not entertaining, write your Congressman.
Questionexport to excel using xslt when the column name contains blank?? [modified] Pin
steven_wong23-Aug-06 16:51
steven_wong23-Aug-06 16:51 
Questionremove periculat node from xml file Pin
rkhokle22-Aug-06 20:57
rkhokle22-Aug-06 20:57 
AnswerRe: remove periculat node from xml file Pin
Christian Graus22-Aug-06 21:07
protectorChristian Graus22-Aug-06 21:07 
QuestionSaving svg or xml to client side Pin
Yeast2722-Aug-06 7:31
Yeast2722-Aug-06 7:31 
Questionxml Pin
rkhokale19-Aug-06 3:04
rkhokale19-Aug-06 3:04 
AnswerRe: xml Pin
Vitaliy Tsvayer20-Aug-06 9:09
Vitaliy Tsvayer20-Aug-06 9:09 
AnswerRe: xml Pin
Dustin Metzgar22-Aug-06 11:15
Dustin Metzgar22-Aug-06 11:15 
AnswerRe: xml Pin
Sage30-Aug-06 15:04
Sage30-Aug-06 15:04 
QuestionI'm Sure It's Something Little... Pin
Scott_Roberts18-Aug-06 15:15
Scott_Roberts18-Aug-06 15:15 
QuestionSpecial characters - [modified] Pin
VK-Cadec18-Aug-06 7:28
VK-Cadec18-Aug-06 7:28 
QuestionHow to get popup onTrayIcon Pin
muravi17-Aug-06 22:39
muravi17-Aug-06 22:39 
AnswerRe: How to get popup onTrayIcon Pin
toxcct18-Aug-06 0:24
toxcct18-Aug-06 0:24 
QuestionURGENT innertext problem Pin
biaali17-Aug-06 21:19
biaali17-Aug-06 21:19 
AnswerRe: URGENT innertext problem Pin
Dustin Metzgar18-Aug-06 5:13
Dustin Metzgar18-Aug-06 5:13 
Generalinnertext problem Pin
biaali18-Aug-06 22:51
biaali18-Aug-06 22:51 
QuestionOught to be basic, but I'm not getting it! Pin
Scott_Roberts17-Aug-06 8:13
Scott_Roberts17-Aug-06 8:13 
AnswerRe: Ought to be basic, but I'm not getting it! Pin
led mike17-Aug-06 9:06
led mike17-Aug-06 9:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.