Accessing the Text for <Get Name="Jerry">BLACK</Get> and the rest of the list.

View: New views
1 Messages — Rating Filter:   Alert me  

Accessing the Text for <Get Name="Jerry">BLACK</Get> and the rest of the list.

by Martinez, Will :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

good morning,
I have this xml file that I need to access the Text "Dish."  I have listed what  quit works and does not work.  Please see attached file.

<CatParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <CatInputs>
        <InputValue Name="Food">
            <From>MotherCat</From>
            <Where>
                <On>Dish</On>
            </Where>
            <Get Name="Tom">WHITE</Get>
            <Get Name="Jerry">BLACK</Get>
            <Get Name="Sam">GREY</Get>
        </InputValue>

descendant_2 = Where
secondDescendant_1 = On
descendant_3 = Get
attributeValue = Name

With this syntax, I am able to get at Dish, but that is because an attribute is not associated with
the element On.
String secondDescendant1Data = subParentElement.getChild(descendant_2).getChildText(secondDescendant_1);
System.out.print("\n secondDescendant1 Text: " + secondDescendant1Data);// child's descendant2 Where Dish

I get WHITE with this, but I do not have an API/library component ti get to the next element  BLACK.
String secondDescendant3Data = subParentElement.getChild(descendant_3).getValue();//This works!

I get Tom with this syntax;
String secondDescendant3Data = subParentElement.getChild(descendant_3).getAttribute(attributeValue).getValue();


With this syntax I get the actual attribute: Name;
String secondDescendant3Data = subParentElement.getChild(descendant_3).getAttribute(attributeValue).getName();//Name

I need syntax like this, but there is none;
String secondDescendant3Data = subParentElement.getChild(descendant_3).getAttributeValue(attributeValue).getText(of Tom);

But there isn’t an API method that works!
Might you be able to suggest a solution?

 

Thank you.  I would appreciate your comments.

will


_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@...