flush XML tags having certain value
        Posted  
        
            by azathoth
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by azathoth
        
        
        
        Published on 2010-04-02T18:56:22Z
        Indexed on 
            2010/04/02
            19:13 UTC
        
        
        Read the original article
        Hit count: 249
        
Hello all I have a webservice that returns an XML like this:
<?xml version="1.0" encoding="UTF-8"?>
<contractInformation>
    <contract>
        <idContract type="int">87191827</idContract>        
        <region type="varchar">null</region>
        <dueDate type="varchar">null</dueDate>
        <contactName type="varchar">John Smith</contactName>
    </contract>
</contractInformation>
I want to empty every tag that contains the string null, so it would look like this:
<?xml version="1.0" encoding="UTF-8"?>
<contractInformation>
    <contract>
        <idContract type="int">87191827</idContract>        
        <region type="varchar"/>
        <dueDate type="varchar"/>
        <contactName type="varchar">John Smith</contactName>
    </contract>
</contractInformation>
How do I accomplish that by using XSLT?
© Stack Overflow or respective owner