-
Notifications
You must be signed in to change notification settings - Fork 2
Begin recognising elements and attributes #1
Conversation
tests/cases/aff-alternatives.xml
Outdated
<?xml-model href="../jats.rng" schematypens="http://relaxng.org/ns/structure/1.0"?> | ||
<?xml-model href="../../support.sch" schematypens="http://purl.oclc.org/dsdl/schematron"?> | ||
<?expected-error line="7" message="<aff-alternatives> is ignored." node="/aff-alternatives"?> | ||
<?expected-error line="8" message="<aff> is ignored." node="//aff"?> |
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.
Ideally I'd like to not flag children of sub-elements, but need to be careful with mixed content (they're not necessarily ignored in that case).
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.
Could separate block and inline elements, and only check children of the latter.
tests/cases/count.xml
Outdated
<?xml-model href="../jats.rng" schematypens="http://relaxng.org/ns/structure/1.0"?> | ||
<?xml-model href="../../support.sch" schematypens="http://purl.oclc.org/dsdl/schematron"?> | ||
<?expected-error message="@count-type is ignored."?> | ||
<?expected-error message="@count is ignored."?> |
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'd like to be able to not flag attributes on ignored elements.
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.
Had a try, but can't get it to work.
support.sch
Outdated
<assert test=" | ||
name()='article' | ||
"> | ||
<<name/>> is ignored. |
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.
what would be an example of an element that is not ignored
(not implemented and hence won't be picked up by anything in browser
) but should actually be forbidden? e.g. a variant for article-title
that we want to avoid in order to favor other alternatives
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 don't think we ever forbid any JATS (this isn't validation); if you want to do something that we don't support then you can use configuration or code to add support for it, or you change your XML to match what is supported.
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.
Might be a few things we mandate though, like there must be a <title-group>
in the <article-meta>
.
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xml-model href="../../jats.rng" schematypens="http://relaxng.org/ns/structure/1.0"?> | ||
<?xml-model href="../../../support.sch" schematypens="http://purl.oclc.org/dsdl/schematron"?> | ||
<?expected-error message="@article-type is ignored."?> |
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.
Since the attribute is a node, we should be able to include a node
/line
. But the location
returned in the SVRL doesn't include proper XPath (so no details of which element the attribute is on):
<svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl" title="" schemaVersion="">
<svrl:active-pattern id="attribute-whitelist" name="attribute-whitelist"/>
<svrl:fired-rule context="@*"/>
<svrl:failed-assert test="name()='xml:lang'" location="/@article-type">
<svrl:text>
@article-type is ignored.
</svrl:text>
</svrl:failed-assert>
<svrl:active-pattern id="element-whitelist" name="element-whitelist"/>
<svrl:fired-rule context="*"/>
<svrl:fired-rule context="*"/>
<svrl:failed-assert test="name()='article'" location="/article/front">
<svrl:text>
<front> is ignored.
</svrl:text>
</svrl:failed-assert>
<svrl:fired-rule context="*"/>
<svrl:failed-assert test="name()='article'" location="/article/front/article-meta">
<svrl:text>
<article-meta> is ignored.
</svrl:text>
</svrl:failed-assert>
</svrl:schematron-output>
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.
Opened Schematron/schematron#81.
This adds support for
<article>
and@xml:lang
, and denies everything else.It includes tests for every JATS element.