Skip to content

XML PARSE#263

Open
ddeclerck wants to merge 3 commits intoOCamlPro:gitside-gnucobol-3.xfrom
ddeclerck:xml_parse
Open

XML PARSE#263
ddeclerck wants to merge 3 commits intoOCamlPro:gitside-gnucobol-3.xfrom
ddeclerck:xml_parse

Conversation

@ddeclerck
Copy link
Copy Markdown
Collaborator

Note: initial commit from Chuck, fixes to come

Copy link
Copy Markdown
Collaborator

@GitMensch GitMensch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a quick note for the first iteration; note that Chucks changes are based on mlio from August 2025, so the "real" version may be easier to get by checking out a previous commit, then replace the file and commit locally, then fetch the newer commit with rebase-merging

Comment thread tests/testsuite.src/run_ml.at Outdated
Comment thread libcob/mlio.c
Comment thread libcob/mlio.c
@GitMensch
Copy link
Copy Markdown
Collaborator

GitMensch commented Dec 5, 2025

@chuck-haatvedt passed me the newest file (you may do a diff to add a changelog entry) which looks much better concerning libxml version compat. It is from November 14th: mlio.c with a note

that file was built / tested on
libcob (branches/gnucobol-3.x r5603M) 3.3-dev.5603

Copy link
Copy Markdown
Collaborator

@GitMensch GitMensch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for inspecting / working on necessary changes.
I think we can have those in at least a second commit :-)

Comment thread libcob/mlio.c Outdated
Comment thread libcob/mlio.c Outdated
Comment thread libcob/mlio.c Outdated
Comment thread libcob/mlio.c Outdated
Comment thread libcob/mlio.c Outdated
Comment thread libcob/mlio.c Outdated
Comment thread libcob/mlio.c Outdated
Comment thread libcob/mlio.c Outdated
Comment thread libcob/mlio.c Outdated
Comment thread libcob/mlio.c Outdated
This is work by Chuck Haatvedt edited by David Declerck.

	* mlio.c: modified to support xml parse with xmlss.
	  eliminated the xml_event_data structure and moved that data
	  into the xml_event structure. Created a new enum cob_xml_registers
	  and added it to the add_xml_event_data function. This function was
	  modified to update the xml_event structure. All of the context parser
	  callback functions were modified to use the add_xml_event_data function.
	  the cob_xml_parse and xml_parse functions were modified to support
	  the new end_of_input event required by xmlss. a new eof variable
	  was added to the xml_state structure so that the endDocument callback
	  function could be triggered by the parser in the xml_parse funtction.

	  TODO ==> logic needs to be added to support returning NATIONAL data
	  this needs to support the RETURNING NATIONAL phrase.
	* common.h: rename COB_XML_PARSE_XMLNSS into COB_XML_PARSE_XMLSS to match
	  the IBM option name
	* mlio.c [WITH_XML2]: Fix issues in XML PARSE handling most notably a use
	  after free error if the internal buffer needs to grow during the parsing.
	  Respect the high order half-word for exception XML-CODE.
	  Reduce the number of parsing states by removing useless ones,
	  and encode eof in these states.
	  Handle XML chunks with more than one recoverable error.
	  Trigger ON EXCEPTION code after EXCEPTION XML events.
	* parser.y: remove the CB_PENDING warning on XML PARSE but still warn for
	  untested XML PARSE RETURNING NATIONAL and XML PARSE VALIDATING.
	* typeck.c: remove invalid call to cob_check_based for XML-* builtin variable
	  length registers (like XML-TEXT)
	* codegen.c: remove the uninitialized and unused b_* field for XML-* builtin
	  variable length registers
@GBertholon
Copy link
Copy Markdown

GBertholon commented Apr 20, 2026

I am taking the responsibility for this PR on OCamlPro's behalf. I applied changes according to your comments and fixed several issues. @GitMensch: is this new version more satisfying ?

@GBertholon GBertholon requested a review from GitMensch April 20, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants