Hyperlinks

Hyperlinks

WML also supports an <a> element for hyperlinks. Like the HTML version of this element, you use the href attribute to specify the URI you want to navigate to. Here's an example that takes the user to the Apache WML example:

Listing ch20_13.wml
 <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 2.0//EN"     "http://www.wapforum.org/dtd/wml20.dtd" >  <wml>     <card id="Card1" title="Hyperlinks">         <p align="center"><b>Hyperlinks</b></p>         <p>             Want to see some WML examples?             Take a look at the  <a href="http://www.apachesoftware.com/wml/wmldemo.wml">   Apache examples   </a>.  </p>     </card>     </card> </wml> 

You can see the results of this WML in Figure 20-12. When the user clicks the hyperlink, Klondike will navigate to the target URI.

Figure 20-12. A WML hyperlink.

graphics/20fig12.gif



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