OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   what is the meaning of similar in xmlUnit

[ Lists Home | Date Index | Thread Index ]
  • To: <xml-dev@lists.xml.org>
  • Subject: what is the meaning of similar in xmlUnit
  • From: "Li Yuejiong(John)" <john_li@macrosynergy.com>
  • Date: Thu, 4 Aug 2005 21:48:44 +0800
  • Thread-index: AcWY9Ee1YYRLYR8yTNKVTDLajTottQABS6Fw
  • Thread-topic: what is the meaning of similar in xmlUnit

Hi,

In xmlUnit calss XmlTestCase, there are functions named assertXMLEqual
which assert that two XML documents are similar. According the
description of function similar in class Diff, "two documents are
considered to be "similar" if they contain the same elements and
attributes regardless of order. "

I construct two xml files,
============================
<?xml version="1.0"?>
<xbrl>
  <context id="Current_AsOf"/>
  <context id="Current_ForPeriod"/>
</xbrl>
============================
<?xml version="1.0"?>
<xbrl>
  <context id="Current_ForPeriod"/>
  <context id="Current_AsOf"/>
</xbrl>
============================

In my application, these two xml files are equal. But when I try to
similar them as below, I alwayse get the error message "[different]
Expected attribute value 'Current_AsOf' but was 'Current_ForPeriod' -
comparing <context id="Current_AsOf"...>"

==============
.....
.....
XMLTestCase xmlTestCase = new XMLTestCase();
xmlTestCase.assertXMLEqual(doc01, doc02);
.....
.....
==============

What's wrong? Is there any way two compare these two files as equal?

Thanks,
John





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS