XML 链接有关问题
XML 链接问题
怎样在XML中添加一个hyperLink?
------解决方案--------------------
怎样在XML中添加一个hyperLink?
------解决方案--------------------
- XML code
<?xml version="1.0" encoding="ISO-8859-1"?> <bookstore xmlns:xlink="http://www.w3.org/1999/xlink"> <book title="Harry Potter"> <description xlink:type="simple" xlink:href="http://book.com/images/HPotter.gif" xlink:show="new"> As his fifth year at Hogwarts School of Witchcraft and Wizardry approaches, 15-year-old Harry Potter is....... </description> </book> <book title="XQuery Kick Start"> <description xlink:type="simple" xlink:href="http://book.com/images/XQuery.gif" xlink:show="new"> XQuery Kick Start delivers a concise introduction to the XQuery standard....... </description> </book> </bookstore>
------解决方案--------------------
多数情况下,XML是不具备实际功能意义的,也就是不支持超链接。
但你可以通过如XSLT等之类的格式转换方式,转成HTML以支持超链接。
在特定的环境下,XML支持XLINK,即可以如楼上的书写格式。但目前XLINK普及度不高,浏览器方面目前尚不支持。