Hi,
Consider the following scenario:
- I am using XMLUnit on a set of legacy files with different SYSTEM
definitions in DOCTYPE. Some of them are invalid (the web address
changed in real life). Because I had ceated my own EntityResolver to
resolve to a local file, I decided to use it.
The following lines work:
XMLUnit.setControlEntityResolver(entityResolver ); //My own
implementation of EntityResolver
XMLUnit.setTestEntityResolver(entityResolver );
Document myControlDocument =
XMLUnit.buildControlDocument(myControlXML); //OK, calls my
EntityResolver in the process. all is well
Document myTestDocument = XMLUnit.buildTestDocument(myTestXML);
Document myControlDocument
=myControlTransform.getResultDocument();
Document myTestDocument =myTestTransform.getResultDocument();
XMLUnit.compareXML(myControlDocument,myTestDocument);
Now, the problem comes when I try to apply a transformation to one of
the documents:
Transform myControlTransform = new Transform(myControlXML, new
File("src/test/resources/nodeRemover.xsl"));
This code doesn't seem to use my EntityResolver, but tries to resolve
the internet address (it doesn't work). So when I call
myControlTransform.getResultDocument(); I get an empty document instead
of the correct one.
My questions are:
a) how can I use my EntityResolver with Transform and Transformers?
b) Is it possible to use our own EntityResolver with
XMLUnit.getTransformerFactory()? How?
Thank you very much for your replies,
Miguel Almeida
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Xmlunit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xmlunit-general