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

"Martinez, Will" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <08118D82DB20F24F9308760909D7570708709CD3@COENGEXCMB01.cable.comcast.com>
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
<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).get
Value();


With this syntax I get the actual attribute: Name;
String secondDescendant3Data =
subParentElement.getChild(descendant_3).getAttribute(attributeValue).get
Name();//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/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.