ãã£ã¨ç¬¬1åãã¼(è¦ç¬)ããã£ãã¯ããã¾ãããã
åã¯ãããããXMLã«ã¤ãã¦èªãããã¨æãã¾ããã§ããããã®ã·ãªã¼ãºã®é¡åã«ã¯ããXMLã以å¤ã«ããã©ã¦ã¶ãã¨ããããã ãã¨ããåèªãå ¥ã£ã¦ãããã¨ã«æ³¨ç®ãã¦ãã ããã
XMLã«é¢ãã解説ãè«èã¯ãæ¢ã«å±±ã®ããã«ããããã§ããã®ã·ãªã¼ãºã«ç¹å¾´ãããã¨ããã°ãããã¯ãæ®ã2ã¤ã®ãã¼ã¯ã¼ãããã©ã¦ã¶ããããããã ãã¨ãã観ç¹ã§ãããã
å 容ï¼
- XMLããè¦ã¦ãããã©ã¦ã¶ãã¨ã¯ä½ãªã®ã
- ããã©ã¦ã¶ããæ¨ã¦ããã®ã§ã¯ãªã
- micro*ã¨ã®é¢ä¿
- Ajaxã¨ã®é¢ä¿
- 注æäºé ããªããã¯æ¬é³
- ä»åã®ã¾ã¨ã
âXMLããè¦ã¦ãããã©ã¦ã¶ãã¨ã¯ä½ãªã®ã
ãã®ã·ãªã¼ãºã§ã¯ããä»ãããã¨ã誰ã§ããã«âãã ããâã¤ããã§ãããã®ãããªæ 度ãåã常ã«ã¨ã£ã¦ãããã¨ããã¨ãå ¨ç¶ããã§ãªãã®ã ãã©ããã¨ä»åã¯ããä»ããã誰ã§ãã§ããXMLããã°ã©ãã³ã°ãã£ã¦ã¹ãã¼ã¬ã³ãªã®ã§ããããã¦ããã®ã¹ãã¼ã¬ã³ã«å¾ãã°ãç°å¢ã®é¸æè¢ã¯ææ©ï¼ãã¯ãï¼ãªããå¿ ç¶çã«ãã©ã¦ã¶ã«æ±ºã¾ã£ã¡ããã¾ãã
ãã¡ãããã©ã¦ã¶ã¯ãXMLå¦çã®ãã©ãããã©ã¼ã ã§ã¯ããã¾ãããHTMLã®ã¬ã³ããªã³ã°ããã©ã¦ã¶ã®ä¸»ããä»äºã§ããããã¦ãHTMLã¨ããã®ã¯ãå¤ããµãã¼ãSGMLè¦æ ¼ããã¼ã¹ã¨ãã¦ããããã§ãç¾å¨ã®ãã©ã¦ã¶ã¯SGMLãã¼ã¹HTMLä»æ§ï¼ã¬ã¬ã·ã¼HTMLï¼ã«æ·±ãæ¯ããã¦ããã®ã§ãã
ã§ãããããã©ã¦ã¶ã¯ã¾ã£ã¨ããªXMLå¦çç°å¢ã§ã¯ãªãããæºè¶³ã§ããæ©è½æ§ãåãã¦ãã¾ãããããã¯äºå®ãªã®ã§ããããèªãããããã¾ãããããããããããããã ã¡ã«å ¨å¦å®ã絶æã«çµã³ã¤ãããã§ã¯ããã¾ããã
âããã©ã¦ã¶ããæ¨ã¦ããã®ã§ã¯ãªã
ãã©ã¦ã¶ããã¼ãããHTMLææ¸ã¯ãJavaScriptããã°ã©ã ããè¦ãã空éå ã«ããªãã¸ã§ã¯ãæ§é ï¼ãªãã¸ã§ã¯ãã°ã©ãï¼ãããã°ã©ãã®ããã®JavaScriptãã®ç¬¬3åãåç §ï¼ãä½ãã¾ãããã®æ§é ã®ä¸é¨ï¼ã¤ã¾ããªãã¸ã§ã¯ãã°ã©ãã®ç¹å®ã®ãµãã°ã©ãï¼ã¯ããªã¼ãæããW3C DOMã®ææ¸ããªã¼ã¨ã¿ãªãã¾ããããã¦ãã»ã¼W3C DOM APIã使ã£ã¦æä½ã§ãã¾ãã
ãã»ã¼ãã¨ãã表ç¾ãããã®ã¯ããã©ã¦ã¶ã®ææ¸ããªã¼ã¯ãã¬ã¬ã·ã¼HTMLä¸ã®æè¡ã§ããDynamic HTMLã«ãã¾ã ã«ï¼ãã£ã±ãï¼æ·±ãæ¯ããã¦ããããã§ããã¾ã¼ããããâå°ããªããããå®ç¨æ§ã失ããªãç¨åº¦âï¼ã¤ã¾ãããããã ï¼ã®ãµãã»ãããé¸ã¹ã°ãDOMããã°ã©ãã³ã°ã¯ã§ããã¨è¨ã£ã¦ããã§ãããï¼ããã¯è¯ããã¥ã¼ã¹ï¼ã
ããã²ã¨ã¤ã®æå ±ã¯ãã¡ã¸ã£ã¼ãªãã©ã¦ã¶ã®æè¿ã®ãã¼ã¸ã§ã³ã§ã¯ãXMLHttpãªã¯ã¨ã¹ã¿ã使ãããã¨ã§ããXMLHttpãªã¯ã¨ã¹ã¿ã¯ãè¦ããã«âJavaScriptãã使ããHTTPã¯ã©ã¤ã¢ã³ãæ©è½âã¨ç解ãã¦ããã§ããããé ã«ãXMLããä»ãã¦ããã®ã¯ãXMLãã¼ã¶ã¼ãå èµããã¦ããããã ãã©ãå¥ã«è»¢é対象ãXMLãã¼ã¿ã«éå®ãããããã§ã¯ããã¾ããã
XMLHttpãªã¯ã¨ã¹ã¿ã®ï¼ãã¶ãä¸çªï¼å¤§ããªæ義ã¯ãJavaScriptã«ï¼å¶éã¯ãããã®ã®ï¼å ¥åºåæ©è½ãä¸ãããã¨ã§ããããã«ãXMLãã¼ã¶ã¼ãä»ãã¦ããã®ã ãããXMLå ¥åºåã使ããã£ã¦ãã¨ã§ãããããããããªãã§ããã
âmicro*ã¨ã®é¢ä¿
XMLHttpãªã¯ã¨ã¹ã¿ã«ããåãå¯ããXMLãã¼ã¿ã¯ãã¬ã¬ã·ã¼HTMLã«æ¯ã¹ã¦ããã£ã¨æ±ããããDOMããªã¼ãå½¢æãã¾ãããã£ã¦ãæ¯è¼çã¾ã£ã¨ããªXMLããã°ã©ãã³ã°ã®å¯¾è±¡ã¨ãªãã¾ãã
ããããã®æ¹åã§è©±ãé²ããã®ãï¼ éãã¾ããããããããã¾ãããåã対象ã«ãããã®ã¯ããã©ã¦ã¶èªèº«ãHTTPã§GETãã¦ããï¼ã¬ã¬ã·ã¼ãããããªãï¼HTMLã®ã»ããªã®ã§ããã ã£ã¦ãããããªDOMããªã¼ã®æ®éã®æ±ãæ¹ãªãæç§æ¸ã«æ¸ãã¦ããã§ããã
HTMLã®ææ¸ããªã¼ã¯ãæ±ãã¦ãã£ããã¤ã³ãããã£ã¦ãã ãã©ãããã§ãããã対象ã¨ãããã®ã¯ããã¤ã¯ãææ¸ï¼microdocumentsï¼ã®æ±ããç´¹ä»ãããããã§ãããã¤ã¯ãææ¸ã¯ãHTMLï¼ã§ããã°XHTMLãæã¾ããï¼ææ¸ã«åãè¾¼ã¿ï¼embeddingï¼ãã¾ãã¯å·ãè¾¼ã¿ï¼imprintingï¼ãããæ å ±æ ä½ï¼information bearing objectï¼ã§ã -- ã¡ãã¨é£ããã ã£ãï¼ æ°ã«ããªãã¦ãããã©ãå¿ è¦ãªããmicro* (2)ï¼microdocumentsãã¨ããããããªã³ã¯ããã¦ããã¨ã³ããªç¾¤ãèªãã§ãã ããã
ããã¤ãã®çç±ããåã¯ãmicroformatsã®hCard, hReviewã«ä»£è¡¨ããããããªâå·ãè¾¼ã¾ãããã¤ã¯ãææ¸âï¼imprinted microdocumentsï¼ã«ç¹ã«ç¦ç¹ãå½ã¦ããã¨æãã¾ããç¾ç¶ã®HTTP+HTML+ãã©ã¦ã¶ã¨ããã¤ã³ãã©ä¸ã§ãæ§é çï¼ãããã¯åæ§é çï¼ãã¼ã¿ãããåãããããã«ãâå·ãè¾¼ã¾ãããã¤ã¯ãææ¸âã¯ææãªæè¡ã ã¨æãã®ã§ããããã¦ãæ¯è¼çãæ軽ãªXMLå¿ç¨ã¨ãã¦ã楽ãããé¢ç½ãã
以ä¸ã®ãã¨ããããã¤ã¯ãã¢ããªã±ã¼ã·ã§ã³ãã£ã¦è¨èã使ã£ã¦ããã°ããä»å¾ããã¤ã¯ãã¢ããªã±ã¼ã·ã§ã³ã®åºç¤ãå®ä¾ã¨å ±ã«è§£èª¬ããäºå®ãã£ã¦ãã¨ã§ã -- ãã¤ã¯ãã¢ããªã±ã¼ã·ã§ã³ã«ã¤ãã¦ã¯ããmicro* (3)ï¼microapplicationsã㨠micro* (4)ï¼microapplicationsãæ¯ããæè¡ã«èª¬æãããã¾ãã
âAjaxã¨ã®é¢ä¿
åãJavaScriptã«èå³ãæã¡ã¯ããããã£ããã¯ä¸éã®Ajaxãã¼ã ã§ããã«ããããããããAjaxãã£ã¦è¨èã¯ãã¾ã使ã£ã¦ã¾ããï¼æ¥è¨å æ¤ç´¢ããããåããã¾ãï¼ããAjaxä¸æ³ãã¨ã¯å ¨ç¶æã£ã¦ãªãããããããããã³ãã«âãããªãã¨âãã¦ãã¦ããã®ããªï¼ãã¨ããçåãææã§ããªãã®ã§ãã
ã§ããããããã©ã¦ã¶ã§ãããã XMLããAjaxã¨ã©ã®ãããªé¢ä¿ããããã«ã¤ãã¦ããã¾ã¯ä½ãèªããªããã¨ã«ãã¾ãããããã次ã®ç¹ã¯æ³¨æãã¦ããã¾ãï¼ ä»åã®ä¸»é¡ã®ã²ã¨ã¤ã§ããâå·ãè¾¼ã¾ãããã¤ã¯ãææ¸âã¯ããã£ããä¼çµ±çãªææ³ã§ãããä»å¾ãé·æã«æ¸¡ã使ãããã®ã§ããJavaScriptãAjaxãä¸éæ§ã®ãã¼ã ã§ãã£ãã¨ãã¦ããã®çµçããã®ææ³ãç¡å¹åããããã§ã¯ããã¾ããã
ã¤ãã§ã«ãAjaxã¸ã®ã³ã¡ã³ããã²ã¨ã¤ä»ãå ãã¦ããã°ãAjaxã®'X'ãXMLã«ç±æ¥ããã¨ãã¦ããAjaxå¿ç¨ã«XMLãå¿ é ã¨ããããã§ã¯ããã¾ãããå®ã®ã¨ãããAjaxã¨XMLã®ã¤ãªããã¯æå¤ã¨å¸èãªã®ã§ã¯ãã¨æã£ã¦ãã¾ããå¤ãã®å ´åãXMLãããJSONãYAMLãCSVãªã©ã®ã»ãã便å©ã§ããç¹ã«ãJavaScriptã¨ã®ç¸æ§ãªãJSONããã¹ãã§ããããæ¨ä»ãJSONãYAMLãå°é ãã¦ããã®ã¯ãXMLã«ã¨ã£ã¦ãè¯ããã¨ã ã¨æãã¾ãããªããªããXMLãé©åã«ç¸å¯¾åãããããã«ã¯ãé©åãªéXMLæ¦å¿µãå¿ è¦ã§ãããã
â注æäºé ããªããã¯æ¬é³
ãä»ããã誰ã§ãã§ããXMLããã°ã©ãã³ã°ãã¨ããããã©ã¦ã¶ã¨ããã¹ãã¨ãã£ã¿ããããã°ã¯ããããããã¨ãã¯ãå®ãè¨ãã°æ¹å¥ï¼ããã£ãï¼ã§ãããå®æ ã¯å¤å°éãã¾ãï¼ã£ã¦ããããè¨ã£ã¡ããªã·ãã¤ããªï¼ã
ã誰ã§ããã¯ããããã人ãã§ã¯ãªãã¦ãå®éã¯èå³ã¨æ欲ããã人ã£ã¦ãã¨ã«ãªãã§ããããã¾ãããã©ã¦ã¶ã¨ããã¹ãã¨ãã£ã¿ã ãã§ã¯è¾ãï¼ å¯¾è©±çå¦çç³»ããããåã®æ§æãã§ãã«ã¼ãä½µç¨ãã¾ãï¼ãããã«ã¤ãã¦ã¯æã«è§¦ãã¦è¿°ã¹ã¾ãï¼ã
âä»åã®ã¾ã¨ã
- ãã©ã¦ã¶ã¯ãè¯å¥½ãªXMLå¦çç°å¢ã¨ã¯è¨ããããã
- ãããããããã ãªDOMããã°ã©ãã³ã°ã¯ã§ããã
- XMLHttpã§åå¾ããXMLãã¼ã¿ã¯æ±ããããã
- ã ããã·ãªã¼ãºã®è©±é¡ã¯ãHTMLææ¸ã«å«ã¾ãããã¤ã¯ãææ¸ã®æ±ãæ¹ã§ããã
- ããã©ã¦ã¶ã§ãããã XMLãã¨Ajaxã®é¢ä¿ã¯ãç¾ç¶ã§ã¯æ確ã§ãªãã