Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Eliminating node trees

From: "Andy Walldorff" <andyw@--------------.--->
To: NULL
Date: 11/3/2004 7:57:00 AM
Given an XML file similar to the following:

<root>
    <child>
        <key1>1</key1>
        <key2>1</key2>
        <origkey1/>
        <origikey2/>
        <flag>0</flag>
    </child>
    <child>
        <key1>1</key1>
        <key2>2</key2>
        <origkey1>1</origkey1>
        <origikey2>1</origkey2>
        <flag>0</flag>
    </child>
    <child>
        <key1>2</key1>
        <key2>1</key2>
        <origkey1>1</origkey1>
        <origikey2>1</origkey2>
        <flag>0</flag>
    </child>
    <child>
        <key1>2</key1>
        <key2>2</key2>
        <origkey1>2</origkey1>
        <origikey2>1</origkey2>
        <flag>1</flag>
    </child>
</root>

I want to transform it into:

<root>
    <child>
        <key1>1</key1>
        <key2>1</key2>
        <origkey1/>
        <origikey2/>
        <flag>0</flag>
    </child>
    <child>
        <key1>1</key1>
        <key2>2</key2>
        <origkey1>1</origkey1>
        <origikey2>1</origkey2>
        <flag>0</flag>
    </child>
</root>

This is done due to the flag element having a value of 1 in the last record.
This indicates that the child with key1 = origkey1 and key2 = origkey2 is
not to be included in the result set.  The deletion indicator child can
appear either before or after the child that needs to be deleted.

Any ideas on how to go about doing this?

Thanks
Andy




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent