Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting XML issue in Client_info #6

Open
WCSLoschy opened this issue Dec 2, 2019 · 0 comments
Open

Formatting XML issue in Client_info #6

WCSLoschy opened this issue Dec 2, 2019 · 0 comments

Comments

@WCSLoschy
Copy link

WCSLoschy commented Dec 2, 2019

Great work! Tested this and everything works well and has already helped me out a ton!

I've taken the sample code as:

if res.status_code == 200:
        xml = res.text
        print(xml)
        ap_list = APList(xml)
        writeXML(xml,aplistFILE) #writes out to xml file

This writes all the xml data in the container with nothing outside:

<amp:amp_ap_list version="1" ...>
</amp:amp_ap_list> 

This makes it simple to parse the XML and pull the needed information through applications such as minidom or ElementTree

But:
When doing the same to:

for ap_node in ap_list:
        res = airwave.ap_detail(ap_node['@id'])
        if res.status_code == 200:
            xml = res.text
            ap_detail = APDetail(xml)
            writeXML(xml,clientinfoFILE)
            #pprint(ap_detail)

Because it's AP ID based, it writes multiple XML containers:

<amp:amp_ap_detail version="1">
</amp:amp_ap_list> 
<amp:amp_ap_detail version="1">
</amp:amp_ap_list> 
x however many AP's there are

Other XML parsers cannot parse because it's incorrectly formatted(according to the parser).

Is there a way to change the APDetail code to have the AP's nested inside a single amp:amp_ap_detail tree ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant