Skip to content

parallel sets: fix XML-invalid characters in set names - #1356

Merged
karlkleinpaste merged 1 commit into
crosswire:masterfrom
LAfricain:parallelsets-fix
Aug 1, 2026
Merged

parallel sets: fix XML-invalid characters in set names#1356
karlkleinpaste merged 1 commit into
crosswire:masterfrom
LAfricain:parallelsets-fix

Conversation

@LAfricain

Copy link
Copy Markdown
Contributor

Set names with spaces or other XML-special characters caused a parser error on startup when used as XML tag names (e.g. 'Short set' became <parallel_set_Short set> which is invalid XML).

Fix: automatically convert spaces to underscores when storing set names as XML keys, and convert back for display in the UI.

New helpers in settings.c:
name_to_key(name) - convert display name to XML key (space -> )
key_to_name(key) - convert XML key to display name (
-> space)

Fixes crash on startup when a parallel set name contains a space.

Set names with spaces or other XML-special characters caused a parser
error on startup when used as XML tag names (e.g. 'Short set' became
<parallel_set_Short set> which is invalid XML).

Fix: automatically convert spaces to underscores when storing set names
as XML keys, and convert back for display in the UI.

New helpers in settings.c:
  name_to_key(name) - convert display name to XML key (space -> _)
  key_to_name(key)  - convert XML key to display name (_ -> space)

Fixes crash on startup when a parallel set name contains a space.
@karlkleinpaste
karlkleinpaste merged commit 5a0a49c into crosswire:master Aug 1, 2026
7 checks passed
@karlkleinpaste

Copy link
Copy Markdown
Contributor

FYI I did an adjustment to convert your fprintf to XI_message.

Thanx. This is a very good feature.

@karlkleinpaste

Copy link
Copy Markdown
Contributor

There is still a problem. This may be a new difficulty since the initial PR, that is, caused by yesterday's fix. I'm not sure.

I have 3 parallel sets defined now.

    <parallel_set_names>Base,Short_set,No_OSHB</parallel_set_names>
    <parallel_set_Base>NET,NETnote,BSB,LXXNA28,ESV,NASB,NIV,NAB,NABnote,KJV,OSHB</parallel_set_Base>
    <parallel_set_current>No OSHB</parallel_set_current>
    <parallel_set_Short_set>NET,BSB,ESV,NASB,NIV</parallel_set_Short_set>
    <parallel_set_No_OSHB>NET,NETnote,BSB,LXXNA28,ESV,NASB,NIV,NAB,NABnote,KJV</parallel_set_No_OSHB>

But I can no longer edit them properly. Changing the pulldown does change which set is displayed for alteration.
1
2
3
4

In the detached parallel window, I can still select which set to display. But I can't alter those sets now.

@LAfricain

Copy link
Copy Markdown
Contributor Author

Ok I'm working on it. If you wouldn't mind, could you check if the other PR is okay and merge it?

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