XML columms not lining up.

Discussion in 'Perl Misc' started by usaims, Jan 11, 2006.

  1. usaims

    usaims Guest

    Hi, I'm trying to get the output of this script to print straight
    pretty columms but it always come out not nice and pretty. I looked at
    the XML:parser module but I think its an overkill for what I'm doing,
    can somebody suggest something. TIA

    #!/usr/bin/perl
    use strict;
    use warnings;
    use diagnostics;

    while ( my $line = <DATA> ) {
    #checking to see if query is enabled
    if ($line =~ m/\bavailable\b/) {

    if ($line =~ m/^<Service name="(.*?)"/i) {
    $main::queryname = $1;
    #print "$queryname\n";
    }
    if ($line =~ m/\burl="http:\/\/(.*?)\.br\.xxx.com/i) {
    $main::roxie = $1;
    #print "$roxie\n";

    }
    if ($line =~ m/\bqueryname="(.*?)"/i) {
    my $stuff = $1;
    print "$main::roxie $main::queryname $stuff\n";


    }
    }
    }


    __DATA__
    <Service name="Search" url="http://xxx.xx.xxx.com:1234" path="foxie"
    queryname="foxie.SexOffender_Search" username="nouser"
    password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
    <Service name="EnSearch" url="http://xxx.xx.xxx.com:1234" path="foxie"
    queryname="foxie.headerfilesearchservice" username="nouser"
    password="vFQ/T13eG17MjaYs4l7V1A==" status="available"/>
    <Service name="Bpsport" url="http://xxx.xx.xxx.com:1234" path="foxie"
    queryname="foxie.Comprehensive_Report_Service" username="nouser"
    password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
    <Service name="Search" url="http://xxx.xx.xxx.com:1234" path="foxie"
    queryname="foxie.HeaderFileRollupService" username="nouser"
    password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
    <Service name="CriminalReport" url="http://xxx.xx.xxx.com:1234"
    path="foxie" queryname="foxie.DOC_Report" username="nouser"
    password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
    <Service name="CriminalSearch" url="http://xxx.xx.xxx.com:1234"
    path="foxie" queryname="foxie.DOC_Search" username="nouser"
    password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
    <Service name="DriverLicenseSearch" url="http://xxx.xx.xxx.com:1234"
    path="foxie" queryname="foxie.dl_Search" username="nouser"
    password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
    <Service name="MotorVehicleReport" url="http://xxx.xx.xxx.com:1234"
    path="foxie" queryname="foxie.Vehicle_Report" username="nouser"
    password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
    <Service name="MotorVehicleSearch" url="http://xxx.xx.xxx.com:1234"
    path="foxie" queryname="foxie.Vehicle_Search" username="nouser"
    password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
    <Service name="RollupPersonSearch" url="http://xxx.xx.xxx.com:1234"
    path="foxie" queryname="foxie.HeaderFileRollupService"
    username="nouser" password="vFQ/T13eG17MjaYs4l7V1A=="
    status="available"/>
    @
    "roxie.pl" 43L, 3113C
    21,9 Top
     
    usaims, Jan 11, 2006
    #1
    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. RobM
    Replies:
    0
    Views:
    742
  2. Steve Pugh
    Replies:
    3
    Views:
    496
    Scott_From_PA
    Feb 11, 2005
  3. Lazaroo

    Lining up 'equals' signs

    Lazaroo, Mar 26, 2005, in forum: HTML
    Replies:
    3
    Views:
    494
    Lazaroo
    Mar 26, 2005
  4. tshad
    Replies:
    16
    Views:
    3,778
    tshad
    Apr 3, 2005
  5. kditty
    Replies:
    8
    Views:
    515
    Beauregard T. Shagnasty
    Jan 26, 2006
Loading...

Share This Page