Toggle navigation
xslt.me
Run
XML Editor
<Person> <FirstName>John</FirstName> <LastName>Doe</LastName> </Person>
XSLT Editor
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:my-scripts" exclude-result-prefixes="user msxsl"> <xsl:template match="/"> <Contact> <FullName> <xsl:value-of select="/Person/FirstName" /> <xsl:value-of select="/Person/LastName" /> </FullName> <UpdatedOn><xsl:value-of select="user:getTimestamp()" /></UpdatedOn> </Contact> </xsl:template> <msxsl:script language="C#" implements-prefix="user"> <![CDATA[ public string getTimestamp() { return DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); } ]]> </msxsl:script> </xsl:stylesheet>
Result
<Invoice> </Invoice>