Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: XML dynamic nesting !!

by onkar (Novice)
on Jan 20, 2010 at 12:11 UTC ( [id://818436]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://818436]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2026-04-12 13:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.