Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace rules are not defined in XML #69

Closed
jmccrae opened this issue Dec 12, 2023 · 3 comments · Fixed by #75
Closed

Whitespace rules are not defined in XML #69

jmccrae opened this issue Dec 12, 2023 · 3 comments · Fixed by #75
Assignees
Labels
bug Something isn't working editorial module affects only modules serialization affects only one or more serializations but not the core or module data models

Comments

@jmccrae
Copy link
Contributor

jmccrae commented Dec 12, 2023

Whitespace rules in the XML are not clearly defined. For example consider this

                <exampleTranslation>
                    <text>
                            Koroner <collocateMarker lemma="provést">provedl</collocateMarker>
                            <headwordMarker>pitvu</headwordMarker>.
                    </text>
                </exampleTranslation>

How do we know that the whitespace is a single character between 'provedl' and 'pitvu', while the whitespace before 'Koronoer' and after '.' is not part of the translation?

Blocking implementation of #61

@jmccrae jmccrae added bug Something isn't working editorial module affects only modules labels Dec 12, 2023
@jmccrae
Copy link
Contributor Author

jmccrae commented Dec 12, 2023

Related is is the use of labels in collocateMarkers for which there is no example, but the whitespace rules around labels should be considered too

<collocateMarker>
   This is a collocate marker
   <label tag="foo"/>  <!-- is the whitespace part of the collocate marker? -->
</collocateMarker>

@DavidFatDavidF DavidFatDavidF added the serialization affects only one or more serializations but not the core or module data models label Dec 12, 2023
@jmccrae jmccrae added this to the 1st public review milestone Dec 12, 2023
@DavidFatDavidF
Copy link
Contributor

Decision Dec 12 meeting:
Explain whitespace handling in XML serialization intro
Introduce whitespace attribute on the affected elements (consider defaults)
Review xml whitespace implementation in next meeting

@michmech
Copy link
Contributor

michmech commented Jan 4, 2024

  • I have added a paragraph to the “design principles” section (at the start of the XML serialization section) which states that whitespace should always be collapsed (which includes removing leading and trailing whitespace) unless otherwise stated.
  • On each XML element that can take inline markup, I have “otherwise stated” that whitespace inside it should be preserved.
  • I have updated the examples (in the “Examples” section) to not contradict that.

Will close automatically when pull request #75 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working editorial module affects only modules serialization affects only one or more serializations but not the core or module data models
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants