OSDN Git Service

Fix xmlelement() to initialize libxml correctly before using it, and to avoid
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 5 Nov 2007 22:23:07 +0000 (22:23 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 5 Nov 2007 22:23:07 +0000 (22:23 +0000)
commit85f807d78250fa8bade5ac9da32dfa21b92cb044
tree11c58847a66e58a6fb1893973f0694198fa6fec2
parentbcb3852c3334e089b5546dccdaa33f12914f5337
Fix xmlelement() to initialize libxml correctly before using it, and to avoid
assuming that evaluation of its input expressions won't change the state of
libxml.  This requires refactoring xml_init() to not call xmlInitParser(),
since now not all of its callers want that.  I also tweaked things to avoid
repeated execution of one-time-only tests inside xml_init(), though this is
mostly for clarity rather than in hopes of saving any noticeable amount of
runtime.  Per report from Sheikh Amjad and subsequent discussion.
In passing, fix a couple of inadequately schema-qualified queries.
src/backend/utils/adt/xml.c