Hey Zapo,
I think this question has less to do with XmlBeans and more to do with
algorithm implementation.
I think it might be easiest to use a map<TestCase> if you want to go that
route, but it I think it might be easier to use one of the Cursor APIs with
XPath and get an XmlObject[] of //TestCase values.
I'm curious also, why you need a map to keep these values when there should
be a method like TestCasesDocument.getTestCase() which will return an array
of TestCase[] that you can iterate through. But like I mentioned, thats more
of an algorithm implementation issue.
Best of luck,
-jacobd

On Dec 9, 2007 5:36 PM, Zapo <[EMAIL PROTECTED]> wrote:

>
> Hi All,
>
> I read through the numerous post and example, before asking for help in
> the
> forum. Many where very helpful, however I still need some help on this
> topic
>
> 1. Parse and XML using cursor                             ---> this is
> fine
> 2. Store the element name and value in Map object ---> Help?
>
> My XML is below
> ----------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <Testcases xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:noNamespaceSchemaLocation="AddCustomer.xsd">
>   <Testcase>
>    <Security>https</Security>
>    <Server>staging</Server>
>  </Testcase>
>  <Testcase>
>    <Security>https</Security>
>    <Server>baijing</Server>
>  </Testcase>
> </Testcases>
>
> 1. I need to iterate through <TestCase> and store <Security> and <Server>
> in
> a Map.
>
> Since there are many nodes <Testcase> , what is the approach I should use?
>
> I am thinking of using cursors, but how to navigate and get the element
> name
> and value and move on to the next testcase, should I have a Map<Map>? I
> need
> to get values for every test case node.
>
> Thanks in advance
>
> Regards
> Zapo
>
>
>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Parsing-and-Storing-in-Map-tp14245948p14245948.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to