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

I feel like I am wandering about in the dark...

I have been playing with Shawn Ribordy's foray into using Microsoft's XML parser from within Perl:

http://www.perl.com/pub/a/2001/04/17/msxml.html

and after getting confused by looking the MSDN site:

http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/htm/xml_pro_ae_5fzn.asp

His example shows how to iterate through all child nodes underneath the document's root, but how does one get a list of attributes without knowledge of their names?

Thanks for insight you can provide.

  • Comment on iterating through XML attributes using MSXML4.0?

Replies are listed 'Best First'.
Re: iterating through XML attributes using MSXML4.0?
by BrowserUk (Patriarch) on Oct 26, 2003 at 02:52 UTC

    This is an (educated) guess, but as there are no other replies I thought it worth mentioning...

    foreach my $Event (in $Events) { foreach my $Attr (in $Event->Attributes) { print $Attr->{Name}, ' = ', $Attr->{Value}; } }

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Hooray!

      Thanks for your input. This provided enough for me to at least get past the exceptions thrown. What I also learned is that methods names are not case sensitive which I'm guessing is a feature for the VB crowd. I'm still banging on walking the DOM to find all values, attributes, etc., but I'm further along because of your educated guess.