Hmm, somehow your script seems not to work,... :-( 

I just get this Kind of Output after parsing the sample file below,...

>First Test System:  Test System 1 (MyTest: Main area to get crap
>Second Test System: Test System 2 (misc: Other information to confuse code)
>Third Test System:  Test System 3 (misc: More confusing crap)
Are there any real easy to understand Sampples about XML::Parser?

btw: I already opend a document when calling the XML Parser Modul. Is this possible 
like:

$filenameDefinedBefore=$_


my $XMLFileHandle = XMLin("$filenameDefinedBefore");

> -----Urspr> üngliche Nachricht-----
> Von:  kris hoch [SMTP:[EMAIL PROTECTED]]
> Gesendet am:  Dienstag, 4. Juni 2002 16:53
> An:   [EMAIL PROTECTED]
> Cc:   [EMAIL PROTECTED]
> Betreff:      Re: AW: parsing xml files for variables
> 
> Johannes,
>   I have copied and pasted some same code and data. Look for the "Sample 
> Code" and Sample Data" in this message.
> 
>   Let me know if this helps
> 
> Kristofer
> 
> 
>=========================================================================================
> 
> -[ Sample Code file (TestSystem.pl) ]--------------------------------------
> #!/bin/perl
> # perl -MCPAN -e 'install XML::Parser'
> # perl -MCPAN -e 'install XML::Simple'
> # perl -MCPAN -e 'install Data::Dumper'
> use XML::Parser;
> use XML::Simple;
> use Data::Dumper;
> 
> # Create an array reference with XMLin (XML input)
> my $XMLFileHandle = XMLin("TestSystem.xml");
> 
> 
> # Get the Main name and THEN the first test system.
> $XMLFileName = eval Dumper($XMLFileHandle->{name});
> $XMLFileDesc = eval Dumper($XMLFileHandle->{description});
> $TESTSYS_1   = eval Dumper($XMLFileHandle->{testsystem});
> 
> # No get the other test system
> $OTHER_ONE_NAME = eval Dumper($XMLFileHandle->{Other}->{name});
> $OTHER_ONE_DESC = eval Dumper($XMLFileHandle->{Other}->{description});
> $TESTSYS_2 = eval Dumper($XMLFileHandle->{Other}->{testsystem});
> 
> #Now get the final test system
> $OTHER_TWO_NAME = eval Dumper($XMLFileHandle->{Other}->{Other}->{name});
> $OTHER_TWO_DESC = eval 
> Dumper($XMLFileHandle->{Other}->{Other}->{description});
> $TESTSYS_3 = eval Dumper($XMLFileHandle->{Other}->{Other}->{testsystem});
> 
> print << "//ENDOFOUTPUT";
> =========================================================================
> First Test System:  $TESTSYS_1 ($XMLFileName: $XMLFileDesc
> Second Test System: $TESTSYS_2 ($OTHER_ONE_NAME: $OTHER_ONE_DESC)
> Third Test System:  $TESTSYS_3 ($OTHER_TWO_NAME: $OTHER_TWO_DESC)
> //ENDOFOUTPUT
> 
> -[ Sample XML file (TestSystem.xml) ]--------------------------------------
> <Testing name="MyTest"
>          date="06/04/2002"
>                                description="Main area to get crap">
> 
>   <testsystem>Test System 1</testsystem>
> 
>       <Other name="misc"
>          description="Other information to confuse code">
>     <testsystem>Test System 2</testsystem>
> 
>     <Other name="misc"
>            description="More confusing crap"
>            testsystem="Test System 3" />
>   </Other>
> </Testing>
> 
> 
> 
> 
> 
> 
> _________________________________________________________________
> Join the world> '> s largest e-mail service with MSN Hotmail. 
> http://www.hotmail.com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to