After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 142359 - [enhancement] Support the parsing of a string using a node context
[enhancement] Support the parsing of a string using a node context
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal enhancement
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks: 142358
 
 
Reported: 2004-05-11 18:08 UTC by Jean-Marc Desperrier
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jean-Marc Desperrier 2004-05-11 18:08:41 UTC
XML encryption define the types 'http://www.w3.org/2001/04/xmlenc#Content' and
'http://www.w3.org/2001/04/xmlenc#Element' for encrypted data.

When using those types, a part of an xml document, either a node or it's
content, can be encrypted and later decrypted, the encrypted content replacing
the original node or node content with a single EncryptedData node, and the
decrypted content replacing the EncryptedData node back with the original content.

The original result of the decryption is a string that must be parsed to
reinsert it back in the original document. This string is an xml fragment that
may in many case not be parsable without the context of the original node.

To make it possible to handle this case efficiently and safely, it is desirable
to add the possibility to parse a substring within a node context to the libxml2
API.
Comment 1 Daniel Veillard 2004-05-13 18:00:35 UTC
To some extend xmlParseBalancedChunkMemory() from parser.h does what
you want, just that the parser context need to be prepared with the
current document set and probably the hierarchy of parent nodes.

Daniel
Comment 2 Daniel Veillard 2004-08-16 00:42:04 UTC
I have just commited support for such a new function:

xmlParserErrors
xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen,
                      int options, xmlNodePtr *lst);

which does just this. It should handle namespaces fine, basic tests seems
okay so far, please give it a try.
The only doubt I have is about adding error reporting, otherwise it should be
fine I think.

Daniel
Comment 3 Daniel Veillard 2004-08-31 08:54:47 UTC
I think this is part of libxml2-2.6.12,

Daniel
Comment 4 Daniel Veillard 2004-09-30 11:51:56 UTC
  The release of libxml2-2.6.14 should fix this,
                                                                                
   thanks,
                                                                                
Daniel