Skip to main content

UNKNOWN

Project description

This module allows for order agnostic comparison‎ of XML data. It will parse files to determine if they are a match while ignoring the order of attributes or elements .

Dependencies: ElementTree

Sample usage:

#open two files, parse with ElementTree, and pass to xml_diff function

oFile1 = open(r’C:test1.xml’, ‘r’)

oFile2 = open(r’C:test2.xml’, ‘r’)

oXml1 = ET.parse(oFile1)

oXml2 = ET.parse(oFile2)

print xml_diff(oXml1, oXml2)

#pass in xml as strings

sOrder1 = ‘<ItalianFood><Pizza Sauce=”Red” Cheese=”Mozzarella” Crust=”Thin”><Quantity>2</Quantity></Pizza><Pizza Sauce=”OliveOil” Cheese=”Feta” Crust=”Thin”><Quantity>1</Quantity></Pizza></ItalianFood>’

sOrder2 = ‘<ItalianFood><Pizza Sauce=”OliveOil” Cheese=”Feta” Crust=”Thin”><Quantity>1</Quantity></Pizza><Pizza Sauce=”Red” Cheese=”Mozzarella” Crust=”Thin”><Quantity>2</Quantity></Pizza></ItalianFood>’

print xml_diff(sOrder1, sOrder2)

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.

Project details


Release history Release notifications

This version
History Node

0.52dev

History Node

0.51dev

History Node

0.5dev

History Node

0.4dev

History Node

0.3dev

History Node

0.2dev

History Node

0.1dev

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
PizzaPyDiff-0.52dev.win32.exe (200.5 kB) Copy SHA256 hash SHA256 Windows Installer any May 29, 2014
PizzaPyDiff-0.52dev.zip (3.7 kB) Copy SHA256 hash SHA256 Source None May 29, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page