1 xml version 1 0 module Version 1

  • Slides: 30
Download presentation

1. 最初の雛型を書く <? xml version=“ 1. 0”? > <module. Version=“ 1. 0” relax. Core.

1. 最初の雛型を書く <? xml version=“ 1. 0”? > <module. Version=“ 1. 0” relax. Core. Version=“ 1. 0” xmlns=“http: //www. xml. gr. jp/2000/relax. Core”> <export> <interface label=“トップレベルにきてよい要素名1” /> <interface label=“トップレベルにきてよい要素名2” /> </export> ここにこれからRELAX文法の中身を書きます </module> n 例:トップレベルにはhtml要素だけがきてよい <? xml version=“ 1. 0”? > <module …> <export> <interface label=“html” /> </export> … </module>

occurs指定 n 例 n このrefに… n <element. Rule role=“body”> <ref label=“p” /> </element. Rule>

occurs指定 n 例 n このrefに… n <element. Rule role=“body”> <ref label=“p” /> </element. Rule> n n n 空 P PP PPPP なし × ○ × × ? ○ ○ × × occurs指定なし occurs=“? ” occurs=“+” occurs=“*” + × ○ ○ ○ * ○ ○

RELAXではできないこと n 次のような指定はうまくできません loginという要素の下には、user要素とpassword要素とdomain要素が必ず一 回登場しなくてはいけないが、しかしその順序はどうでもよい どうしてもやりたい人は <element. Rule role=“login”> <choice> <sequence> <ref label=“user” /><ref

RELAXではできないこと n 次のような指定はうまくできません loginという要素の下には、user要素とpassword要素とdomain要素が必ず一 回登場しなくてはいけないが、しかしその順序はどうでもよい どうしてもやりたい人は <element. Rule role=“login”> <choice> <sequence> <ref label=“user” /><ref label=“password” /><ref label=“domain” /> </sequence><sequence> <ref label=“user” /><ref label=“domain” /><ref label=“password” /> </sequence><sequence> <ref label=“password” /><ref label=“user” /><ref label=“domain” /> …