Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

XML::Smart and Ordering Nodes in Order Created

by hackdaddy (Hermit)
on Feb 11, 2004 at 02:47 UTC ( [id://328108]=perlquestion: print w/replies, xml ) Need Help??

hackdaddy has asked for the wisdom of the Perl Monks concerning the following question:

Hi. I am experimenting with the XML::Smart module. It seems straightforward so far. However, I cannot create child elements under the same node and have them remain in the order they were created when printing out the tree. The order in which the element was created is critical for the program to work correctly.

The documentation is sparse on the syntax for creating nodes and ordering them.

Any assistance is greatly appreciated. Thanks.
  • Comment on XML::Smart and Ordering Nodes in Order Created

Replies are listed 'Best First'.
Re: XML::Smart and Ordering Nodes in Order Created
by gmpassos (Priest) on Feb 11, 2004 at 02:57 UTC
    As the author of XML::Smart, please, can you give some sample of your code to see what you are doing?

    And what version of XML::Smart are you using?

    Graciliano M. P.
    "Creativity is the expression of the liberty".

      Sample code:
      my $DATA2 = q`<?xml version="1.0" encoding="iso-8859-1"?> <html> <head> <title>Blah blah</title> </head> <body> <form> <input id="0"/> <br/> <input id="2"/> <br/> </form> </body> </html> `; my $x = XML::Smart->new( $DATA2 ); print $x->data( noheader => 1 ); The result is: <br/><br/> <html> <head> <title>Blah blah</title> </head> <body> <form> <input id="0"/> <input id="2"/> </form> </body> </html>
        Please, try the last version of XML::Smart, it will work fine. ;-P

        Graciliano M. P.
        "Creativity is the expression of the liberty".

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-24 04:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found