DeltaXML Support Forums
| Not found what you where looking for? Try the advanced search | Go to page back123...101112...131415next |
| DeltaXML Core > Determining if documents are equivalent with PipelinedComparator? | ||||||
Posted:
04-April-2008 15:49 Re: Determining if documents are equivalent with PipelinedComparator? Hi, Firstly, thanks for taking the time to evaluate DeltaXML Core, I hope you are finding it useful. The PipelinedComparator does not yet include an equivalent to the isEqual() method of XMLComparator. However, we will soon be releasing a new major version of DeltaXML Core (version 5.0) that is currently in beta testing. We will add the isEqual() method to the PipelinedComparator in the next beta version, which can be made available to you if you wish, or you could wait until the final release of 5.0. The isEqual() method would make use of any input filters defined on the PipelinedComparator and then perform a fast-fail comparison of the input documents in much the same way as the XMLComparator method. Obviously, output filters are not relevant in this case. In the meantime, I have outlined below details of how you can go about determining equality from the current output of PipelinedComparator. I hope you find this useful, please do let us know if you have any other questions. Many thanks, Tristan Changes-only delta If you produce a changes-only delta, the result of comparing two equal inputs will simply be:
where 'root' is the root element of your inputs. While this will not return as quickly as isEqual() does if the inputs are not the same, it does provide a simple way of determining equality. Full-context delta If you produce a full-context delta, you don't need to read the whole result to determine whether the inputs are equal or not. All you need to test is the deltaxml:delta attribute value on the root element. If the inputs are equal, the value will be 'unchanged', otherwise it will be 'WFmodify'. | ||||||
| DeltaXML Core > Determining if documents are equivalent with PipelinedComparator? | ||||||
Posted:
04-April-2008 007:20 Determining if documents are equivalent with PipelinedComparator? Can I determine if two filtered XML documents are equivelent using PipelinedComparator? PipelinedComparator doesn't appear to have an equivalent to the isEqual() method of XMLComparator and parsing the output file seems rather extreme. | ||||||
| DeltaXML Core > Getting error with sample AddressBook using xsd instead | ||||||
Posted:
03-March-2008 19:18 Hi Nigel, Setting pc.setParserFeature("http://apache.org/xml/features/validation/schema", true); did the trick. There's already a schema tag in the xsd file. It must somehow gotten removed in the process of pasting/editing on my part. Thank you | ||||||
| DeltaXML Core > Getting error with sample AddressBook using xsd instead | ||||||
Posted:
03-March-2008 15:29 Hello there,
Your requirement seems perfectly reasonable, but it is something that we haven't got around to creating an example for yet. First off this exception message isn't very informative! When the data files (a1.xml/a2.xml) are not well-formed a more informative messages indicating the nature of the failure is coming out in the exception trace. It appears to be an issue with how the exception is passed from the parser through the input filter chain when Saxon is being used. When I tried to run the code I discovered a missing line in the xsd, it needs an opening schema tag and namespace declaration:
Because the error message was unhelpful I used the standalone sax.Counter sample to test the files/schema, with a command-line like this:
I also modifed the data files, for example:
I'm not too sure as to why it worked in DeltaWing and not in the sample. One possibility is that somehow different versions of the SAX Parser and XSLT processors were being used, caused by some slight difference in the classpath or the JVM. This is an area where different JVMs 1.4, 5.0, 6.0 have different behaviours (because of the changes in the Xerces/Xalan components and their package locations included in the Java runtime) and we usually need more information to debug. Two other probably related issues.... You may need:
Finally, if you need more explicit control of the parsers being used you can always instantiate them yourself (you need 2, one for each input) using the JAXP factory, configure as needed and then hook them into the PipelinedComparator using SAXSource inputs. Hope this helps, Nigel | ||||||
| DeltaXML Core > Getting error with sample AddressBook using xsd instead | ||||||
Posted:
03-March-2008 12:55 Getting error with sample AddressBook using xsd instead I've just downloaded DeltaXMLCore-4_5_1 to evaluate. I'm poking around with Addressbook example to use xsd instead of dtd. I'm getting the following error when execute AddressBook. However, running the files through DeltaWing and it works fine. Can someone please point out what I'm doing wrong? Thank you. run: [java] Exception in thread "main" com.deltaxml.core.PipelineProcessingExcep tion: Exception detected during pipeline processing [java] at com.deltaxml.core.PipelinedComparator.compare(PipelinedComparator.java:74) [java] at com.deltaxml.core.PipelinedComparator.compare(PipelinedComparator.java:302) [java] at AddressBook.main(AddressBook.java:43) [java] Caused by: com.deltaxml.api.DeltaXMLProcessingException: XML Parsing failed [java] at com.deltaxml.c_b.c_a.c_g.c_a(c_g.java:121) [java] at com.deltaxml.api.ComparatorImpl.c_a(ComparatorImpl.java:60) [java] at com.deltaxml.api.ComparatorImpl.compare(ComparatorImpl.java:27) [java] at com.deltaxml.core.PipelinedComparator.compare(PipelinedComparator.java:306) [java] ... 2 more [java] Caused by: javax.xml.transform.TransformerException: XML Parsing failed [java] at com.icl.saxon.Filter.parse(Filter.java:412) [java] at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333) [java] at com.deltaxml.c_b.c_a.c_g.c_a(c_g.java:110) [java] ... 5 more [java] Java Result: 1 [echo] Running: AddressBook on (a1.xml, a2.xml) to produce out.html Schema I created: <?xml version="1.0" encoding="ISO-8859-1" ?> <xs:simpleType name="stringtype"> <xs:restriction base="xs:string"/> </xs:simpleType> <xs:simpleType name="personidtype"> <xs:restriction base="xs:string"> <xs:pattern value="[0-9]{2,5}"/> </xs:restriction> </xs:simpleType> <xs:complexType name="addresstype"> <xs:sequence> <xs:element name="line" type="stringtype" maxOccurs="2"/> <xs:element name="zip" type="stringtype"/> </xs:sequence> </xs:complexType> <xs:complexType name="persontype"> <xs:sequence> <xs:element name="name" type="stringtype"/> <xs:element name="email" type="stringtype"/> <xs:element name="address" type="addresstype"/> </xs:sequence> <xs:attribute name="customerid" type="personidtype" use="required"/> </xs:complexType> <xs:complexType name="addressListtype"> <xs:sequence> <xs:element name="person" type="persontype" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:element name="addressList" type="addressListtype"/> </xs:schema> | ||||||
| DeltaXML Core > Auto Feed XML Compare? | ||||||
Posted:
02-February-2008 11:04 Re: Auto Feed XML Compare? Hi, firstly, let me apologise for this reply taking so long. Your post was not spotted as quickly as it should have been. I'm not entirely certain what you are trying to achieve here. Are you trying to compare a single document against n other documents or are you trying to set up multiple pairs of documents for comparison? At present, our api only supports a single comparison between two files. However, if you could clarify what you are trying to do, we will make some more useful suggestions as to how to achieve it. Many thanks, Tristan | ||||||
| DeltaXML Core > Auto Feed XML Compare? | ||||||
Posted:
02-February-2008 21:05 Auto Feed XML Compare? Does the core product support the auto feed of multiple XML documents to be compared? Or can only two XML files be compared at a time? | ||||||
| DeltaXML Core > setting features with core 4.4 | ||||||
Posted:
01-January-2008 16:43 Re: compator vs combiner features Hello Robert,
Yes, exactly. A compare B -> C ; A combine-forward C -> B B combine-reverse C -> A Note that comparison is not commutative, so that: A compare B != B compare A Similarly this all works the other way round, so that: B compare A -> D ; B combine-forward D -> A A combine-reverse D -> B So the compareForward feature allows you to reverse the normal 'direction' of the delta when used with recombination. We don't believe we have many users of the combiner - though it does have some specialized use-cases, but it is an important way to prove the correctness of the delta; we use it heavily in our test processes. | ||||||
| DeltaXML Core > setting features with core 4.4 | ||||||
Posted:
01-January-2008 12:33 compator vs combiner features hello nigel thanks for your fast reply. do i get you right? the combiner is used to reproduce a source document? so when i compare A and B and get the result C, then i can take B and C to get A again? regards robert | ||||||
| DeltaXML Core > setting features with core 4.4 | ||||||
Posted:
01-January-2008 14:46 compator vs combiner features Hello Robert,
This is because isCombineForward is a combiner feature, not a comparator feature. The combiner is a component which takes a raw, changes-only or minimal delta produced by the comparator and one of the other comparator inputs and a regenerate or 'recombine' to produce what was the other comparator input.
The software is working as we expect, I think you may have seen the list of features and did not appreciate the distinction between comparator and combiner? I'll see if there is anything in the documentation we can improve for a future release. Some backround to the API design: There is both an XMLComparator and an XMLCombiner in the lower level JAXP style API (in the com.deltaxml.api package). But there is only a PipelinedComparator in the higher level com.deltaxml.core API. The reason that we don't have a PipelinedCombiner is because when the comparator/combiner are used to 'round-trip' XML, the combiner needs raw un-processed delta files from the comparator. We have many use-cases for a Pipelined Comparator, but we could not find any for a 'Pipelined Combiner', hence the differences in these APIs. Regards, Nigel | ||||||