Writing as XSLT

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="text"/>

  <xsl:template match="/">

    <xsl:if test="not(//key[. = 'CFBundleExecutable'])">
      No CFBundleExecutable
    </xsl:if> 

    <xsl:if test="count(//key[. = 'CFBundleIconFile']) = 0">
      There is no CFBundleIconFile
    </xsl:if>

    <xsl:if test="count(//key[. = 'CFBundleIconFile']) &gt; 1">
      There is more than one CFBundleIconFile
    </xsl:if>
    
    <xsl:if test="not(contains(//key[. = 'CFBundleGetInfoString']/following-sibling::string, '© 2005 The Mozilla Organization'))">
      Missing copyright
    </xsl:if>

    <xsl:if test="string-length(//key[. = 'CFBundleSignature']/following-sibling::string) != 4">
      The CFBundleSignature is not four letters
    </xsl:if>

    <xsl:if test="count(//key/following-sibling::*[1]/self::key) != 0">
      Adjacent key elements
    </xsl:if>

  </xsl:template>

</xsl:stylesheet>

Previous | Next | Top | Cafe con Leche

Copyright 2005-2007 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified September 23, 2005