Advertisement
Guest User

Untitled

a guest
Aug 29th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <?xml-stylesheet type="text/xsl" href="myxml.xsl"?>
  3. <Account>
  4. <Amount>12345.67</Amount>
  5. </Account>
  6.  
  7. <?xml version="1.0"?>
  8. <xsl:stylesheet version="2.0"
  9. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  10. xmlns:test="http://test.net">
  11.  
  12. <xsl:function name="test:formatDecimal">
  13. <xsl:param name="string1"/>
  14. <xsl:value-of select="format-number($string1,'###,###.##')"/>
  15. </xsl:function>
  16.  
  17. <xsl:output method="html" encoding="UTF-8" indent="yes"/>
  18.  
  19. <xsl:template match="/">
  20. <html>
  21. <head>
  22. <style type="text/css">
  23. p { font-family: sans-serif; font-style: italic; }
  24. </style>
  25. </head>
  26. <body>
  27. <xsl:for-each select="/Account">
  28. <p>Amount: <xsl:value-of select="test:formatDecimal(Amount)"/></p>
  29. </xsl:for-each>
  30. </body>
  31. </html>
  32. </xsl:template>
  33. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement