32
10 10 Other Technologies Other Technologies (XBase, XPointer, XInclude, XHTML, (XBase, XPointer, XInclude, XHTML, XForms) XForms) 제제제제제제제 제제제제제제제 제제 제제 3 3 제제 제제 제 제 제 제 제 제

제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

Embed Size (px)

Citation preview

Page 1: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

제 제 10 10 장 장 Other TechnologiesOther Technologies

(XBase, XPointer, XInclude, XHTML, XForms)(XBase, XPointer, XInclude, XHTML, XForms)

인공지능연구실인공지능연구실석사 석사 33 학기 학기

홍 정 연홍 정 연

Page 2: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

ContentsContents

•XBase•XPointer•XInclude•XHTML•XForms

Page 3: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XBase(1/3)XBase(1/3)• XBase 란 ?

– Define the base URL or original location of the document– HTML 의 element <BASE> 와 같은 기능

• HTML 의 <BASE> element– <BASE> element 선언

– use a link like this in our HTML document

http://myserver.org/inthisdir/filename.html#section2

<BASE HREF=“http://myserver.org/inthisdir/filename.html”>

<A HREF=“#section2”>

Page 4: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XBase(2/3)XBase(2/3)• XBase; xml:base attribute 를 이용해 비슷한 기능을 제공

<?xml version=“1.0”?>

<ItemLocations xml:base=“http://acme.mfg.com/invoice.xml/” xmlns:xlink=“http://www.w3.org/1999/link” xlink:type=“extended”>

<itemlocation xlink:type=“resource” xlink:label=“location” itemkey=“14”> R3L1 </itemlocation>

<Item xlink:type=“locator” xlink:href=“#itemkey(14)” xlink:label=“item”/>

http://acme.mfg.com/invoice.xml#itemkey(14)

Page 5: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XBase(3/3)XBase(3/3)• “Advenced” XBase ; 여러 개의 base URI 를 정의

– http://acme.mfg.com/manufacturing 와 http://acme.mfg.com/supply 인 base URI 정의

<?xml version=“1.0”?>

<ItemLocations xml:base=“http://acme.mfg.com/invoice.xml/” xmlns:xlink=“http://www.w3.org/1999/link” xlink:type=“extended”>

<itemlocation xlink:type=“resource” xlink:label=“location” itemkey=“14”> R3L1 </itemlocation>

<companyinvoice companyid=“1” xml:base=“/manufacturing/”>

Page 6: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

<Item xlink:type=“locator” xlink:href=“invoice.xml#itemkey(14)” xlink:label=“item”/> …..

<itemlocation xlink:type=“resource” xlink:label=“location” itemkey=“16”> R3L1 </itemlocation>

<Item xlink:type=“locator” xlink:href=“invoice.xml#itemkey(16)” xlink:label=“item”/> …..

</companyinvoice>

<companyinvoice companyid=“2” xml:base=“/supply/”>

</companyinvoice>

http://acme.mfg.com/manufacturing/invoice.xml#itemkey(14)

http://acme.mfg.com/supply/invoice.xml#itemkey(16)

Page 7: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XPointer(1/7)XPointer(1/7)• XPointer 란 ? ; XPath 를 확장하고 XLink 와 결합하여 사용됨 ; XLink 로 describe 된 resource 안의 specific data 를 식별할 수 있도록 함• 특징 - XPointer 는 단순히 target 을 point 하거나 expose 함 - document 안의 어떠한 scale 의 data 도 검색 할 수 있음 (ex: whole document, element, sections of character data) - text/xml 이나 application/xml type 의 resource 에만 작용

Page 8: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XPointer(2/7)XPointer(2/7)• Identifiers using XPointer and XLink

– Three type of fragment identifier

• Full form• Bare names• Child sequence

Page 9: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

<ORDERS>

<Invoice InvoieKey=“187”> <invoiceitem ItemKey=“13”/> <invoiceitem ItemKey=“14”/> </Invoice>

<Invoice InvoiceKey=“188”> <invoiceitem ItemKey=“13”/> </Invoice>

<Invoice InvoiceKey=“189”> <invoiceitem ItemKey=“11”/> </Invoice>

<ORDERS>

* Invoicekey 가 187 인것을 point

• Full Form

xlink:href=“http://www.orders.com/orders/orders.xml#xpointer(Invoicekey(“187”))”

• Bare Namesxlink:href=“http://www.orders.com/orders/orders.xml#187”

- unique ID 를 사용해야 함- Full form 에 비해 명료성이 떨어짐

Page 10: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

• Child Sequences ;tumbler identifier 라고도 함

xlink:href= “http://www.orders.com/orders/orders.xml#1/3/1”

ORDERS

InvoiceItem

InvoiceItem

InvoiceItem

InvoiceItem

Invoice

Invoice

Invoice

#1/3/1

go to the first element <ORDERS>

#1/3/1

go to the third child element <Invoice InvoiceKey=“189”>

#1/3/1

go to the first child element current element <invoiceitem IemKey=“11”/>

Page 11: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XPointer(3/7)XPointer(3/7)• Extension to XPath ; range content 를 define 할 때 사용

– Points ; XML documents 안의 한 점을 XPointer 를 이용해 표현 ; container node 와 index 에 의해 define

• node-point

<name> <first>John</first> <middle>Fitgerald Johansen</middle> <last>Doe</last> </name>

point

Container Node

Index=2

#xpointer(/name[2])

Page 12: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XPointer(4/7)XPointer(4/7)– Points(const)

• character-point

#xpointer(/name/middle/text()[2])

<name> <first>John</first> <middle>Fitgerald Johansen</middle> <last>Doe</last> </name>

point

Container Node Index=2

Page 13: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XPointer(5/7)XPointer(5/7)– Ranges ; 두 point 에 의해 define(start point,end point)

두 point 사이의 content 를 가리킴#xpointer(/order/name to /order/item)

<?xml version=“1.0” ?> <order>

<name> <first>John</first> <middle/> <last>Doe</last>

</name> <item>Production-Class Widget</item>

<quantity>16</quantity> <date>

<m>1</m> <d>1</d> <y>2000</y>

</date> <customer>Sally Finkrlstein</custmer></order>

Start point

End point

•두 점의 container node 가 같아야 함•<name> 과 <item> 은 <order> 안의 유일한 member 이어야 함

유의점

Page 14: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XPointer(6/7)XPointer(6/7)– Ranges with Multiple Locations

<people> <person name=“John”> <phone> (555) 555-1212 </phone> <phone> (555) 555-1213 </phone> </person> <person name=“David”> <phone> (555) 555-1214 </phone> </person> <person name=“Andrea”> <phone> (555) 555-1215 </phone> <phone> (555) 555-1216 </phone> <phone> (555) 555-1217 </phone> </person> <person name=“Ify”> <phone> (555) 555-1218 </phone> <phone> (555) 555-1219 </phone> </person> <!- - more people could follow- -> </people>

Page 15: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

