bug report
José Ronquillo
josrr at ymail.com
Thu Feb 11 21:30:54 UTC 2016
Sorry, this was my fault. I should call "with-open-file" using "if-exists: supersede". Thanks for the quick response.
On Thursday, February 11, 2016 3:14 PM, Alexandre Rademaker <arademaker at gmail.com> wrote:
Hi José,
I couldn't reproduce the problem. How did you install CXML and CXML-STP? I used the last version from quicklisp running SBCL on a Mac OS:
CL-USER> *features*
(:CL-PPCRE :RUNE-IS-CHARACTER :SWANK :QUICKLISP :ASDF-PACKAGE-SYSTEM :ASDF3.1
:ASDF3 :ASDF2 :ASDF :OS-MACOSX :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE
:64-BIT :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS :BSD
:C-STACK-IS-CONTROL-STACK :COMMON-LISP :COMPARE-AND-SWAP-VOPS
:COMPLEX-FLOAT-VOPS :CYCLE-COUNTER :DARWIN :DARWIN9-OR-BETTER :FLOAT-EQL-VOPS
:FP-AND-PC-STANDARD-SAVE :GENCGC :IEEE-FLOATING-POINT :INLINE-CONSTANTS
:INODE64 :INTEGER-EQL-VOP :INTERLEAVED-RAW-SLOTS :LINKAGE-TABLE :LITTLE-ENDIAN
:MACH-EXCEPTION-HANDLER :MACH-O :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS
:OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN
:OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T :PACKAGE-LOCAL-NICKNAMES
:PRECISE-ARG-COUNT-ERROR :RAW-INSTANCE-INIT-VOPS :SB-CORE-COMPRESSION :SB-DOC
:SB-EVAL :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-LOCATIONS :SB-TEST
:SB-THREAD :SB-UNICODE :SBCL :STACK-ALLOCATABLE-CLOSURES
:STACK-ALLOCATABLE-FIXED-OBJECTS :STACK-ALLOCATABLE-LISTS
:STACK-ALLOCATABLE-VECTORS :STACK-GROWS-DOWNWARD-NOT-UPWARD :SYMBOL-INFO-VOPS
:UD2-BREAKPOINTS :UNIX :UNWIND-TO-FRAME-AND-CALL-VOP :X86-64)
CL-USER> (let ((document (with-open-file (stream (merge-pathnames #P"content.xml")
:direction :input
:element-type '(unsigned-byte 8))
(cxml:parse stream (stp:make-builder)))))
(with-open-file (salida #P"saida.xml" :direction :output :if-exists :supersede)
(stp:serialize document (cxml:make-character-stream-sink salida))))
#<SB-SYS:FD-STREAM for "file /Users/arademaker/Downloads/saida.xml" {10050733C3}>
The saida.xml file is fine.
$ xmllint -noout saida.xml
I suggest post this kind of questions in sites like http://stackoverflow.com
Best,
Alexandre Rademaker
http://arademaker.github.com/
http://researcher.ibm.com/person/br-alexrad
On Thu, Feb 11, 2016 at 5:48 PM, José Ronquillo <josrr at ymail.com> wrote:
Hello CXML developers.
I want to report a bug that I reached working with an ODF (Open Document Format) file, more precisely with the content.xml file that is part of it.
The bug has occurred when I try to serialize a document that is just parsed, you can reproduce it with this code:
(let ((document (with-open-file (stream (merge-pathnames #P"content.xml")
:direction :input
:element-type '(unsigned-byte 8))
(cxml:parse stream (stp:make-builder)))))
(with-open-file (salida #P"1.xml" :direction :output :if-exists :overwrite)
(stp:serialize document (cxml:make-character-stream-sink salida))))
The output 1.xml file is incorrect. Check the second line, columna 91841, here with some context:
<table:named-expressions/></office:spreadsheet></office:body></office:document-content>le-row table:style-name="ro1"><table:table-cell table:number-columns-repeated="1024"/></table:table-row></table:table><table:named-expressions/></office:spreadsheet></office:body></office:document-content>ing" table:number-columns-spanned="1" table:number-rows-spanned="3"><text:p>DICIEMBRE </text:p></table:table-cell>
The original content.xml file is attached.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cxml-devel/attachments/20160211/2c5b0e9a/attachment-0001.html>
More information about the cxml-devel
mailing list