Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Wtp-wst-dev] Question for XML parsing

Title: Message
Hi,
 
I'm parsing an XML file, there is an element named <tl1_message> inside this file, it looks like:
 
<tl1_message>
    <tl1_message_type>
        ..
        ..
        ..
    </tl1_message_type>
    <prod_rel name="ABC" start_rel="aa" end_rel="bb"/>
    <prod_rel name="XYZ" start_rel="cc" end_rel="dd"/>
    <other elements.../>
</tl1_message>
This is my requirements:

1). if ABC = XYZ and either bb or dd greater than 6.0, then
<tl1_message>
    <tl1_message_type>
        ..
        ..
        ..
    </tl1_message_type>
    <prod_rel name="ABC"/>
    <other elements.../>
</tl1_message>
 
2). if ABC != XYZ and both bb and dd are less than 3.0, then
the entire element <tl1_message> should be removed.
My difficulty is:
1). How to compare bb and dd, they are in different element(in the same level).
2). How to delete the entire element in this case.
 
Thanks
 
Guo

Back to the top