Skip to content

Commit 0889a5a

Browse files
David Waltermireaj-stein-nist
authored andcommitted
Added resource-fragment flag to link. (#1527)
Defined a constraint to validate the allowed characters for a fragment. Resolves #756.
1 parent 30fae9d commit 0889a5a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/metaschema/oscal_metadata_metaschema.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,10 @@
776776
<p>The <code>media-type</code> provides a hint about the content model of the referenced resource. A valid entry from the <a href="https://www.iana.org/assignments/media-types/media-types.xhtml">IANA Media Types registry</a> SHOULD be used.</p>
777777
</remarks>
778778
</flag>
779+
<define-flag name="resource-fragment" as-type="string">
780+
<formal-name>Resource Fragment</formal-name>
781+
<description>In case where the <code>href</code> points to a <code>back-matter/resource</code>, this value will indicate the URI <a href="https://www.rfc-editor.org/rfc/rfc3986#section-3.5">fragment</a> to append to any <code>rlink</code> associated with the resource. This value MUST be <a href="https://www.rfc-editor.org/rfc/rfc3986#section-2.1">URI encoded</a>.</description>
782+
</define-flag>
779783
<model>
780784
<define-field name="text" as-type="markup-line">
781785
<formal-name>Link Text</formal-name>
@@ -794,6 +798,11 @@
794798
<key-field target="@href" pattern="#(.*)"/>
795799
</index-has-key>
796800
<matches target=".[@rel=('reference') and not(starts-with(@href,'#'))]/@href" datatype="uri"/>
801+
<matches target="@resource-fragment" regex="(?:[0-9a-zA-Z-._~/?!$&amp;'()*+,;=:@]|%[0-9A-F][0-9A-F])+">
802+
<remarks>
803+
<p>This pattern is based on the fragment Augmented Backus-Naur form (ABNF) syntax provided in [RFC3986 section 3.5](https://www.rfc-editor.org/rfc/rfc3986#section-3.5). Uppercase alpha hex digits are required, which is the preferred normalized form defined in RFC3986.</p>
804+
</remarks>
805+
</matches>
797806
</constraint>
798807
<remarks>
799808
<p>To provide a cryptographic hash for a remote target resource, a local reference to a back matter <code>resource</code> is needed. The resource allows one or more hash values to be provided using the <code>rlink/hash</code> object.</p>

0 commit comments

Comments
 (0)