PI: importwikiThe purpose of an importwiki PI is to produce an XML-fragment from extracts from a wiki-page and replace the PI with this fragment. NOTE: That the form of this PI may change. Specially the use of dpath, and the form of the dpath may be changed. It is present at an experimental stage. <?_wxt importwiki dpath="" location=""?> As wikipages by their nature are changing, WXT apply a strategy that backs up the latest successfull import, and use this if an import fails. The backup strategy does not consider changes in content, but if your dpath or xpath, se below, fails to identify any material at all, the backup is used. More about DPath and XPath . This backup strategy cost processing time. You may change the strategy by parameter usecopy, see below. The parameters are:
NOTE 1: WXT does not consider styles, most elements are copied "as is". NOTE 2: WXT is not set up to collect from https (Secure connentions). If you want to access protected files, you should use normal access through a webbrowser and save the page on your disk. Then you can access the downloaded file locally. NOTE 3: The backup strategy makes it possible to inspect and even change the downloaded content. NOTE 4: In many cases you can achive your result by importing the wikipage by importxml and a xpath. WXT will attempt to tidy the import. Examples:<?_wxt importwiki location="mycopiedwikifile.html" dpath="/All students"?> will extract the header on level 2, All students, and all material until the next heading at level 2, or level1. <?_wxt importwiki keeprefs="no" location="http://en.wikipedia.org/wiki/Cougar" dpath="//Subspecies"?> will extract a description of Subspecies (placed at header level3) in a wikipedia - page about cougars. <?_wxt importwiki dpath="/Nature" location="http://en.wikipedia.org/wiki/Halden"?> will produce this (as of june 2009) <div class="importwiki"><h2> Nature</h2> <p>Halden is surrounded by forests and water so hiking and fishing locations can easily be found. Deer and elk are a common sight, and wolves have also been observed in the district along the border with Sweden. Raspberries, blackberries, blueberries, wild cranberries, and many varieties of mushroom can be found in the woods in the early autumn. Popular destinations for hikers and other nature lovers include Prestebakke and Kornsjø.</p> </div> |