xpointer(//person to phone[1])

<person name=“John”/><person name=“David”/><person name=“Andrea”/><person name=“Ify”/>

1.’to’ 의 왼쪽 표현값을 찾음 2.’to’ 의 오른쪽 표현값을 찾음

<person name=“John”/> <phone>(555)555-1212</phone><person name=“David”/><person name=“Andrea”/><person name=“Ify”/>

Range

3. 2 와 같은 과정을 반복 결과

<person name=“John”/> <phone>(555)555-1212</phone> <person name=“David”/> <phone>(555)555-1212</phone> <person name=“Andrea”/> <phone>(555)555-1212</phone> <person name=“Ify”/> <phone>(555)555-1212</phone>

Page 16: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XPointer(7/7)XPointer(7/7)• Querying with XPointer ; XLink 를 이용하여 data set 을 identity 하고 XML Query 를 이용하여

그 data set 을 point

<ORDERS>

<Invoice InvoieKey=“187”> <invoiceitem ItemKey=“13”/> <invoiceitem ItemKey=“14”/> </Invoice>

<Invoice InvoiceKey=“188”> <invoiceitem ItemKey=“13”/> </Invoice>

<Invoice InvoiceKey=“189”> <invoiceitem ItemKey=“11”/> </Invoice>

<ORDERS>

Invoicekey 가 187 인 data 를 point

Invoice.xml

xlink:type=“locator”xlink:href=“acme.mfg.com/invoice.xml#xpointer(//invoice.invoicekey=“187”)

Page 17: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XInclude(1/4)XInclude(1/4)• XInclude 란 ? ; XInclude 는 information set 을 merge 하는 processing model 을 define 함 .<?xml version=“1.0”?>

<ItemLocations xmlns:xinclude=http://www.w3.org/1999/XML/xinclude xmlns:xlink=http://www.w3.org/1999/xlink xlink:type=“extended”><Title>Xinclude Invoice Items</Title><BODY> <p> <font color=“red”><I>invoice from file invoiceA.xml</I></font> </p> <ORDERS ID=“A”> <xinclude:include href=http://acme.mfg.com/invoices.xml#InvoiceKey(187)”/> </ORDERS> <ORDERS ID=“B”> <xinclude:include href=http://www.acme.com/supply/invoices.xml#InvoiceKey(200)”/> </ORDERS></BODY></ItemLocations>

<ORDERS>

<Invoice InvoieKey=“187”> <invoiceitem ItemKey=“13”/> <invoiceitem ItemKey=“14”/> </Invoice>

<Invoice InvoiceKey=“188”> <invoiceitem ItemKey=“13”/> </Invoice>

<ORDERS>

<ORDERS>

<Invoice InvoieKey=“10”> <invoiceitem ItemKey=“1”/> </Invoice>

<Invoice InvoiceKey=“200”> <invoiceitem ItemKey=“18”/> <invoiceitem ItemKey=“69”/> </Invoice>

<ORDERS>

Source inforset

Page 18: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

<ORDERS ID=“A”> <xinclude:include href =http://acme.mfg.com/invoices.xml#InvoiceKey(187)”/> </ORDERS> <ORDERS ID=“B”> <xinclude:include href=http://www.acme.com/supply/invoices.xml#InvoiceKey(200)”/> </ORDERS> <?xml version=“1.0”?>

<ItemLocations xmlns:xinclude=http://www.w3.org/1999/XML/xinclude xmlns:xlink=http://www.w3.org/1999/xlink xlink:type=“extended”><Title>Xinclude Invoice Items</Title><BODY> <p> <font color=“red”><I>invoice from file invoiceA.xml</I></font> </p> <ORDERS ID=“A”> <Invoice InvoieKey=“187”> <invoiceitem ItemKey=“13”/> <invoiceitem ItemKey=“14”/> </Invoice> </ORDERS> <ORDERS ID=“B”> <Invoice InvoiceKey=“200”> <invoiceitem ItemKey=“18”/> <invoiceitem ItemKey=“69”/> </Invoice> </ORDERS></BODY></ItemLocations>

Result inforset

Page 19: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XInclude(2/4)XInclude(2/4)• 3 개의 분리된 module(or document) 의 element 가

하나의 document 로 merge 됨 result set 이 형성됨• Document 의 element 는 document 의 definition

이나 schema 를 바꾸지 않고 XInclude 를 바꿀 수 있음

Page 20: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XInclude(3/4)XInclude(3/4)• The parse Attribute and other Considerations

– href attribute 처럼 include element 도 optional parse attribute 를 갖는다 .

• Parse=“xml” ; resource 는 XML 로 parse 되고 난 후 infoset 이 merge 되야 함• Parse=“text” ; resource 는 text node 의 contents 로써 포함되어야 함• 명시되지 않았을 경우 “ xml” 을 의미

Page 21: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XInclude(4/4)XInclude(4/4)• XInclude Advantages

– XInclude 는 information set 을 다루기 때문에 XML validation 과 independent 함

– 위와 같은 이유로 information set 은 pre-declare inclusion 없이 parent document 에 include 될 수 있음

– XInclude 는 validation 없이 inforset 을 만들 수 있다 . 이런 진보된 XML modularity 는 매우 powerful 함 . draft 가 XML database 와 많은 interaction 을 할 수 있음

Page 22: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XHTML(1/4)XHTML(1/4)• XHTML 이란 ? ; XHTML is a reformulation of HTML

• Motivations– HTML 에 새로운 element 들이 specialized version 에서 소개

됐으나 platform 사이의 호환성 문제를 일으킴– 그에 반해 XML 은 요구에 맞게 새로운 mark up 들을 추가– XHTML 은 XHTML 모듈을 이용하여 developer 들이 existing 과 n

ew feature set 을 combine 하도록 함– 모든 영역의 browser platform 을 포함하는 standard 들을

제공하도록 하는 요구 증가

Page 23: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XHTML(2/4)XHTML(2/4)• How XHTML differs from HTML

– XHTML• Well formed document-provide DTD declaration

• <html>element 에 XML namespace 를 포함해야 함

• Close tag 를 반드시 갖추어야 함• HTML 에서는 <head> 와 <body> 가 optional 이지만 XHTML

에서는 생략해서는 안됨 . 그리고 <head> 의 첫번째 element는 <title> 이어야 함

• Attribute value 는 “ “로 표현되어야 함

PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” SYTEM “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”

<html xmlns=“http://www.w3.org/TR/xhtml1”?>

<input checked=“checked”> XHTML 의 경우

<input checked> HTML 의 경우

Page 24: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

<TITLE>very<HTML> <HEAD> <TITLE>wrong</TITLE> <META name=“description” content=“Working, but really messy code, isn’t it.”> <META name=“keywords” content=“many keywords”> </HEAD> <BODY> <CENTER> <H1>HTML to XHTML</H1> <P> It is not that difficult to upgrade one’s HTML to XHTML.<BR> Just follow a few rules: <OL> <LI>You need a <EM>DTD</EM> to validate against. <LI>refer to <EM>namespaces</EM> <LI>Tags should be <EM> nested</LI>.</EM> <LI>Elements should be in<EM>lower case.</LI></EM> <LI><EM>Quote</EM> all attributes. <LI><EM>Unminimize</EM> attributes. <LI>Correctly tag<EM>empty elements</EM>. <LI><EM>White space</EM>handling. <LI>Escape or externalize <EM>script</EM> and <EM> style elements</EM>. <LI><EM>id</EM> instead of name. <LI>Tags should be <EM>closed</EM> properly. <LI>Handle<EM>layout</EM> with styles. <HR width=60% size=1>

<?xml version=“1.0” encoding=“UTF-8”?> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en” lang=“en”> <head> <title>Proper XHTML</title> <meta name=“description” content=“Working, but really messy code, isn’t it.”/> <meta name=“keywords” content=“many keywords”/> </head> <body> <div style=“text-align:center”> <h1>HTML to XHTML</h1> <p> It is not that difficult to upgrade one’s HTML to XHTML.<br/> Just follow a few rules: </p> <ol> <li>You need a <em>DTD</em> to validate against.</li> <li>refer to <em>namespaces</em></li> <li>Tags should be <em> nested</em>.</li> <li>Elements should be in<em>lower case.</li></em> <li><em>Quote</em> all attributes.</li> <li><em>Unminimize</em> attributes.</li> <li>Correctly tag<em>empty elements</em>.</li> <li><em>White space</em>handling.</li> <li>Escape or externalize <em>script</em> and <em> style elements</em>.</li> <li><em>id</em> instead of name.</li> <li>Tags should be <em>closed</em> properly.</li> <li>Handle<em>layout</em> with styles.</li> </ol> <hr width=“60%” size=“1” /> </div> </body> </html>

Page 25: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XHTML(3/4)XHTML(3/4)• XHTML Flavors ; make it a little looser than a true XML document

; allow for easier conversion between legacy HTML documents XHTML

– Transitional• Let you use formatting tags

PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” SYSTEM “http://www.w3.org/TR/xhtml/DTD/xhtml-transitional.dtd”

Page 26: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XHTML(4/4)XHTML(4/4)– Strict ; force strict validation of XML

– Frameset ; allows the partition of a browser into frames

PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” SYSTEM “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”

PUBLIC “-//W3C//DTD XHTML 1.0 Frameset//EN” SYSTEM “http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd”

Page 27: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XForms(1/5)XForms(1/5)• XForms 란 ?

– next generation of web forms– user interface(sheet of paper or handheld device..) 에 상관없이 같은 form 을 보여줌 .– reduce the need for scripting

(validations,dependencies. and basic calculation 등이 scripting language 없이 가능하게 됨 )

– form data 를 XML 로 바꾸는 역할을 함

Page 28: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XForms(2/5)XForms(2/5)• How do XForms differ from HTML forms?

- browser 가 data 를 교환하도록 하는 가장 유용한 방법은 HTML이라는 것에 익숙해 있음

- 전형적인 HTML form

• Great for desktop browsers but other device?• Limiting device types( ex: pager…)

<FORM ACTION=“process.asp” METHOD=“GET” NAME=“userform”> <P>What is your name? <INPUT TYPE=“text” NAME=“namequery”> <P>What is your sex? &nbsp; &nbsp; &nbsp; Male <INPUT TYPE=“radio” NAME=“optsex” VALUE=“male”>&nbsp; &nbsp; Female <INPUT TYPE=“radio” NAME=“optsex” VALUE=“female”> <P>Click if you don’t want junk mail&nbsp; <INPUT TYPE=“checkbox” NAME=“chkjunk” VALUE=“no”> </FORM>

Page 29: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XForms(3/5)XForms(3/5)– XForms

• Representation layer 와 backend 를 분리한 data model 을 만듦으로써 interface 에 제한되지 않게 됨

(handheld devices, television, accessibility devices, printers, scanners…)

<xform:selectOne ref="as"> <xform:caption>What is your sex?</xform:caption> <xform:choices> <xform:item value=“male"><xform:caption>male</xform:caption></xform:item> <xform:item value=“female"><xform:caption>female</xform:caption></xform:item> </xform:choices> </xform:selectOne>

• radio button 의 경우 voice browser 에서는 표현하기 어려우므로 “ selectOne” 라는 표현을 쓴다 .

Page 30: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XForms(4/5)XForms(4/5)• The Model

UserInterface

InstanceData

Datamodel XML-encodedData

Model-View-Controller Paradigm with getter And setter methods

Datamodel Constrains data

For exchange with Web

Server

Page 31: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

XForms(5/5)XForms(5/5)• The Data Model

– XForms data layer 에서 data model 을 define– Use built-in data types or roll your own– 예전의 XML Schema 보다 더 간단

• The Logic Layer– Field 사이의 의존도를 명시하고 요구되는 제한사항을 define– script language 를 사용할 필요없이 Xform syntax 가 spread she

et 와 existing form package 와 비슷한 기능을 제공해줌

• The Presentation Layer– Data model 을 media-specific end product 로 translate 함

Page 32: 제 10 장 Other Technologies (XBase, XPointer, XInclude, XHTML, XForms) 인공지능연구실 석사 3 학기 홍 정 연

SummarySummary• XBase : HTML 4.0 을 기반으로 만들어져서 XML document 의 base URI 를 specify 하도록 해준다

• XPoint : Xpath 의 확장으로 document 안을 point 하도록 해주고 Xlink 와 같은 다른 technology 와도 같이 사용되어 질 수 있다 .

• XInclude : validation 필요없이 dynamic 하기 inforset 을 형성하도록 해준다 .

• XHTML : HTML 에 변화를 가져온 leader 이고 , 넓은 영역의 device 에 풍부한 web page 를 제공해준다 .

• XForms : next generation form 으로 user-interface 에 독립적인 form 을 제공하는 것을 extending and simplifying 해준다 .