XML is not recognized as XML
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I am running beautifulsoup 4.3.2 and lxml 3.5.0
I have a valid xml_data:
<?xml version="1.0" encoding="UTF-8"?>
<KeyContainer Version="1.0" xmlns ="urn:ietf:
<KeyPackage>
<DeviceInfo>
<
<
</DeviceInfo>
<Key Id="1000133508267" Algorithm=
<
<
<Data>
<Secret>
</Secret>
<Counter>
</Counter>
</Data>
....
I am running
xml = BeautifulSoup(
xml.builder is of type "LXMLTreeBuilder". So this looks fine. But:
xml.is_xml is False and
xml.contents[0] is
<html>
<body>
<KeyContainer Version="1.0" xmlns ="urn:ietf:
<KeyPackage>
<DeviceInfo>
....
I assume xml.is_xml should be true and the contents should not be embedded in an html-body.
Maybe I am missing something?
I attached a short script.
I have looked at this and tested the code and if you change this line it will work.
xml = BeautifulSoup( XML_PSKC, "xml")
Note the change to the line is ["lxml"] to "xml"
hope this helps.