Skip to content

Refactor the XMLInputBase class#899

Merged
kmokstad merged 1 commit into
OPM:masterfrom
kmokstad:xml-refactor
Jul 8, 2026
Merged

Refactor the XMLInputBase class#899
kmokstad merged 1 commit into
OPM:masterfrom
kmokstad:xml-refactor

Conversation

@kmokstad

@kmokstad kmokstad commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Also fixing include of files with more than one top-level tag (as before the tinyxml2 port).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Refactors XMLInputBase’s XML loading/parsing flow and updates the include-expansion logic to correctly handle included XML files that contain multiple top-level elements (a behavior regression after the tinyxml2 port).

Changes:

  • Reworked include processing via an XMLVisitor that injects all top-level elements from included XML files.
  • Simplified prioritized-tag handling in readXML() by inlining the logic and centralizing parse logging/error reporting.
  • Updated unit test and fixtures to cover multiple top-level tags in included files.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/SIM/XMLInputBase.h Header cleanup and doc updates; removed now-unneeded priority helper declaration.
src/SIM/XMLInputBase.C Refactored XML load/parsing, implemented updated include expansion, and reorganized priority parsing.
src/SIM/Test/TestXMLInputBase.C Updated test helper and expectations for include behavior.
src/SIM/Test/included2.xml Fixture extended to contain multiple top-level elements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/SIM/XMLInputBase.C Outdated
Comment thread src/SIM/XMLInputBase.C Outdated
Comment thread src/SIM/XMLInputBase.C Outdated
Comment thread src/SIM/XMLInputBase.C Outdated
Comment thread src/SIM/Test/TestXMLInputBase.C Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

Comment thread src/SIM/XMLInputBase.C Outdated
Comment thread src/SIM/XMLInputBase.C Outdated
Comment thread src/SIM/XMLInputBase.C
Comment thread src/SIM/XMLInputBase.C
Comment thread src/SIM/XMLInputBase.C Outdated
Comment thread src/SIM/Test/TestXMLInputBase.C Outdated
Comment thread src/SIM/XMLInputBase.C

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread src/SIM/XMLInputBase.h
with more than one top-level tag (as before the tinyxml2 port).
@kmokstad

kmokstad commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

jenkins build this with downstreams please

@kmokstad kmokstad merged commit f0deb46 into OPM:master Jul 8, 2026
1 check passed
@kmokstad kmokstad deleted the xml-refactor branch July 8, 2026 14:39
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.

2 participants