Skip to content

Commit

Permalink
Require xlink:href for link (fix #15)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomschr committed Nov 25, 2016
1 parent 741bafe commit 5360180
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
18 changes: 16 additions & 2 deletions geekodoc/rng/geekodoc5-flat.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ div {
# - - - -

}
div {
db.xlink.hrefreq.simple.link.attributes =
db.xlink.simple.type.attribute?
& db.xlink.href.attribute
& db.xlink.role.attribute?
& db.xlink.arcrole.attribute?
& db.xlink.title.attribute?
& db.xlink.show.attribute?
& db.xlink.actuate.attribute?
}
# Use a catalog entry to resolve this:
# include "http://docbook.org/xml/5.1/rng/docbook.rnc"
div {
Expand Down Expand Up @@ -10150,8 +10160,12 @@ div {
& db.variablelist.termlength.attribute?
db.warning.attlist = db.warning.role.attribute? & db.common.attributes
# ========= Changed attributes
db.link.attlist &=
db.xlink.simple.link.attributes & db.common.base.attributes

# Require xlink:href
db.link.attlist =
db.link.role.attribute?
& db.common.attributes
& db.xlink.hrefreq.simple.link.attributes
db.version.attribute =

## Specifies the DocBook version of the element and its descendants
Expand Down
19 changes: 18 additions & 1 deletion geekodoc/rng/geekodoc5.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ db.step.blocks =
# ----
}

div {
db.xlink.hrefreq.simple.link.attributes =
db.xlink.simple.type.attribute?
& db.xlink.href.attribute
& db.xlink.role.attribute?
& db.xlink.arcrole.attribute?
& db.xlink.title.attribute?
& db.xlink.show.attribute?
& db.xlink.actuate.attribute?
}

# Use a catalog entry to resolve this:
# include "http://docbook.org/xml/5.1/rng/docbook.rnc"
include "docbookxi.rnc"
Expand Down Expand Up @@ -947,7 +958,13 @@ include "docbookxi.rnc"
& db.common.attributes

#========= Changed attributes
db.link.attlist &= db.xlink.simple.link.attributes & db.common.base.attributes

# Require xlink:href
db.link.attlist =
db.link.role.attribute?
& db.common.attributes
& db.xlink.hrefreq.simple.link.attributes


db.version.attribute =
## Specifies the DocBook version of the element and its descendants
Expand Down

0 comments on commit 5360180

Please sign in to comment.