XML Single-Record Binding Using XML Data Islands

To see how to bind HTML elements to an XML data island, I'll write an example. In this case, I'll add a data island for ch08_03.xml with the ID of customers to a new Web page, like this:

 <HTML>      <HEAD>         <TITLE>             Single Record Binding Using XML Data Islands         </TITLE>     </HEAD>  <XML SRC="ch08_03.xml" ID="customers"></XML>  .     .     . 

Now customers can act like a DSO, just like any other DSO (which is why data islands are called data islands). I can bind this DSO to assorted HTML elements, as we've already seen in this chapter:

 <XML SRC="ch08_03.xml" ID="customers"></XML>      BODY>        <CENTER>            <H1>                Single Record Binding Using XML Data Islands            </H1>  Name: <INPUT TYPE="TEXT" DATASRC="#customers"   DATAFLD="NAME" SIZE=10>   <P>   CUSTOMER_ID: <INPUT TYPE="TEXT" DATASRC="#customers"   DATAFLD="CUSTOMER_ID" SIZE=5>   <P>   Department: <SELECT DATASRC="#customers"   DATAFLD="DEPARTMENT" SIZE=1>   <OPTION VALUE="Meat">Meat   <OPTION VALUE="Produce">Produce   <OPTION VALUE="Frozen">Frozen   </SELECT>   <P>   Purchase date: <SPAN DATASRC="#customers"   DATAFLD="PURCHASE_DATE"></SPAN>   <P>   Product: <SPAN DATASRC="#customers" DATAFLD="PRODUCT_NAME"></SPAN><P>  .             .             .         </CENTER>     </BODY> </HTML> 


Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net