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

Schema now uses ENTITY definitions for readability and maintainability #99

Open
paulhiggs opened this issue May 13, 2021 · 0 comments
Open
Labels
Future Something for the 'next edition'

Comments

@paulhiggs
Copy link
Collaborator

paulhiggs commented May 13, 2021

The 5th edition schema introduced an entity definition block to make regular expressions easir to read. XML entities function in a similar manner to C/C+ MACROs - the provide an inline replacement of the label for the value, thus

<xs:simpleType name="CodecsType">
	<xs:restriction base="xs:string">
		<xs:pattern value="[a-zA-Z\-]+'[a-zA-Z]{1,8}(=[a-zA-Z]{1,8})*'(%[0-9A-F]{2}|[a-zA-Z0-9!#\\$\^_\-\+\{\}\|\.`~&#038;])+(.(%[0-9A-F]{2}|[a-zA-Z0-9!#\\$\^_\-\+\{\}\|\.`~&#038;])+)*(,(%[0-9A-F]{2}|[a-zA-Z0-9!#\\$\^_\-\+\{\}\|\.`~&#038;])+(.(%[0-9A-F]{2}|[a-zA-Z0-9!#\\$\^_\-\+\{\}\|\.`~&#038;])+)*)*">
			<xs:annotation>
				<xs:documentation>RFC6381 fancy-list</xs:documentation>
			</xs:annotation>
		</xs:pattern>
		<xs:pattern value="[a-zA-Z0-9!#\\$%\^\*_\-\+\{\}\|'\.`~&#038;]+(,[a-zA-Z0-9!#\\$%\^\*_\-\+\{\}\|'\.`~&#038;]+)*">
			<xs:annotation>
				<xs:documentation>RFC6381 simp-list</xs:documentation>
			</xs:annotation>
		</xs:pattern>
	</xs:restriction>
</xs:simpleType>

becomes

	<xs:simpleType name="CodecsType">
		<xs:restriction base="xs:string">
			<xs:pattern value="&charset;&squote;&language;&squote;&id_list;">
				<xs:annotation>
					<xs:documentation>RFC6381 fancy-list without enclosing double quotes</xs:documentation>
				</xs:annotation>
			</xs:pattern>
			<xs:pattern value="&id_simple;(,&id_simple;)*">
				<xs:annotation>
					<xs:documentation>RFC6381 simp-list without enclosing double quotes</xs:documentation>
				</xs:annotation>
			</xs:pattern>
		</xs:restriction>
	</xs:simpleType>

We should look (perhaps for 6th edition) to document entity values in an annex for use throughout the specification

@paulhiggs paulhiggs changed the title Schema now uses ENTITY defintions for readability and maintainability Schema now uses ENTITY definitions for readability and maintainability May 13, 2021
@paulhiggs paulhiggs added the Future Something for the 'next edition' label May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Future Something for the 'next edition'
Projects
None yet
Development

No branches or pull requests

1 participant