Advertisement
Guest User

Steve

a guest
Sep 17th, 2009
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.00 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <document xmlns="my:coolNamespace"
  3.          xmlns:dork="my:geekyNamespace">
  4.   <note>This is totally cool.</note>
  5.   <dork:note>Oops, I'm not cool.</dork:note>
  6.   <lanparty xmlns="my:geekyNamespace"
  7.            xmlns:dork="my:coolNamespace">
  8.     <note>Awesome, now I'm kind of cool.</note>
  9.     <dork:note>Yeah I'm no good at these games.</dork:note>
  10.   </lanparty>
  11. </document>
  12.  
  13.  
  14.  
  15.  
  16. <?xml version="1.0" encoding="UTF-8"?>
  17. <xsl:stylesheet version="1.0"
  18.                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  19.                xmlns:cool="my:coolNamespace"
  20.                xmlns:geek="my:geekyNamespace">
  21.   <xsl:output method="text"/>
  22.  
  23.   <xsl:template match="/">
  24. Cool person says:
  25. <xsl:apply-templates select="//cool:note"/>
  26. Geeky person says:
  27. <xsl:apply-templates select="//geek:note"/>
  28.   </xsl:template>
  29.  
  30.   <xsl:template match="*[local-name() = 'note']">
  31.     <xsl:value-of select="."/><xsl:text>&#xa;</xsl:text>
  32.   </xsl:template>
  33.  
  34. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement