xpath select by attribute when attribute not present

The following code will select all nodes where type attribute doesn't exist:

select="image[not(@type)]"

Add this logic in your code.


Try using not() instead of != in the predicate...

   <div id="gallery">
        <div id="feature" >
            <xsl:apply-templates select="image[@type='feature']"/>
        </div>
        <div id="thumbs">
            <xsl:apply-templates select="image[not(@type='feature')]"/>
        </div>
    </div>