Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1445 connectés 

  FORUM HardWare.fr
  Programmation
  XML/XSL

  [XSLT] Transformé une valeur pour la sortie (xs:duration)

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[XSLT] Transformé une valeur pour la sortie (xs:duration)

n°389430
Imhotep
Le monde est mon huître !!!
Posté le 10-05-2003 à 23:13:34  profilanswer
 

Salut
 
Comment faut-il faire pour transformer un élément pour l'affichage en html avec un document xslt.
 
Par exemple, j'ai des éléments de type xs:duration, quand je veux les afficher, cela donner des trucs du genre PT5M47S. Comment puis-je faire pour afficher quelque chose comme ceci : 5 min 47 s ???
 
Merci

mood
Publicité
Posté le 10-05-2003 à 23:13:34  profilanswer
 

n°389710
gilou
Modérateur
Modzilla
Posté le 11-05-2003 à 14:56:07  profilanswer
 

vas voir du coté de exslt: date:format-date  
http://www.exslt.org/date/function [...] index.html
 

Citation :

Implementer Page: date.format-date.html
Function Package: date.format-date.zip
 
Function Syntax
string date:format-date(string, string)
Template Syntax
<xsl:call-template name="date:format-date">
   <xsl:with-param name="date-time" select="string" />
   <xsl:with-param name="pattern" select="string" />
</xsl:call-template>
The date:format-date function formats a date/time according to a pattern.  
 
The first argument to date:format-date specifies the date/time to be formatted. It must be right or left-truncated date/time strings in one of the formats defined in [XML Schema Part 2: Datatypes]. The permitted formats are as follows:  
 
xs:dateTime (CCYY-MM-DDThh:mm:ss)  
xs:date (CCYY-MM-DD)  
xs:time (hh:mm:ss)  
xs:gYearMonth (CCYY-MM)  
xs:gYear (CCYY)  
xs:gMonthDay (--MM-DD)  
xs:gMonth (--MM--)  
xs:gDay (---DD)  
The second argument is a string that gives the format pattern used to format the date. The format pattern must be in the syntax specified by the JDK 1.1 SimpleDateFormat class. The format pattern string is interpreted as described for the JDK 1.1 SimpleDateFormat class.  
 
If the date/time format is right-truncated (i.e. in a format other than xs:time, or xs:dateTime) then any missing components are assumed to be as follows: if no month is specified, it is given a month of 01; if no day is specified, it is given a day of 01; if no time is specified, it is given a time of 00:00:00.  
 
If the date/time format is left-truncated (i.e. xs:time, xs:gMonthDay, xs:gMonth or xs:gDay) and the format pattern has a token that uses a component that is missing from the date/time format used, then that token is replaced with an empty string ('';) within the result.  
 
ImplementationsThere are currently no XSLT processors that we know of that support date:format-date natively.
 
Implementations of date:format-date are available in the following languages:  
 
Javascript (by Chris Bayes)
Msxsl (by Chris Bayes)
EXSLT Function (by Jeni Tennison)
XSLT Template (by Jeni Tennison)


 
A+,


---------------
There's more than what can be linked! --    Iyashikei Anime Forever!    --  AngularJS c'est un framework d'engulé!  --

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  XML/XSL

  [XSLT] Transformé une valeur pour la sortie (xs:duration)

 

Sujets relatifs
compresser un dump sql a la sortie de mysqldump avec un pipe [résolu]valeur trop grande... forcer un type...
[Windows] qui transforme un Float en une chaine de charSQL sous VBA : comparaison entre 1 chaîne et 1 valeur numérique
Coment récupèré valeur retourné par <input type="file" value="fic">capacité de sortie d une feuille de style
valeur d'un champ texte en js1 variable global changée dans une fonction garde sa nouvelle valeur?
[JS] Faire passer une valeur d'une champ <SELECT> a un autremysql: komment kon fait pour retourner une valeur par defaut?
Plus de sujets relatifs à : [XSLT] Transformé une valeur pour la sortie (xs:duration)


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR