Skip to content
Snippets Groups Projects
Commit b1fa427b authored by Ladislav Lhotka's avatar Ladislav Lhotka
Browse files

Add tools directory with XSLT and RELAX NG.

parent b9b5cd92
Branches
Tags
No related merge requests found
*.rnc
.PHONY: all clean
all: yin-html.rnc
%.rnc: %.rng
trang -I rng -O rnc $< $@
clean:
rm -f *.rnc
<?xml version="1.0" encoding="utf-8"?>
<!-- Program name: yin-html.rng
Copyright © 2013 by Ladislav Lhotka, CZ.NIC <lhotka@nic.cz>
RELAX NG schema for YIN with extensions for HTML markup.
NOTE:
This schema extends yin.rng by adding support for the following
non-standard YIN extension:
Arguments of 'contact', 'description', 'organization' and 'reference'
(wrapped in <text>) may contain the following HTML elements in the
"http://www.w3.org/1999/xhtml" namespace:
<html:p> - a paragraph of text
<html:ul> - unordered list
<html:ol> - ordered list
<html:p> elements may, apart from text, also contain empty
<html:br/> elements that cause an unconditional line break.
List elements must contain one or more <html:li> elements
representing list items with text and <html:br/> elements.
A <text> element may also have the xml:id attribute and contain the
XInclude element <xi:include>.
==
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
ns="urn:ietf:params:xml:ns:yang:yin:1"
xmlns:dc="http://purl.org/dc/terms"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<dc:title>RELAX NG Schema for YIN with HTML extensions</dc:title>
<dc:creator>Ladislav Lhotka</dc:creator>
<dc:date>2013-11-04</dc:date>
<dc:subject>YIN, XML syntax for YANG, HTML</dc:subject>
<dc:identifier>urn:ietf:params:xml:ns:yang:yin:1</dc:identifier>
<dc:description>
RELAX NG schema defines grammar for data models expressed in YIN,
an XML syntax equivalent to YANG, with extensions that enable HTML
markup in text-like contents.
</dc:description>
<include href="yin.rng"/>
<define name="text-content" combine="choice">
<optional>
<attribute name="xml:id">
<data type="ID"/>
</attribute>
</optional>
<oneOrMore>
<choice>
<element name="html:p">
<ref name="html-inline-content"/>
</element>
<element name="html:ul">
<ref name="html-list-content"/>
</element>
<element name="html:ol">
<ref name="html-list-content"/>
</element>
<element name="xi:include">
<attribute name="href">
<data type="anyURI"/>
</attribute>
<optional>
<attribute name="xpointer"/>
</optional>
</element>
</choice>
</oneOrMore>
</define>
<define name="html-inline-content">
<!-- This may be extended in the future -->
<mixed>
<zeroOrMore>
<element name="html:br">
<empty/>
</element>
</zeroOrMore>
</mixed>
</define>
<define name="html-list-content">
<oneOrMore>
<element name="html:li">
<ref name="html-inline-content"/>
</element>
</oneOrMore>
</define>
</grammar>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment