2.4 ExternalID DoctypeDecl ExternalID

Size: px
Start display at page:

Download "2.4 ExternalID DoctypeDecl ExternalID

Transcription

1 WX-model ver scriptlet XHTML ( XHTML ) XML WX-model WX-model XHTML WX-model XHTML ^ $ Child nodes sp nl comment scriptlet 2.1 File XHTML WX-model Child nodes : /XMLDecl /DoctypeDecl /StyleSheet /Element 2.2 XMLDecl XMLDecl ^<?xml version="1.0" encoding="euc-jp"?>$ Child nodes : /tago /Attribute /tagc 2.3 DoctypeDecl DoctypeDecl ^<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">$ Child nodes : /tago /name /ExternalID /tagc 1

2 2.4 ExternalID DoctypeDecl ExternalID <!DOCTYPE html ^PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"$> Child nodes : /system /String /public 2.5 StyleSheet ^<?xml-stylesheet href="http://www.w3.org/stylesheets/tr/w3c-rec.css" type="text/css"?>$ Child nodes : /tago /Attribute /tagc 2.6 Element ^<a href="index.html">index</a>$ ^<br/>$ Child nodes : /Element /STag /ETag /text /Empty 2.7 Attribute <a ^href="index.html"$>index</a> Child nodes : /name /eq /String 2.8 String ( ) () <a href=^"index.html"$>index</a> Child nodes : /dquote /squote /text 2

3 2.9 STag ^<a href="index.html">$index</a> Child nodes : /tago /name /Attribute /tagc 2.10 ETag <a href="index.html">index^</a>$ Child nodes : /tago /name /tagc 2.11 Empty ^<br/>$ Child nodes : /tago /name /Attribute /tagc 2.12 tago ^<$a href="index.html">index^</$a> 2.13 tagc <a href="index.html"^>$index</a^>$ 2.14 name <^a$ ^href$="index.html">index</^a$> 3

4 2.15 system SYSTEM <!DOCTYPE File ^SYSTEM$ "WXModel.dtd"> 2.16 public PUBLIC <!DOCTYPE html ^PUBLIC$ "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> 2.17 dquote <a href=^"$index.html^"$>index</a> 2.18 dquote <a href=^ $index.html^ $>Index</a> 2.19 eq = <a href^=$"index.html">index</a> 2.20 text XHTML <a href="index.html">^index$</a> <b>^hello Wapid$</b> 4

5 2.21 comment ^<!-- This is comment -->$ 2.22 scriptlet scriptlet ^<% request.setcharacterencoding("shift_jis"); %>$ 2.23 sp @offset 5

6 A A.1 % java wapid.parser.wxmodel.mkwxmodel <targetxhtml> SDB dira/fileb SDB/WXModel/fileB.xml WXModel.dtd % java wapid.parser.wxmodel.mkwxmodel -h NAME MkWXModel - WXModel maker SYNOPSIS java wapid.parser.wxmodel.mkwxmodel [options] file -h : Show this help. -D : Directory for SDB ("SDB"). -e : Set output file encoding. ("EUC-JP"). -v : Print verbose message. A.2 % cd <SAPID_TOP>/Wapid/WX-sample % make test-wapid-wx diff WXModel.dtd validate 6

7 B SDB B.1 SDB SDB XML XML WXModel wapid.parser.wxmodel.wxdbaccessor CASE SDB CASE File WXDBAccessor#getSDBFile(String analyzedfilename); String WXDBAccessor#getSDBFileName(String analyzedfilename); XML B.2 WXModelAR wapid.wxmodel.wxmodelar 1 Relaxer 2 WXModel (WXModel.dtd) (wapid.wxmodel.abstractwxmodelar ) Relaxer % relaxer -factory -package:wapid.wxmodel.abstractwxmodelar -classprefix:awx -parameterprefix:p_ WXModel.rxm ID B.2.1 WXModelAR wapid.wxmodel.wxmodelar WxFile AccessEnvironment#getWxFileInstance(String filepath) B.2.2 WXModel objname Wx + objname getwx + objname + s() getwx + objname + Iterator() getparentobject() 1 DOM xsapid 2 7

8 IXObject DTD <!ELEMENT XMLDecl (tago Attribute tagc sp nl comment scriptlet)*> DTD wapid.wxmodel.wxmodelar WxTago[] WxXMLDecl#getWxTagos() Iterator WxXMLDecl#getWxTagoIterator() WxAttribute[] WxXMLDecl#getWx() Iterator WxXMLDecl#getWxAttributeIterator()... IXObject WxXMLDecl#getParentObject()... IAWxXMLDeclChoice[] WxXMLDecl#getContent() return type : IAWx + objname + Choice[] method name : getcontent() B.2.3 String IXObject#toSourceCode() XHTML B.2.4 ID String IXObject#getId() B.2.5 int IXObject#getCOffset() int IXObject#getCLength() int IXObject#getStartLine() 8

9 int IXObject#getStartColumn() int IXObject#getEndLine() int IXObject#getEndColumn() B XHTML import wapid.parser.wxmodel.wxdbaccessor; import wapid.wxmodel.wxmodelar.*; public class Restructure { public static void main(string args[]){ WXDBAccessor acc = new WXDBAccessor(); WxFile file = AccessEnvironment.getWxFileInstance(acc.getSDBFileName(args[0])); System.out.print(file.toSourceCode()); } } B XMLDecl Attribute import wapid.wxmodel.wxmodelar.*; import wapid.parser.wxmodel.*; public class XMLDeclExtracter { public static void main(string args[]){ WXDBAccessor acc = new WXDBAccessor(); WxFile file = AccessEnvironment.getWxFileInstance(acc.getSDBFileName(args[0])); WxXMLDecl[] xd = file.getwxxmldecls(); System.out.println("XMLDecl : " + xd[0].tosourcecode()); WxAttribute[] at = xd[0].getwx(); for(int i=0;i<at.length;i++){ System.out.println("Attribute[ID=" + at[i].getid() + "]" + topos(at[i]) + " : " + at[i].tosourcecode()); } } public static String topos(ixobject obj){ return "[(" + obj.getstartline() + "," + obj.getstartcolumn() 9

10 } } + ") => (" + obj.getendline() + "," + obj.getendcolumn() +")]"; XMLDecl : <?xml version="1.0" encoding="euc"?> Attribute[ID=wx4][(1,7) => (1,19)] : version="1.0" Attribute[ID=wx12][(1,21) => (1,34)] : encoding="euc" 10

11 C WXModel.dtd <!-- WXModel ver. 0.7 Last update 2003/09/22 Author ken --> <!ELEMENT File <!ELEMENT XMLDecl <!ELEMENT DoctypeDecl <!ELEMENT Attribute <!ELEMENT ExternalID <!ELEMENT StyleSheet <!ELEMENT STag <!ELEMENT ETag <!ELEMENT Empty <!ELEMENT String <!ELEMENT Element (XMLDecl DoctypeDecl StyleSheet Element sp nl comment scriptlet)*> (tago Attribute tagc sp nl comment scriptlet)*> (tago name ExternalID tagc sp nl comment scriptlet)*> (name eq String sp nl comment scriptlet)*> (system String public sp nl comment scriptlet)*> (tago Attribute tagc sp nl comment scriptlet)*> (tago name Attribute tagc sp nl comment scriptlet)*> (tago name tagc sp nl comment scriptlet)*> (tago name Attribute tagc sp nl comment scriptlet)*> (dquote squote text sp nl comment scriptlet)*> (Element STag ETag text Empty sp nl comment scriptlet)*> <!ELEMENT sp <!ELEMENT nl <!ELEMENT comment <!ELEMENT scriptlet <!ELEMENT name <!ELEMENT system <!ELEMENT public <!ELEMENT dquote <!ELEMENT squote <!ELEMENT eq <!ELEMENT text <!ELEMENT tago <!ELEMENT tagc <!ATTLIST File id ID #REQUIRED> <!ATTLIST XMLDecl id ID #REQUIRED> <!ATTLIST StyleSheet id ID #REQUIRED> <!ATTLIST DoctypeDecl id ID #REQUIRED> <!ATTLIST Attribute id ID #REQUIRED> <!ATTLIST ExternalID id ID #REQUIRED> <!ATTLIST STag id ID #REQUIRED> <!ATTLIST ETag id ID #REQUIRED> <!ATTLIST Empty id ID #REQUIRED> <!ATTLIST String id ID #REQUIRED> 11

12 <!ATTLIST Element id ID #REQUIRED> <!ATTLIST sp id ID #REQUIRED> <!ATTLIST nl id ID #REQUIRED> <!ATTLIST nl line NMTOKEN #IMPLIED> <!ATTLIST nl offset NMTOKEN #IMPLIED> <!ATTLIST nl coffset NMTOKEN #IMPLIED> <!ATTLIST comment id ID #REQUIRED> <!ATTLIST scriptlet id ID #REQUIRED> <!ATTLIST name id ID #REQUIRED> <!ATTLIST system id ID #REQUIRED> <!ATTLIST public id ID #REQUIRED> <!ATTLIST dquote id ID #REQUIRED> <!ATTLIST squote id ID #REQUIRED> <!ATTLIST eq id ID #REQUIRED> <!ATTLIST text id ID #REQUIRED> <!ATTLIST tago id ID #REQUIRED> <!ATTLIST tagc id ID #REQUIRED> 12

13 1 1 2 WX-model File XMLDecl DoctypeDecl ExternalID StyleSheet Element Attribute String STag ETag Empty tago tagc name system public dquote dquote eq text comment scriptlet sp nl A 6 A A B SDB 7 B.1 SDB B.2 WXModelAR B.2.1 WXModelAR B B B.2.4 ID B B B C WXModel.dtd 11 13

1: JX-model XML File Package Import Class Intf Ctor Method SInit Field Param Local ExtdOpt ImplOpt ThrwOpt Members QName Type Stmt Label Expr ident li

1: JX-model XML File Package Import Class Intf Ctor Method SInit Field Param Local ExtdOpt ImplOpt ThrwOpt Members QName Type Stmt Label Expr ident li Sapid JX-model ver. 1.3.13 2003 2 27 1 JX-model Java XML JX-model JX-model Java (Java 2 ver. 1.4) 20 7 JX-model 1 ^ $ Child nodes JX-model / ( ) JX-model @ @id @sort 1.1 File File JX-model XML /Package,

More information

¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥°¥é¥ß¥ó¥°ÆÃÏÀ

¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥°¥é¥ß¥ó¥°ÆÃÏÀ 8 : Web Same Origin Policy : XML :, XML http://www.w3.org/xml/ http://www.w3.org/tr/dom-level-3-core 1 / 31 xml.html: XML xpath-test.html: XPATH valid-test.html: XML (IE ) xslt-test.html: JS XSLT xslt-test.xml:

More information