Menu

#3387 imm: old Simple API for XML interface is deprecated

5.27.01
fixed
None
enhancement
imm
-
minor
False
2026-03-19
2025-11-11
No

Error log for API xmlSAXUserParseFile()

src/imm/immloadd/imm_loader.cc: In function 'int loadImmXML(std::__cxx11::string, std::__cxx11::string, SaUint32T*)':

src/imm/immloadd/imm_loader.cc:2046:68: error: 'int xmlSAXUserParseFile(xmlSAXHandlerPtr, void*, const char*)' is deprecated [-Werror=deprecated-declarations]

   error = xmlSAXUserParseFile(&my_handler, &state, filename.c_str());
                                                                    ^

In file included from src/imm/immloadd/imm_loader.cc:26:0:

/usr/include/libxml2/libxml/parser.h:1005:3: note: declared here

   xmlSAXUserParseFile (xmlSAXHandlerPtr sax,

   ^~~~~~~~~~~~~~~~~~~

It’s deprecated because:

  • It uses global parser state (not thread-safe).
  • It’s less flexible than the newer xmlReader and xmlParserCtxt APIs.
  • It doesn’t handle modern XML features (entities, encodings) as cleanly.

Patch reference attached.

1 Attachments

Discussion

  • Thang Duc Nguyen

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -Error log
    +Error log for API xmlSAXUserParseFile()
     ~~~
     src/imm/immloadd/imm_loader.cc: In function 'int loadImmXML(std::__cxx11::string, std::__cxx11::string, SaUint32T*)':
    
     
  • Khuong Ba Le

    Khuong Ba Le - 2025-11-11
    • status: unassigned --> assigned
    • assigned_to: Khuong Ba Le
     
  • Gary Lee

    Gary Lee - 2026-02-27
    • Milestone: 5.26.02 --> 5.27.01
     
  • Khuong Ba Le

    Khuong Ba Le - 2026-03-19
    • status: assigned --> fixed
     
  • Khuong Ba Le

    Khuong Ba Le - 2026-03-19

    commit 6b74478d0dfd4833cc6ab45b8e7360fa138546e0 (HEAD -> develop, origin/develop)
    Author: khuonglb khuong.b.le@endava.com
    Date: Mon Mar 16 16:27:12 2026 +0700

    imm: old Simple API for XML interface is deprecated [#3387]
    
    xmlSAXUserParseFile() is deprecated. Replace it with a wrapper based on
    xmlCreateIOParserCtxt() to ensure safer and more controlled parsing.
    
     

Log in to post a comment.

MongoDB Logo MongoDB