XSLT StyleSheet XML

File: Data.xml


  
          favorite="f1">XSLT
          favorite="A">Java
          favorite="A">C++
          favorite="f1">SQL
          favorite="B">Oracle
          favorite="B">XML
  


File: Transform.xslt

  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  
 
  
          select="/favorite-books/booklist
              /book[contains(@favorite, 'A')]"/>
  
  
          select="/favorite-books/booklist
              /book[contains(@favorite, 'B')]"/>
  
  
          select="if (subsequence($A-List, 1, 1) is 
                  subsequence($B-List, 1, 1))
              then '    The first nodes are the same! '
              else '    The first nodes aren''t the same! '"/>
    
          select="if (subsequence($A-List, 1, 1) is
                  subsequence(reverse($B-List), 1, 1))
              then '    The first nodes are the same! '
              else '    The first nodes aren''t the same! '"/>
  

Output:
    The first nodes aren't the same!
    The first nodes aren't the same!