You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
|
May
(2) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
(2) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2007 |
Jan
(12) |
Feb
(17) |
Mar
(13) |
Apr
(20) |
May
(36) |
Jun
(5) |
Jul
(3) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(11) |
Dec
(5) |
2008 |
Jan
(9) |
Feb
(3) |
Mar
(19) |
Apr
(20) |
May
(8) |
Jun
(18) |
Jul
(1) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
(3) |
Apr
(6) |
May
(12) |
Jun
(6) |
Jul
(2) |
Aug
(2) |
Sep
(5) |
Oct
(4) |
Nov
(2) |
Dec
(2) |
2010 |
Jan
|
Feb
(2) |
Mar
(6) |
Apr
(3) |
May
(5) |
Jun
(2) |
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(3) |
Nov
|
Dec
(3) |
2011 |
Jan
(2) |
Feb
(10) |
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
(4) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
(3) |
Mar
(1) |
Apr
(13) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(17) |
2015 |
Jan
(28) |
Feb
(33) |
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
(2) |
Dec
(1) |
2016 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(4) |
2022 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Stefan B. <bo...@ap...> - 2007-05-21 04:24:27
|
Sorry, I completely overlooked the second part of your initial email. On Fri, 18 May 2007, Elliot Metsger <eme...@jh...> wrote: > So is there a workaround for setting an EntityResolver on the > parsers with 1.0? Or am I missing something obvious? The only way I see is that you create the Document instances yourself. Diff has constructors that accept Document as their arguments so it should work. Use XMLUnit.newControlParser(), set the EntityResolver and invoke parse() on the DoucmentBuilder. Stefan |
From: Elliot M. <eme...@jh...> - 2007-05-18 13:29:14
|
Stefan Bodewig wrote: > On Thu, 17 May 2007, Elliot Metsger <eme...@jh...> wrote: > >> Any chance that you could publish a Maven 2 artifact for 1.1 beta? > Right now I'm a bit reluctant to adding a beta to the Maven2 repo, but > I will file an upload request with the final release of 1.1. Understandable. So is there a workaround for setting an EntityResolver on the parsers with 1.0? Or am I missing something obvious? Thanks again, Elliot |
From: David C. <dc...@st...> - 2007-05-18 12:52:19
|
Stefan Bodewig wrote: > Hi, > > I've committed changes that treat xsi:schemaLocation and > xsi:noNamespaceSchemaLocation as attributes of a special kind. Just > as we do for DOCTYPE declarations with different SYSTEM ids, trunk now > flags differences in them as a special kind (well two kinds) of > Difference which is recoverable. > > One thing to be careful of if you are doing this for differences, is that an implementation is free to ignore the xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes, and supply it's own schema for use in validation. > I haven't made uo my mind on xsi:type and xsi:nil. In particular for > nil I first need to understand the semantics more deeply before I can > decide whether the current handling (it is an attribute like any other > attribute) makes sense or not. > > I would definitely not treat these as special attributes. Especially, xsi:type (which many B2B Standards, i.e. Core Components based standards are saying not to use). xsi:type can be used to override and substitute another complexType definition in place of the one that was originally specified. For many B2B situations, this allows deviation from the standard, and may allow for a completely different structure showing up than what has been defined. > These changes probably warrant a second beta before the final release. > > Any possibility of setting it so that how these are treated is configurable? |
From: Stefan B. <bo...@ap...> - 2007-05-18 05:35:19
|
On Thu, 17 May 2007, Furash Gary <fu...@mc...> wrote: > I'm diffing the following two bits of XML, that look identical to > me: what are you doing that riggers the transform? My guess would be ignoring whitespace. > ERROR: > 'com/sun/org/apache/xalan/internal/xsltc/runtime/AttributeList' > FATAL ERROR: 'Could not compile stylesheet' This is JDK 1.5's builtin XSLT processor, right? The stylesheet used is trivial and it is correct. Unfortunately Sun decided to ship a pretty buggy version of XSLTC instead of Xalan-J with the JDK. The best advice I can give is that you use a different XSLT processor. Download Xalan-J or Saxon or GNU JAXP and either use JAXP's endorsed override mechanism or XMLUnit's options to use this other processor. Stefan |
From: Stefan B. <bo...@ap...> - 2007-05-18 05:31:10
|
On Thu, 17 May 2007, Elliot Metsger <eme...@jh...> wrote: > Any chance that you could publish a Maven 2 artifact for 1.1 beta? xmlunit's SVN contains a basic template POM that gets populated duringthe build. Unfortunately it didn't go with the distribution, but beta2 will ship with it. Right now I'm a bit reluctant to adding a beta to the Maven2 repo, but I will file an upload request with the final release of 1.1. Stefan |
From: Stefan B. <bo...@ap...> - 2007-05-18 05:29:13
|
Hi, I've committed changes that treat xsi:schemaLocation and xsi:noNamespaceSchemaLocation as attributes of a special kind. Just as we do for DOCTYPE declarations with different SYSTEM ids, trunk now flags differences in them as a special kind (well two kinds) of Difference which is recoverable. I haven't made uo my mind on xsi:type and xsi:nil. In particular for nil I first need to understand the semantics more deeply before I can decide whether the current handling (it is an attribute like any other attribute) makes sense or not. These changes probably warrant a second beta before the final release. Stefan |
From: Elliot M. <eme...@jh...> - 2007-05-18 03:08:28
|
Hi All, Any chance that you could publish a Maven 2 artifact for 1.1 beta? Right now I'm using XMLUnit 1.0. My real issue is that I need to set a custom entity resolver on the parsers. Can I set a custom entity resolver on the parsers in 1.0 or do I need to use 1.1 beta? Thanks!!! Elliot |
From: Furash G. <fu...@mc...> - 2007-05-17 17:59:17
|
I'm diffing the following two bits of XML, that look identical to me: <soapenv:Body = xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/"> <GetLoginKey xmlns=3D"http://xml.objacct.com/"> <CompanyID>MCAO</CompanyID> <UserID>admin</UserID> <Password>abc123</Password> <ReturnType>0</ReturnType> </GetLoginKey> </soapenv:Body> <soapenv:Body = xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/"> <GetLoginKey xmlns=3D"http://xml.objacct.com/"> <CompanyID>MCAO</CompanyID> <UserID>admin</UserID> <Password>abc123</Password> <ReturnType>0</ReturnType> </GetLoginKey> </soapenv:Body> However, when I do: Diff diff =3D new Diff(shouldBe, msgBody); (where should be and msgBody are string representations) I get the error: ERROR: 'com/sun/org/apache/xalan/internal/xsltc/runtime/AttributeList' FATAL ERROR: 'Could not compile stylesheet' |
From: Stefan B. <bo...@ap...> - 2007-05-11 04:12:22
|
On Wed, 9 May 2007, Michael Schumacher <MSc...@ca...> wrote: > I'm using the DetailedDiff to compare XML's to find out what the > differences are. I was wondering if there is some XML's Test cases > out there that would hit all the cases in the DifferenceConstants? I don't think there is. Some of them are tricky to create. For example the parser must be in validating mode in order to ever receive a ATTR_VALUE_EXPLICITLY_SPECIFIED_ID difference. Note that XMLUnit 1.1 adds a type of Difference and will - under certain circumstances create another set of differences than 1.0 did. > For example, if I have the following XML's, it will produce a > difference of "presence of child nodes to be" > > XML Document 1 > > <?xml version="1.0" encoding="UTF-8"?> > <Root> > <OneElementDeep> > <BLAH/> > </OneElementDeep> > </Root> > > > > XML Document 2 > > <?xml version="1.0" encoding="UTF-8"?> > <Root> > <OneElementDeep> > <BLAH> > <Presence>Child</Presence> > </BLAH> > </OneElementDeep> > </Root> What else would you expect? I think in XMLUnit 1.1 you should get HAS_CHILD_NODES_ID, CHILD_NODELIST_LENGTH_ID and CHILD_NODE_NOT_FOUND_ID. > This would help me handle all the cases there are produced from the > DetailedDiff and handle them accordingly. Right now I'm building up > a java class that will generate a Delta between the two XML's. Seems to be the easiest thing to do for your tests. Stefan |
From: Stefan B. <bo...@ap...> - 2007-05-09 04:14:36
|
On Tue, 8 May 2007, Anamika Majumder <pra...@ho...> wrote: > Thank you again Stefan, this is very helpful, I am all set with > this. could you pl. let me know how if there is a way to run a > xmlunit test case from the command line (I have been running my > testcases through the NetBeans IDE. You can run them the same way as any JUnit tests. JUnit contains a command line test runner, please consult its documentation. I run my tests via Ant (see the JUnit task's documentation) and if you are using Maven there is the surefire plugin. Stefan |
From: Anamika M. <pra...@ho...> - 2007-05-08 17:34:09
|
Thank you again Stefan, this is very helpful, I am all set with this. could you pl. let me know how if there is a way to run a xmlunit test case = from the command line (I have been running my testcases through the NetBean= s IDE. Thanks. Anamika. =20 Abhin: I wrote the following (in case this is still helpful): public int differenceFound(Difference d) { Node controlN =3D d.getControlNodeDetail().getNode(); Node testN =3D d.getTestNodeDetail().getNode(); String controlNodeName =3D controlN.getNodeName(); String testNodeName =3D testN.getNodeName(); String testXpathLoc =3D d.getTestNodeDetail().getXpathLocation(); String conXpathLoc =3D d.getControlNodeDetail().getXpathLocation(); String foo =3D "/abcd[1]/efgh[1]/ijk[1]/text()[1]";=20 if(conXpathLoc.equals(foo) && testXpathLoc.equals(foo)) return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL; else return RETURN_ACCEPT_DIFFERENCE;=20 }----------------------------------------------------------=20 > To: xml...@li...> From: bo...@ap...> Date= : Tue, 8 May 2007 06:42:34 +0200> CC: Ana...@om...> Subject: = Re: [Xmlunit-general] Comparing two XML documents while skipping certain no= des> > On Fri, 4 May 2007, Anamika Majumder <Ana...@om...>> w= rote:> > > The method int differenceFound(org.custommonkey.xmlunit.Differen= ce> > difference) in the DifferenceListener interface needs a Difference> >= object, while the Difference class has only protected constructors.> > The= tests I am writing are in a different package and do not have> > access to= any protected constructors in the package> > "org.custommonkey.xmlunit", a= m I missing the point entirely??> > If you are you trying to to test your c= ustom implementation of> DifferenceListener, this is a problem, I agree.> >= What I suggested was that you write a DifferenceListener like> (untested c= ode, I didn't try to even compile it):> > public class MyDiffListener imple= ments DifferenceListener {> > public int differenceFound(Difference d) {> i= f (d.getId() =3D=3D DifferenceConstants.ELEMENT_TAG_NAME_ID> && d.getContro= lNodeDetail().getValue().equals("foo")> && d.getTestNodeDetail().getValue()= .equals("bar")) {> return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL;> }> ret= urn RETURN_ACCEPT_DIFFERENCE;> }> > public void skippedComparison(Node cont= rol, Node test) {}> }> > and use Diff.overrideDifferenceListener() with an = instance of your> class.> > I know you cannot write tests for MyDiffListene= r, but it is pretty> easy to validate and using the approach outlined above= , your XMLUnit> tests should skip over differences between "foo" and "bar" = nodes.> > Stefan> > -------------------------------------------------------= ------------------> This SF.net email is sponsored by DB2 Express> Download= DB2 Express C - the FREE version of DB2 express and take> control of your = XML. No limits. Just data. Click to get it now.> http://sourceforge.net/pow= erbar/db2/> _______________________________________________> Xmlunit-genera= l mailing list> Xml...@li...> https://lists.source= forge.net/lists/listinfo/xmlunit-general _________________________________________________________________ See what you=92re getting into=85before you go there. http://newlivehotmail.com/?ocid=3DTXT_TAGWL_migration_HM_viral_preview_0507= |
From: Stefan B. <bo...@ap...> - 2007-05-08 04:42:36
|
On Fri, 4 May 2007, Anamika Majumder <Ana...@om...> wrote: > The method int differenceFound(org.custommonkey.xmlunit.Difference > difference) in the DifferenceListener interface needs a Difference > object, while the Difference class has only protected constructors. > The tests I am writing are in a different package and do not have > access to any protected constructors in the package > "org.custommonkey.xmlunit", am I missing the point entirely?? If you are you trying to to test your custom implementation of DifferenceListener, this is a problem, I agree. What I suggested was that you write a DifferenceListener like (untested code, I didn't try to even compile it): public class MyDiffListener implements DifferenceListener { public int differenceFound(Difference d) { if (d.getId() == DifferenceConstants.ELEMENT_TAG_NAME_ID && d.getControlNodeDetail().getValue().equals("foo") && d.getTestNodeDetail().getValue().equals("bar")) { return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL; } return RETURN_ACCEPT_DIFFERENCE; } public void skippedComparison(Node control, Node test) {} } and use Diff.overrideDifferenceListener() with an instance of your class. I know you cannot write tests for MyDiffListener, but it is pretty easy to validate and using the approach outlined above, your XMLUnit tests should skip over differences between "foo" and "bar" nodes. Stefan |
From: Majumder, A. <Ana...@Om...> - 2007-05-04 15:46:48
|
Stefan -=20 The method int differenceFound(org.custommonkey.xmlunit.Difference difference) in the DifferenceListener interface needs a Difference object, while the Difference class has only protected constructors.=20 The tests I am writing are in a different package and do not have access to any protected constructors in the package "org.custommonkey.xmlunit", am I missing the point entirely?? Thank you. Anamika. -----Original Message----- From: Stefan Bodewig [mailto:bo...@ap...]=20 Sent: Friday, May 04, 2007 10:20 AM To: xml...@li...; Majumder, Anamika Subject: Re: [Xmlunit-general] Comparing two XML documents while skipping certain nodes On Fri, 4 May 2007, Anamika Majumder <Ana...@om...> wrote: > Stephan - I have another question. I am trying to compare two xml > documents but would like to Skip the comparison in a few of those > nodes (e.g the documents should be treated as identical even if two > elements 'foo' and 'bar' are different in the two). >=20 > I see in the examples, that we could implement the > DifferenceListener, Yes, I was about to recommend that. > but it seems like then the documents would be treated as > similar/identical even if nodes other than 'foo' and 'bar' are > different. Why? You will have to be more specific in your DifferenceListener implementation and only return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL if the Difference is one between foo and bar elements. In any other case return RETURN_ACCEPT_DIFFERENCE. > Is there a way so that I can specify using xpaths, that I would like > to skip comparison of just foo and bar. No, unfortunately there is not. Stefan |
From: Stefan B. <bo...@ap...> - 2007-05-04 14:19:36
|
On Fri, 4 May 2007, Anamika Majumder <Ana...@om...> wrote: > Stephan - I have another question. I am trying to compare two xml > documents but would like to Skip the comparison in a few of those > nodes (e.g the documents should be treated as identical even if two > elements 'foo' and 'bar' are different in the two). > > I see in the examples, that we could implement the > DifferenceListener, Yes, I was about to recommend that. > but it seems like then the documents would be treated as > similar/identical even if nodes other than 'foo' and 'bar' are > different. Why? You will have to be more specific in your DifferenceListener implementation and only return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL if the Difference is one between foo and bar elements. In any other case return RETURN_ACCEPT_DIFFERENCE. > Is there a way so that I can specify using xpaths, that I would like > to skip comparison of just foo and bar. No, unfortunately there is not. Stefan |
From: Majumder, A. <Ana...@Om...> - 2007-05-04 13:14:44
|
Stephan - I have another question. I am trying to compare two xml documents but would like to=20 Skip the comparison in a few of those nodes (e.g the documents should be treated as identical even if two elements 'foo' and 'bar' are different in the two). I see in the examples, that we could implement the DifferenceListener, but it seems like then the documents would be treated as similar/identical even if nodes other than 'foo' and 'bar' are different. Is there a way so that I can specify using xpaths, that I would like to skip comparison of just foo and bar. Thank you. Anamika. -----Original Message----- From: Majumder, Anamika=20 Sent: Thursday, May 03, 2007 11:18 AM To: 'Stefan Bodewig'; xml...@li... Subject: RE: [Xmlunit-general] Comparing two xml docs with an external dtd Stefan: I am all set with this, thank you very much for your help. Anamika=20 -----Original Message----- From: Stefan Bodewig [mailto:bo...@ap...]=20 Sent: Thursday, May 03, 2007 10:42 AM To: xml...@li...; Majumder, Anamika Subject: Re: [Xmlunit-general] Comparing two xml docs with an external dtd [please keep the list in CC so that the answers get archived] > I have written a class implementing EntityResolver with the > following method: looks good at first glance. > And my testcase looks like the following: My aim is to compare testf > with controlf and the dtd (InfoSettlementResponse.dtd) resides in > the same directory as the xml files. If you are using XMLUnit 1.1 beta, simply use XMLUnit.setControlEntityresolver and XMLUnit.setTestEntitiyResolver and then invoke assertXMLEquals or Diff just as you did in your first code examples. Alternatively you (should work in 1.0 as well) can parse the XML files yourself, while setting the EntityResolver, something like > File controlf =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlementResponse_control.xml"); > =20 > DocumentBuilder dbCon =3D XMLUnit.getControlParser(); > OmgeoDTDEntityResolver er =3D new OmgeoDTDEntityResolver(); > dbCon.setEntityResolver(er); Document docCon =3D dbCon.parse(new InputSource(new FileInputStream(controlf))); andd similar for the test document. I.e. you parse your document under the control of the EntityResolver. The parser's going to call back on your resolver when it encounters the DTD's public identifier. See the jaxp docs for more details. After you have Document instances you can use the Diff constructor that accepts org.w3c.dom.Document as arguments. Stefan |
From: Majumder, A. <Ana...@Om...> - 2007-05-03 15:18:15
|
Stefan: I am all set with this, thank you very much for your help. Anamika=20 -----Original Message----- From: Stefan Bodewig [mailto:bo...@ap...]=20 Sent: Thursday, May 03, 2007 10:42 AM To: xml...@li...; Majumder, Anamika Subject: Re: [Xmlunit-general] Comparing two xml docs with an external dtd [please keep the list in CC so that the answers get archived] > I have written a class implementing EntityResolver with the > following method: looks good at first glance. > And my testcase looks like the following: My aim is to compare testf > with controlf and the dtd (InfoSettlementResponse.dtd) resides in > the same directory as the xml files. If you are using XMLUnit 1.1 beta, simply use XMLUnit.setControlEntityresolver and XMLUnit.setTestEntitiyResolver and then invoke assertXMLEquals or Diff just as you did in your first code examples. Alternatively you (should work in 1.0 as well) can parse the XML files yourself, while setting the EntityResolver, something like > File controlf =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlementResponse_control.xml"); > =20 > DocumentBuilder dbCon =3D XMLUnit.getControlParser(); > OmgeoDTDEntityResolver er =3D new OmgeoDTDEntityResolver(); > dbCon.setEntityResolver(er); Document docCon =3D dbCon.parse(new InputSource(new FileInputStream(controlf))); andd similar for the test document. I.e. you parse your document under the control of the EntityResolver. The parser's going to call back on your resolver when it encounters the DTD's public identifier. See the jaxp docs for more details. After you have Document instances you can use the Diff constructor that accepts org.w3c.dom.Document as arguments. Stefan |
From: Stefan B. <bo...@ap...> - 2007-05-03 14:41:47
|
[please keep the list in CC so that the answers get archived] > I have written a class implementing EntityResolver with the > following method: looks good at first glance. > And my testcase looks like the following: My aim is to compare testf > with controlf and the dtd (InfoSettlementResponse.dtd) resides in > the same directory as the xml files. If you are using XMLUnit 1.1 beta, simply use XMLUnit.setControlEntityresolver and XMLUnit.setTestEntitiyResolver and then invoke assertXMLEquals or Diff just as you did in your first code examples. Alternatively you (should work in 1.0 as well) can parse the XML files yourself, while setting the EntityResolver, something like > File controlf = new File("C:/Program Files/xmlunit/tests/etc/InfoSettlementResponse_control.xml"); > > DocumentBuilder dbCon = XMLUnit.getControlParser(); > OmgeoDTDEntityResolver er = new OmgeoDTDEntityResolver(); > dbCon.setEntityResolver(er); Document docCon = dbCon.parse(new InputSource(new FileInputStream(controlf))); andd similar for the test document. I.e. you parse your document under the control of the EntityResolver. The parser's going to call back on your resolver when it encounters the DTD's public identifier. See the jaxp docs for more details. After you have Document instances you can use the Diff constructor that accepts org.w3c.dom.Document as arguments. Stefan |
From: Stefan B. <bo...@ap...> - 2007-05-03 06:33:44
|
Hi Anamika, below is yesterday's response of mine, which you should have received if you are subscribed to this list ... Stefan On Wed, 02 May 2007, Stefan Bodewig <bo...@ap...> wrote: > On Wed, 2 May 2007, Anamika Majumder <Ana...@om...> > wrote: > >> Hello - I have written the following method in which I am trying to >> first validate two xml documents against an external dtd and then >> my aim is to compare the two validated xml documents, but am >> getting an error (no protocol InfoSettlementResponse.dtd) during >> the comparing step because of the external dtd. > > Unfortunately there is no way as simple as in using Validator when > you use Diff. > > Your best option is to implement an EntityResolver that maps your > public ID to the File. A convenient option may be to use Apache's > XML resolver and a catalog file, but implementing EntityResolver is > relatively straight forward for simple cases as well. > > Stefan |
From: Anamika M. <pra...@ho...> - 2007-05-02 16:30:44
|
Stephan - I Stephan, I see that you have posted a response to my question -= but am not able to view the response (getting an Internal Server Error). C= ould you pl. send me your response at pra...@ho...ank you very = much.Anamika.----------------------------------------------------------=20 From: pra...@ho...To: xml...@li...Date: W= ed, 2 May 2007 11:59:07 -0400Subject: [Xmlunit-general] Comparing two xml d= ocs with an external dtd Hello - I have written the following method in which I am trying to first v= alidate two xml documents against an external dtd and then my aim is to com= pare the two validated xml documents, but am getting an error (no protocol = InfoSettlementResponse.dtd) during the comparing step because of the extern= al dtd. Here is my code - could someone pl. let me know what is missing - i= .e. how do I compare two xml files that have an external DTD?? public void = testValidationThenCompareTwoXMLFiles() throws Exception {File testf =3D new= File("C:/Program Files/xmlunit/tests/etc/InfoSettlementResponse_test.xml")= ;File controlf =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlem= entResponse_control.xml");File dtdFile =3D new File("C:/Program Files/xmlun= it/tests/etc/InfoSettlementResponse.dtd");assertEquals(dtdFile.getAbsoluteP= ath(), true, dtdFile.exists());String dtdUrl =3D dtdFile.toURL().toExternal= Form();Validator vTest =3D new Validator(new FileReader(testf), dtdUrl);Val= idator vControl =3D new Validator(new FileReader(controlf), dtdUrl);assertX= MLValid(vTest);assertXMLValid(vControl);//GETTING AN ERROR IN THE FOLLOWING= LINE compareXML(new FileReader(testf), new FileReader(controlf));}Thank yo= u.Anamika.----------------------------------------------------------=20 Discover the new Windows Vista Learn more!=20 _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=3Dwindows+vista&mkt=3Den-US&form=3DQBR= E= |
From: Anamika M. <pra...@ho...> - 2007-05-02 15:59:20
|
Hello -=20 I have written the following method in which I am trying to first validate = two xml documents against an external dtd and then my aim is to compare the= two validated xml documents, but am getting an error (no protocol InfoSett= lementResponse.dtd) during the comparing step because of the external dtd.= =20 Here is my code - could someone pl. let me know what is missing - i.e. how = do I compare two xml files that have an external DTD?? =20 public void testValidationThenCompareTwoXMLFiles() throws Exception { File testf =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlementR= esponse_test.xml"); File controlf =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettleme= ntResponse_control.xml"); File dtdFile =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlemen= tResponse.dtd"); assertEquals(dtdFile.getAbsolutePath(), true, dtdFile.exists()); String dtdUrl =3D dtdFile.toURL().toExternalForm(); Validator vTest =3D new Validator(new FileReader(testf), dtdUrl); Validator vControl =3D new Validator(new FileReader(controlf), dtdUrl); assertXMLValid(vTest); assertXMLValid(vControl); //GETTING AN ERROR IN THE FOLLOWING LINE=20 compareXML(new FileReader(testf), new FileReader(controlf)); } Thank you. Anamika.----------------------------------------------------------=20 _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=3Dwindows+vista&mkt=3Den-US&form=3DQBR= E= |
From: Stefan B. <bo...@ap...> - 2007-05-02 15:51:56
|
On Wed, 2 May 2007, Anamika Majumder <Ana...@om...> wrote: > Hello - I have written the following method in which I am trying to > first validate two xml documents against an external dtd and then my > aim is to compare the two validated xml documents, but am getting an > error (no protocol InfoSettlementResponse.dtd) during the comparing > step because of the external dtd. Unfortunately there is no way as simple as in using Validator when you use Diff. Your best option is to implement an EntityResolver that maps your public ID to the File. A convenient option may be to use Apache's XML resolver and a catalog file, but implementing EntityResolver is relatively straight forward for simple cases as well. Stefan |
From: Majumder, A. <Ana...@Om...> - 2007-05-02 15:41:47
|
Hello -=20 I have written the following method in which I am trying to first validate two xml documents against an external dtd and then my aim is to compare the two validated xml documents, but am getting an error (no protocol InfoSettlementResponse.dtd) during the comparing step because of the external dtd.=20 Here is my code - could someone pl. let me know what is missing - i.e. how do I compare two xml files that have an external DTD?? public void testValidationThenCompareTwoXMLFiles() throws Exception { File testf =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlementResponse_test.xml"); File controlf =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlementResponse_control.xml"); File dtdFile =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlementResponse.dtd"); assertEquals(dtdFile.getAbsolutePath(), true, dtdFile.exists()); String dtdUrl =3D dtdFile.toURL().toExternalForm(); Validator vTest =3D new Validator(new FileReader(testf), = dtdUrl); Validator vControl =3D new Validator(new FileReader(controlf), dtdUrl); assertXMLValid(vTest); assertXMLValid(vControl); //GETTING AN ERROR IN THE FOLLOWING LINE=20 compareXML(new FileReader(testf), new FileReader(controlf)); =20 } Thank you. Anamika. |
From: Stefan B. <bo...@ap...> - 2007-05-01 11:44:31
|
Hi, I've just added XMLUnit.setXPathFactory(String) that should allow you to specify which XPathFactory to use when JAXP 1.3 is around. Given that I don't currently use any "alternative" engines, could anybody with access to more than implementation please build XMLUnit from source and give it a try? Thanks Stefan |
From: Stefan B. <bo...@ap...> - 2007-05-01 10:51:30
|
On Fri, 27 Apr 2007, David Carver <dc...@st...> wrote: > I've got some basic code working for this. Currently just takes the > first XML Schema parser available and tries to compile the schema. > If any Exceptions are tossed during the compilation, it will fail > the assertion. Sounds reasonable. I dug into the JAXP 1.3 validation stuff a little deeper and maybe we should - at least as an option - support it in later versions. At least in theory it would allow Relax NG validations as well, for example. > I'll run it in our tests for a while before contributing it back. > It's a fairly small change but can wait until 1.2 I'm in Amsterdam for ApacheCon this week and plan to release XMLUnit 1.1 final next week, unless major bugs get uncovered. Stefan |
From: David C. <dc...@st...> - 2007-04-27 21:05:38
|
Stefan Bodewig wrote: > On Wed, 25 Apr 2007, David Carver <dc...@st...> wrote: > >>>> This article shows how to pre-compile a schema using JAXP 1.3 api: >>>> >>>> https://jaxp.dev.java.net/article/jaxp-1_3-article.html#Compile_Schema(s) >>>> >>>> >>> I will look into it, thanks for the link. >>> >>> This probably should go into XMLUnit 1.2, I'd like to see us >>> finalize 1.1 pretty soon. There is nothing bad in having frequent >>> releases, more frequent than every four years, that is 8-) >>> >>> >> Yeah, I agree. If I can get some spare time, I'll take an initial >> stab at getting it going. >> > > That would be nice. > I've got some basic code working for this. Currently just takes the first XML Schema parser available and tries to compile the schema. If any Exceptions are tossed during the compilation, it will fail the assertion. Seems to work. I may need to refactor some of the names it uses, but it worked on a couple of schemas that I tested it against. I'll run it in our tests for a while before contributing it back. It's a fairly small change but can wait until 1.2 Dave |