in reply to Re: XML dynamic nesting !!
in thread XML dynamic nesting !!

<Root> <Databasechecks> <Dbname>DB01</Dbname> <Runquery>some query</Runquery> </Databasechecks> <Databasechecks> <Dbname>DB02</Dbname> <Runquery> <xyz>dfdf</xyz> some query </Runquery> </Databsechecks> </Root>
here there are two Database checks in the same level . But in the second Databasechecks we have nested xyz tag which is not there in the first Database check. Using XML::Simple module, we can get query result , but we get xyz as hashreference. The code written for first Database check should also parse n number of nodes added to second Databasechecks. How can we know that ? and how can we implement that ? If u know please tell me the solution.

Replies are listed 'Best First'.
Re^3: XML dynamic nesting !!
by Corion (Patriarch) on Jan 20, 2010 at 12:27 UTC

    You should read the XML::Simple documentation about the ForceArray parameter.

      In this case it looks more like onkar needs ForceContent but restricted to the <Runquery> tag. (I did send Grant a patch to allow that years ago ...)

      onkar you may find it easier to let XML::Rules infer the base set of rules for you and then tweak them so that it produces a convenient data structure.

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.