Guest User

Untitled

a guest
Jul 30th, 2012
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.10 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.   <xsl:output method="html" omit-xml-declaration="yes" indent="yes"  encoding="utf-8" />
  4.   <xsl:template match="/">
  5.     <root>
  6.       <xsl:for-each select="View/Rows/Row">
  7.        
  8.         <xsl:variable name="thevalue"><xsl:for-each select="Value"><xsl:if test="position() = 1"><xsl:value-of select="current()"/></xsl:if></xsl:for-each></xsl:variable>
  9.         <item id="{$thevalue}">
  10.          
  11.           <xsl:for-each select="Value">
  12.            
  13.             <xsl:if test="position() = 2">
  14.               <quantidade id="{position()}">
  15.                 <xsl:value-of select="current()"/>
  16.               </quantidade>
  17.             </xsl:if>
  18.            
  19.            
  20.             <xsl:if test="position() = 3">
  21.               <nota id="{position()}">
  22.                 <xsl:value-of select="current()"/>
  23.               </nota>
  24.             </xsl:if>
  25.            
  26.           </xsl:for-each>
  27.          
  28.         </item>
  29.       </xsl:for-each>
  30.     </root>
  31.   </xsl:template>
  32. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment