当前位置:沸点梦工场 > WAP网页设计 > Wap2.0教程 > 浏览文章

如何链接WML和XHTML文档?

互联网 2007年06月04日 【字体:
下面的范例说明了怎样在一个XHTML网页和WML卡片组之间创建链接: 
--------------page1.xhtml---------------
 <?xml version="1.0"?>
 <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title>XHTML Mobile Profile page</title>
 </head>
 <body> <h1>A link to a WML deck</h1>
 <p>
 <a href="deck1.wml#go">Link</a>
 </p>
 </body>
 </html>


 --------------deck1.wml------------------
 <?xml version="1.0"?>
 <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
 <wml>
 <card id="go" title="WML deck1">
 <p> This is a WML deck. </p>
 <p> <anchor>Here <go href="page1.xhtml"/></anchor> </p>
 <p>you can go back to the page.xhtml.</p>
 </card>
 </wml>