-
Notifications
You must be signed in to change notification settings - Fork 379
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
CLDR-15990 Generate .xsd and .md from .dtd #3108
Conversation
- originally unicode-org#2350 - also creates .md files from the .dtd for aid in spec updating (cherry picked from commit cb6c8bf4928bd219e49620e355f11c67df360e34) (cherry picked from commit 4fd3cef8f67bc2fd1df0fe17b66dd4f772b377ca) Co-authored-by: Marc Durdin <marc@durdin.net>
- also add test in workflow (test is advisory. does not fail) - ignore xml.xsd as it is not usefulx
3e9049e
to
89ef330
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
common/dtd/ldml.xsd
Outdated
</xs:element> | ||
<!-- @METADATA --> | ||
<!-- @DEPRECATED --> | ||
<!-- @METADATA --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what does it mean to have the two successive @METADATA/@DEPRECATED
annotations here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are now removed.
common/dtd/ldmlSupplemental.xsd
Outdated
</xs:attribute> | ||
</xs:complexType> | ||
</xs:element> | ||
<!-- @DEPRECATED --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still confused about how these annotations are being used. Is there a mapping from the sequence of annotations to items inside the previous block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The annotations aren't used, I've now removed them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It all looks reasonable, but I did not check the xsd files in detail, I assume they are generated. I have a a general question about what the annotations like @deprecated mean in these xsd files and how they are used, but that is not blocking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looks like the xsd is tossing in all the annotations way after what they apply to. Also, the description for the PR needs much more information about what is being done and why.
This conversion doesn’t handle annotations yet. So it’s not suitable for
replacing CLDR validation. However it is useful for clients checking data
that’s already from CLDR. And I can keep iterating it. I’d need to mutate
the xsd based on dtd data.
|
They are just comments. It (the off the shelf dtd to xsd converter) is probably grouping them to the item they follow. Perhaps a step would be to just remove the annotation comments.
Makes sense. Thanks. |
- separated the markdown and xsd generation - cleaned up paths and output
ping… can i get a review on this? it now removes the annotation comments. |
…e-org#3108)" This reverts commit 76c78fd.
CLDR-15990
GenerateDtd
, which is normally run automatically as part of BRS, to do two things:.xsd
file for each.dtd
with XML Schema for the DTD files. These are checked into the repository and intended to be released with CLDR..md
file indocs/ldml/dtd2md/
with a shell that can be copied into the specification for each element. This directory is.gitignored
and the resulting files are not added to the repository.Updates
XMLValidator
to add a--schema=
option allowing it to be used to validate against a schema.Note that DTD @-annotations such as
@MATCH
are not supported by the converter at present, so such comments are removed from the .xsdCLDR-15990 generate .xsd from .dtd #2350 is the original PR
Example of the generated
.md
content:ALLOW_MANY_COMMITS=true