# XはてなML: Text Module
# 参照: http://d.hatena.ne.jp/help#editrule
# XHTML の要素が使えるものはそれを使う。
# リスト: ul, ol, dl
# 引用: blockquote
# 整形済みテキスト: pre
# 脚注は別途定義
# TeX 数式: (不等号などは要エスケープ)
tex = element tex { attribute exp { text }, empty }
Inline.class |= tex
# キーワード参照: はてな
kw = element kw {
attribute g { text }?, # グループ内キーワード
text
}
Inline.class |= kw
# URL参照: http://www.horobi.com/xml/XHatenaML/
url = element url { xsd:anyURI } #TBD:スキーム制限 http:, https:, ftp:, mailto:
Inline.class |= url
## その他各種参照: ref 要素
# ASIN/ISBN参照:
#
#
ref-asin-isbn = element ref {
( attribute asin { text } | attribute isbn { text } ),
attribute image { "small" | "medium" | "large" }?,
empty
}
Inline.class |= ref-asin-isbn
# 日記/グループ/アンテナ参照:
ref-dga = element ref {
(( # 日記の参照
attribute g { text }?, # グループ
attribute id { text }, # id
attribute ref { text }?
) | ( # グループ/アンテナの参照
attribute g | a { text }
)),
empty
}
Inline.class |= ref-dga
# 検索式(search formula)/検索結果参照: はてな
search = element sf { #
attribute type { "google" | "amazon" },
text
}
Inline.class |= search
#TBD: XHTML の href,src,cite 属性での各種参照