Re: [xml] patch for xmlwriter



On Mon, Feb 16, 2004 at 05:29:09PM +0100, Mickautsch, Alfred wrote:
Hello,

I have a new patch for the xmlwriter (made against version 2.6.6).
Here is what I did:
- added functions xmlTextWriterStartComment and xmlTextWriterEndComment
  so that there is a "xmltextWriterStart..." and a
  "xmltextWriterEnd..." for each xml entity
- added new writer state XML_TEXTWRITER_COMMENT
- implemented the function xmlOutputBufferWriteBinHex
- removed the writing of the '\n' at the end of the output from
  xmlOutputBufferWriteBase64
- bugfix in xmlTextWriterStartDTD (bug reported by Trey Gruel
  [drathos-xml nightmoose net] on 2004.01.19 22:25)
- changed the type of the second parameter of
  xmlTextWriterSetIndentString from 'xmlChar *' to 'const xmlChar *'
- the rest of the diffs were caused by my indent (with the following
  options: -bad -bap -bbb -bli4 -br -ce -brs -cs -i4 -l75 -lc75 -nut \
  -sbi4 -psl -saf -sai -saw -sbi4 -ss -sc -cdw -cli4 -npcs -nbc)

  Okay, applied. But I didn't commited because this generate 
a change in behaviour for the xmlWriter.c example which "make test"
triggers:
 < <EXAMPLE><!--This is a comment with special chars: <äöü>--><ORDER version="1.0" xml:lang="de"><!--This is 
another comment with special chars: 
<äöü>--><HEADER><X_ORDER_ID>0000053535</X_ORDER_ID><CUSTOMER_ID>1010</CUSTOMER_ID><NAME_1>Müller</NAME_1><NAME_2>Jörg</NAME_2></HEADER><ENTRIES><ENTRY><ARTICLE>&lt;Test&gt;</ARTICLE><ENTRY_NO>10</ENTRY_NO></ENTRY><ENTRY><ARTICLE>&lt;Test
 2&gt;</ARTICLE><ENTRY_NO>20</ENTRY_NO></ENTRY></ENTRIES><FOOTER><TEXT>This is a 
text.</TEXT></FOOTER></ORDER></EXAMPLE>
---
<EXAMPLE><!--This is a comment with special chars: &lt;äöü&gt;--><ORDER version="1.0" 
xml:lang="de"><!--This is another comment with special chars: 
&lt;äöü&gt;--><HEADER><X_ORDER_ID>0000053535</X_ORDER_ID><CUSTOMER_ID>1010</CUSTOMER_ID><NAME_1>Müller</NAME_1><NAME_2>Jörg</NAME_2></HEADER><ENTRIES><ENTRY><ARTICLE>&lt;Test&gt;</ARTICLE><ENTRY_NO>10</ENTRY_NO></ENTRY><ENTRY><ARTICLE>&lt;Test
 2&gt;</ARTICLE><ENTRY_NO>20</ENTRY_NO></ENTRY></ENTRIES><FOOTER><TEXT>This is a 
text.</TEXT></FOOTER></ORDER></EXAMPLE>

  < and > are now escaped in the output. It's probably not something you
really intended, so I'm waiting for a possible fix before commiting it.
Regression tests are good ... we need more especially for the xmlWriter.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]