Greetings.
I understand that MUSH already has an 'ExportToXml' function, but I was wondering if anyone knows of a way to take an XML document in python, and convert the nodes to a python dictionary, or even just a string.
What I'm looking to do is take:
And extract each different trigger to display its values:
Now, it doesn't matter about what it says, right now I'm just having a hell of a time trying to extract ANYTHING even using simplified SAX.
Does anyone know how I would be able to do this in python?
Thanks
I understand that MUSH already has an 'ExportToXml' function, but I was wondering if anyone knows of a way to take an XML document in python, and convert the nodes to a python dictionary, or even just a string.
What I'm looking to do is take:
<triggers>
<trigger
enabled="y"
name="trigger1"
keep_evaluating="y"
match="*With an heroic effort *"
send_to="12"
sequence="100"
>
<send>world.ColourTell ("lime", "black", "[CURED]: ")
world.ColourNote ( "white", "black", "Impaled no longer")world.SetVariable("standing", "off")
</send>
</trigger>
<trigger
group="gold"
match="^You get (.*?) gold sovereigns from (a|an) (.*?)\.$"
regexp="y"
sequence="100"
>
<send>put gold in pack</send>
</trigger>
</triggers>
And extract each different trigger to display its values:
Trigger: trigger1
Enabled is yes
Keep evaluting is yes
Match is: *With an heroic effort *
Send value is :
world.ColourTell ("lime", "black", "[CURED]: ")
world.ColourNote ( "white", "black", "Impaled no longer")world.SetVariable("standing", "off")
Now, it doesn't matter about what it says, right now I'm just having a hell of a time trying to extract ANYTHING even using simplified SAX.
Does anyone know how I would be able to do this in python?
Thanks