[xsd-users] bug fix in the streaming example

Erik Sjölund erik.sjolund at gmail.com
Tue May 4 08:43:21 EDT 2010


There seems to be a problem with name spaces in the streaming example.
The example program can't handle some valid input files.
For details see the terminal session in the attached file "terminal.txt".

What do you think about the attached patch?
cheers,
Erik Sjölund
-------------- next part --------------
user at linux:/tmp/xsd-git/xsd/examples/cxx/tree/streaming$ cp position.xml  position2.xml
user at linux:/tmp/xsd-git/xsd/examples/cxx/tree/streaming$ emacs position2.xml 
user at linux:/tmp/xsd-git/xsd/examples/cxx/tree/streaming$ xmllint -noout -schema position.xsd position2.xml
position2.xml validates
user at linux:/tmp/xsd-git/xsd/examples/cxx/tree/streaming$ xmllint -noout -schema position.xsd position.xml
position.xml validates
user at linux:/tmp/xsd-git/xsd/examples/cxx/tree/streaming$ ./driver position.xml 
id:   123
name: Lion's Head
type: rock
lat: -33.8569 lon: 18.5083
lat: -33.8568 lon: 18.5083
lat: -33.8568 lon: 18.5082
lat: -33.857 lon: 18.5083
lat: -33.8569 lon: 18.5084
lat: -33.857 lon: 18.5084
lat: -33.857 lon: 18.5082
lat: -33.8569 lon: 18.5082
user at linux:/tmp/xsd-git/xsd/examples/cxx/tree/streaming$ ./driver position2.xml 
terminate called after throwing an instance of 'xercesc_3_0::DOMException'
Aborted
user at linux:/tmp/xsd-git/xsd/examples/cxx/tree/streaming$ diff -u position.xml  position2.xml
--- position.xml	2010-05-04 11:57:13.000000000 +0200
+++ position2.xml	2010-05-04 13:53:24.000000000 +0200
@@ -8,23 +8,23 @@
 
 -->
 
-<op:object xmlns:op="http://www.codesynthesis.com/op"
+<object xmlns="http://www.codesynthesis.com/op"
 	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	   xsi:schemaLocation="http://www.codesynthesis.com/op position.xsd"
            id="123">
 
-  <header>
+  <header xmlns="">
     <name>Lion's Head</name>
     <type>rock</type>
   </header>
 
-  <position lat="-33.8569" lon="18.5083"/>
-  <position lat="-33.8568" lon="18.5083"/>
-  <position lat="-33.8568" lon="18.5082"/>
-  <position lat="-33.8570" lon="18.5083"/>
-  <position lat="-33.8569" lon="18.5084"/>
-  <position lat="-33.8570" lon="18.5084"/>
-  <position lat="-33.8570" lon="18.5082"/>
-  <position lat="-33.8569" lon="18.5082"/>
+  <position xmlns="" lat="-33.8569" lon="18.5083"/>
+  <position xmlns="" lat="-33.8568" lon="18.5083"/>
+  <position xmlns="" lat="-33.8568" lon="18.5082"/>
+  <position xmlns="" lat="-33.8570" lon="18.5083"/>
+  <position xmlns="" lat="-33.8569" lon="18.5084"/>
+  <position xmlns="" lat="-33.8570" lon="18.5084"/>
+  <position xmlns="" lat="-33.8570" lon="18.5082"/>
+  <position xmlns="" lat="-33.8569" lon="18.5082"/>
 
-</op:object>
+</object>
user at linux:/tmp/xsd-git/xsd/examples/cxx/tree/streaming$ git branch
  streaming_example
* master
user at linux:/tmp/xsd-git/xsd/examples/cxx/tree/streaming$ git checkout streaming_example
M	examples/cxx/tree/streaming/makefile
Switched to branch 'streaming_example'
user at linux:/tmp/xsd-git/xsd/examples/cxx/tree/streaming$ ./driver position2.xml 
id:   123
name: Lion's Head
type: rock
lat: -33.8569 lon: 18.5083
lat: -33.8568 lon: 18.5083
lat: -33.8568 lon: 18.5082
lat: -33.857 lon: 18.5083
lat: -33.8569 lon: 18.5084
lat: -33.857 lon: 18.5084
lat: -33.857 lon: 18.5082
lat: -33.8569 lon: 18.5082
user at linux:/tmp/xsd-git/xsd/examples/cxx/tree/streaming$ ./driver position.xml 
id:   123
name: Lion's Head
type: rock
lat: -33.8569 lon: 18.5083
lat: -33.8568 lon: 18.5083
lat: -33.8568 lon: 18.5082
lat: -33.857 lon: 18.5083
lat: -33.8569 lon: 18.5084
lat: -33.857 lon: 18.5084
lat: -33.857 lon: 18.5082
lat: -33.8569 lon: 18.5082
-------------- next part --------------
A non-text attachment was scrubbed...
Name: streaming_example_fix.patch
Type: text/x-diff
Size: 1357 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20100504/21345649/streaming_example_fix.bin


More information about the xsd-users mailing list