Perl command-line: check for XML well-formedness

Discussion in 'Perl Misc' started by luca, Nov 19, 2010.

  1. luca

    luca Guest

    Hi everyone, is there a way to check that an XML file is well formed with
    command line Perl?

    Thanks
     
    luca, Nov 19, 2010
    #1
    1. Advertising

  2. luca

    Uri Guttman Guest

    >>>>> "l" == luca <> writes:

    l> Hi everyone, is there a way to check that an XML file is well formed with
    l> command line Perl?

    untested:

    perl -MXML::Simple -0777ne '$data = XMLin $_'

    uri

    --
    Uri Guttman ------ -------- http://www.sysarch.com --
    ----- Perl Code Review , Architecture, Development, Training, Support ------
    --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
     
    Uri Guttman, Nov 20, 2010
    #2
    1. Advertising

  3. luca

    luca Guest

    On 20/11/2010 2.03, Uri Guttman wrote:
    > perl -MXML::Simple -0777ne '$data = XMLin $_'


    it works. thank you mate. Now I need to do some studying on why it actually does :)

    Luca
     
    luca, Nov 20, 2010
    #3
  4. luca

    Robin Guest

    probably, but try writing your own command line validator :)
    -r

    luca wrote:
    > Hi everyone, is there a way to check that an XML file is well formed with
    > command line Perl?
    >
    > Thanks
     
    Robin, Nov 21, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gustaf Liljegren
    Replies:
    0
    Views:
    1,353
    Gustaf Liljegren
    Jun 24, 2003
  2. sylvain.loiseau
    Replies:
    0
    Views:
    412
    sylvain.loiseau
    Oct 29, 2003
  3. Urs Muntwyler
    Replies:
    2
    Views:
    1,840
    Martin SChukrazy
    Mar 5, 2004
  4. Uwe Ziegenhagen
    Replies:
    3
    Views:
    406
    Pavel Lepin
    Oct 26, 2007
  5. Nicolai Stange
    Replies:
    2
    Views:
    1,020
    Nicolai Stange
    Dec 13, 2009
Loading...

Share This Page