IIS has had, for a long time, kept its configuration in what it called the "MetaBase". This was a binary file in a not-very-open binary format that was difficuly to modify.
But Windows 2003 introduces IIS 6.0, which keeps all of this information in an XML file, MetaBase.xml, which is great. You can find it in \windows\system32\inetsrv\MetaBase.xml.
IIS 6.0 has a default (but configurable) property to NOT allow editing of this file while the server is running, and keeps a lock on it. But you can disable this property through IIS and edit the file while the server is live (it immediately brings in the changes, too!), or just shut down the IIS services and modify the file.
Has anyone used perl to modify any attributes of existing tags or add new ones? It's a very large XML file with many tags that have many attributes. I tried using XML::Simple, and it crashed at first when opening the file. For some reason, the XML file started off with three odd ascii characters. I removed them, and XML::Simple could then open the file. I was able to read then rewrite the file, but the re-written file was very different XML than I started off with. I must admit, I did not try and see if it worked.
I ended up not using a real XML parser, and just writing code to hack the changes I would need to make into the XML file manually.
But mostly what I was wondering (and here, finally is the question) is, has anyone had any success using perl and a XML parser to modify MetaBase.xml? If so, could you share some code?
And as a sidenote, what's your favorite XML parser for perl?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.