I'd like to create a shader that is completely transparent except for top faces that are parallel to the floor (face normals being parallel to the global Z axis). Used on a cube, only the top face would be visible. I don't intend to rotate the object, so local and global Z are identical. But the shader should not care for the camera position.
After Brenticus' great answer I came up with this solution: it shows only faces that are reasonably parallel to the floor and face towards the camera:
While Suzie is truncated above and below, only the upper plane is visible. Switching the southern math node to 'greater than' would show only the bottom plane.