Skip to content

Commit

Permalink
add html entities
Browse files Browse the repository at this point in the history
  • Loading branch information
C-o-m-o-n committed Feb 7, 2024
1 parent a0979ee commit 47d4750
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,12 @@ <h3>Convert JSON and xml</h3>
converted = textbin_obj.json_to_xml(json_data)
print(converted)

#Output <item><id>12</id><name>Collins</name></item>
#Output &lt;item&gt;&lt;id&gt;12&lt;/id&gt;&lt;name&gt;Collins&lt;/name&gt;&lt;/item&gt;

#convert xml to json
xml_data = "<item><id>12</id><name>Collins</name></item>"
xml_data = "&lt;item&gt;&lt;id&gt;12&lt;/id&gt;&lt;name&gt;Collins&lt;/name&gt;&lt;/item&gt;"
converted = textbin_obj.xml_to_json(xml_data)
print(converted)
print(converted)

#Output { 'id' : 12 , 'name' : 'Collins' }

Expand Down

0 comments on commit 47d4750

Please sign in to comment.