Как создать новую сущность со схемой RELAX NG в DocBook V5.0

С DocBook V4.x и DTD я мог бы создать сущность с:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [

<!ENTITY mdash   "&#8212;">

]>
<article>
...
<title>Em dash</title>

<para>The em dash is perhaps the most versatile punctuation mark.
Depending on the context, the em dash can take the place of commas,
parentheses, or colons&mdash;in each case to slightly different effect.</para>
...
</article>

Как я могу сделать то же самое с DocBook V5.0, используя схему RELAX NG?:

<?xml version='1.0' encoding='utf-8'?>
<article xmlns='http://docbook.org/ns/docbook' version='5.0' xml:lang='en'>
...
<title>Em dash</title>
<para>The em dash is perhaps the most versatile punctuation mark.
Depending on the context, the em dash can take the place of commas,
parentheses, or colons&mdash;in each case to slightly different effect.</para>

1 ответ

Вы не можете определить общие сущности, используя RELAX NG. Сущности - вещь DTD. Вам нужно либо использовать внутреннее подмножество DTD (как в первом примере кода), либо просто использовать инструменты, жестко закодированные для распознавания объектов (например, веб-браузеры).

Другие вопросы по тегам