<?xml version="1.0" encoding="UTF-8"?><rss xmlns:xrl="http://1060.org/xrl" version="2.0"><channel><title>Getting error with sample AddressBook using xsd instead</title><link>http://www.deltaxml.com/forum/topic/20</link><description>
					Entries: 8 Views: 273</description><generator>1060 NetKernel Standard Edition v2.x.x 1060 Forum v1.0.0</generator><language>en-us</language><ttl>60</ttl><item><title/><link>http://www.deltaxml.com/forum/topic/20</link><guid isPermaLink="true">http://www.deltaxml.com/forum/topic/20</guid><description>&lt;div&gt;Hi Nigel,&lt;br/&gt;&lt;br/&gt;Setting pc.setParserFeature("http://apache.org/xml/features/validation/schema", true); did the trick.&lt;br/&gt;&lt;br/&gt;There's already a schema tag in the xsd file.  It must somehow gotten removed in the process of pasting/editing on my part.&lt;br/&gt;&lt;br/&gt;Thank you&lt;/div&gt;</description><pubDate>Thu, 13 Mar 2008 19:18:00 GMT</pubDate></item><item><title/><link>http://www.deltaxml.com/forum/topic/20</link><guid isPermaLink="true">http://www.deltaxml.com/forum/topic/20</guid><description>&lt;div&gt;Hello there,&lt;br/&gt;&lt;br/&gt;&lt;table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt; &lt;tr&gt;&lt;td&gt;&lt;div class="forum-quote"&gt;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.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br/&gt;&lt;br/&gt;Your requirement seems perfectly reasonable, but it is something that we haven't got around to creating an example for yet. &lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;When I tried to run the code I discovered a missing line in the xsd, it needs an opening schema tag and namespace declaration:&lt;br/&gt;&lt;br/&gt;&lt;table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;tr&gt;&lt;td&gt;&lt;div class="forum-code"&gt;&lt;pre&gt;&amp;lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br/&gt;&lt;br/&gt;Because the error message was unhelpful I used the standalone sax.Counter sample to test the files/schema, with a command-line like this:&lt;br/&gt;&lt;br/&gt;&lt;table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt; &lt;tr&gt;&lt;td&gt;&lt;div class="forum-quote"&gt;java -cp /usr/local/java/xerces-2_9_0/xercesImpl.jar:/usr/local/java/xerces-2_9_0/xercesSamples.jar sax.Counter  -v -s -f a1.xml &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br/&gt;&lt;br/&gt;I also modifed the data files, for example:&lt;br/&gt;&lt;br/&gt;&lt;table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt; &lt;tr&gt;&lt;td&gt;&lt;div class="forum-quote"&gt;&amp;lt;addressList xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&lt;br/&gt;    xsi:noNamespaceSchemaLocation='address.xsd'&amp;gt;&lt;br/&gt;   &amp;lt;person customerid="15"&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;Two other probably related issues....&lt;br/&gt;&lt;br/&gt;You may need:&lt;br/&gt;&lt;br/&gt;&lt;table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt; &lt;tr&gt;&lt;td&gt;&lt;div class="forum-quote"&gt;pc.setParserFeature("http://apache.org/xml/features/validation/schema", true);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;Hope this helps,&lt;br/&gt;&lt;br/&gt;Nigel&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;</description><pubDate>Thu, 13 Mar 2008 15:29:00 GMT</pubDate></item><item><title>Getting error with sample AddressBook using xsd instead</title><link>http://www.deltaxml.com/forum/topic/20</link><guid isPermaLink="true">http://www.deltaxml.com/forum/topic/20</guid><description>&lt;div&gt;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.&lt;br/&gt;&lt;br/&gt;run:&lt;br/&gt;     [java] Exception in thread "main" com.deltaxml.core.PipelineProcessingExcep&lt;br/&gt;tion: Exception detected during pipeline processing&lt;br/&gt;     [java]     at com.deltaxml.core.PipelinedComparator.compare(PipelinedComparator.java:74)&lt;br/&gt;     [java]     at com.deltaxml.core.PipelinedComparator.compare(PipelinedComparator.java:302)&lt;br/&gt;     [java]     at AddressBook.main(AddressBook.java:43)&lt;br/&gt;     [java] Caused by: com.deltaxml.api.DeltaXMLProcessingException: XML Parsing failed&lt;br/&gt;     [java]     at com.deltaxml.c_b.c_a.c_g.c_a(c_g.java:121)&lt;br/&gt;     [java]     at com.deltaxml.api.ComparatorImpl.c_a(ComparatorImpl.java:60)&lt;br/&gt;     [java]     at com.deltaxml.api.ComparatorImpl.compare(ComparatorImpl.java:27)&lt;br/&gt;     [java]     at com.deltaxml.core.PipelinedComparator.compare(PipelinedComparator.java:306)&lt;br/&gt;     [java]     ... 2 more&lt;br/&gt;     [java] Caused by: javax.xml.transform.TransformerException: XML Parsing failed&lt;br/&gt;     [java]     at com.icl.saxon.Filter.parse(Filter.java:412)&lt;br/&gt;     [java]     at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)&lt;br/&gt;     [java]     at com.deltaxml.c_b.c_a.c_g.c_a(c_g.java:110)&lt;br/&gt;     [java]     ... 5 more&lt;br/&gt;     [java] Java Result: 1&lt;br/&gt;     [echo] Running: AddressBook on (a1.xml, a2.xml) to produce out.html&lt;br/&gt;&lt;br/&gt;Schema I created:&lt;br/&gt;&lt;br/&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1" ?&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;xs:simpleType name="stringtype"&amp;gt;&lt;br/&gt; &amp;lt;xs:restriction base="xs:string"/&amp;gt;&lt;br/&gt;&amp;lt;/xs:simpleType&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;xs:simpleType name="personidtype"&amp;gt;&lt;br/&gt; &amp;lt;xs:restriction base="xs:string"&amp;gt;&lt;br/&gt;  &amp;lt;xs:pattern value="[0-9]{2,5}"/&amp;gt;&lt;br/&gt; &amp;lt;/xs:restriction&amp;gt;&lt;br/&gt;&amp;lt;/xs:simpleType&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;xs:complexType name="addresstype"&amp;gt;&lt;br/&gt; &amp;lt;xs:sequence&amp;gt;&lt;br/&gt;  &amp;lt;xs:element name="line" type="stringtype" maxOccurs="2"/&amp;gt;&lt;br/&gt;  &amp;lt;xs:element name="zip" type="stringtype"/&amp;gt;&lt;br/&gt; &amp;lt;/xs:sequence&amp;gt;&lt;br/&gt;&amp;lt;/xs:complexType&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;xs:complexType name="persontype"&amp;gt;&lt;br/&gt; &amp;lt;xs:sequence&amp;gt;&lt;br/&gt;  &amp;lt;xs:element name="name" type="stringtype"/&amp;gt;&lt;br/&gt;  &amp;lt;xs:element name="email" type="stringtype"/&amp;gt;&lt;br/&gt;  &amp;lt;xs:element name="address" type="addresstype"/&amp;gt;&lt;br/&gt; &amp;lt;/xs:sequence&amp;gt;&lt;br/&gt; &amp;lt;xs:attribute name="customerid" type="personidtype" use="required"/&amp;gt;&lt;br/&gt;&amp;lt;/xs:complexType&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;xs:complexType name="addressListtype"&amp;gt;&lt;br/&gt;  &amp;lt;xs:sequence&amp;gt;&lt;br/&gt;    &amp;lt;xs:element name="person" type="persontype" maxOccurs="unbounded"/&amp;gt;&lt;br/&gt;  &amp;lt;/xs:sequence&amp;gt;&lt;br/&gt;&amp;lt;/xs:complexType&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;xs:element name="addressList" type="addressListtype"/&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;/xs:schema&amp;gt;&lt;br/&gt; &lt;/div&gt;</description><pubDate>Tue, 11 Mar 2008 12:55:00 GMT</pubDate></item></channel></rss>