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

feat: capability for XML's normalizedString #114

Closed
jkowalleck opened this issue Jun 24, 2024 · 3 comments · Fixed by #119
Closed

feat: capability for XML's normalizedString #114

jkowalleck opened this issue Jun 24, 2024 · 3 comments · Fixed by #119
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jkowalleck
Copy link
Collaborator

Feature request

Implement a capability (decorator) to mark class properties as normalizedString for XML.
Only when this marker is set:

  • on serializing to XML: replace special characters by space ( )
  • on deserializing to XML: replace special characters by space ( )

why both? Because the values should not have been in the XML in the first place!
so they must not appear after reading, and they must not appear after writing.

Background

XSD http://www.w3.org/2001/XMLSchema - which defines normalizedString as follows:

<xs:simpleType name="normalizedString" id="normalizedString">
  <xs:annotation>
    <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#normalizedString"/>
  </xs:annotation>
  <xs:restriction base="xs:string">
    <xs:whiteSpace value="replace" id="normalizedString.whiteSpace"/>
  </xs:restriction>
</xs:simpleType>

normalizedString represents white space normalized strings. The ·value space· of normalizedString is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The ·lexical space· of normalizedString is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The ·base type· of normalizedString is string.

@jkowalleck jkowalleck added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jun 24, 2024
@jkowalleck
Copy link
Collaborator Author

similar to #115

@jkowalleck
Copy link
Collaborator Author

solution as done in TS?JS CycloneDX/cyclonedx-javascript-library#1116

@jkowalleck
Copy link
Collaborator Author

i started working on this, via #119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant