Hi Is there any good ways to split a "eg.event.string" with many xml tags?
I have a http request into EG with
<adress>gofy1</adress><number>1234</number>
so I would like to split the tags into vars...
Any easy ways?
Tnx, Eddie
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
xml tags search and split?
Re: xml tags search and split?
You can do this with a python script with Element Tree
Code: Select all
import xml.etree.ElementTree as ET
#EXAMPLE STRING
#string = "<adress>gofy1</adress><number>1234</number>"
#EG.EVENT.STRING
string = eg.event.string
#The next line may need to be removed if XML is in the correct format / Already Has a begining and ending tag
string = "<egdata>" + string + "</egdata>"
string = ET.fromstring(string)
for child in string:
tag = child.tag
data = child.text
print "Tag is:",tag
print "Data is:",data