मैं डेटाटाइम को दिनांक प्रारूप yyyy-MM-dd में बदलने की कोशिश कर रहा हूं, क्योंकि मैं xsd.exe उपकरण का उपयोग कर रहा हूं xs: दिनांक डेटाटाइप स्वचालित रूप से डेटाटाइम डेटाटाइप में बदल जाते हैं, क्योंकि .NET Framework में कोई प्रकार नहीं है जो प्रकार xs से मेल खाता है: पूरी तरह से दिनांक।एक्सएसएलटी रूपांतरण डेटाटाइम टू डेट प्रारूप
लेकिन मैं इसे
<articles>
<article>
<articleid>48992</articleid>
<deliverydateasked>2009-01-29T00:00:00+01:00</deliverydateasked>
</article>
<article>
<articleid>48993</articleid>
<deliverydateasked>2009-01-30T00:00:00+01:00</deliverydateasked>
</article>
</articles>
<articles>
<article>
<articleid>48992</articleid>
<deliverydateasked>2009-01-29</deliverydateasked>
</article>
<article>
<articleid>48993</articleid>
<deliverydateasked>2009-01-30</deliverydateasked>
</article>
</articles>
लिए एक्सएमएल कन्वर्ट करने के लिए कोशिश कर रहा है काम करने के लिए वर्तमान में मैं इस XSLT
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<articles>
<xsl:apply-templates select="article">
</xsl:apply-templates>
</articles>
</xsl:template>
<xsl:template name="FormatDate">
<xsl:param name="DateTime" />
<xsl:variable name="date">
<xsl:value-of select="substring-before($DateTime,'T')" />
</xsl:variable>
<xsl:if test="string-length($date) != 10">
<xsl:value-of select="$DateTime"/>
</xsl:if>
<xsl:if test="string-length($date) = 10">
<xsl:value-of select="$date"/>
</xsl:if>
</xsl:template>
<xsl:template match="article">
<xsl:call-template name="FormatDate">
<xsl:with-param name="DateTime" select="deliverydateasked"/>
</xsl:call-template>
</xsl:template>
उपयोग कर रहा हूँ नहीं मिल सकता है
क्या कोई भी एक अच्छा एक्सएसएल जानता है टी परिवर्तन।
अग्रिम
धन्यवाद मेरी कोड के उत्पादन में परिणाम
<articles />
जटिल "स्थानीय-नाम()" सामान क्यों करते हैं? – Tomalak
क्या tomalak ने कहा - लीवरेज xsl: प्रतिलिपि – annakata
अन्नकाटा मैंने आपके पहले सुझाव की कोशिश की है xsl: टेम्पलेट> परिणाम के साथ: 200 9-01 -292009-01-30 या मैंने कुछ गलत किया? लेकिन एक समारोह से बचने के लिए स्थानीय नाम() है? अवधि का समय अब 15-30 एमएस है –
freggel