User:aurora > Testing 1-2-3 > Testing ("xml.text")

Testing ("xml.text")

Denotes difference fom previous test line


Tests of xml.text

1 {{ xml.text(wiki.search("tag:test", 10, "-date"), "/", nil, false) }}

1


                      

2 {{ xml.text(wiki.search('tag:"test"', 10, "-date"), "/", nil, false) }}

2


                      

3 {{ xml.text(wiki.search('tag:"test"', 10,  "-date"), "/", nil, true) }}

3 <html><body><div class="wiki-search"><ul><li><a rel="internal" href="http://wiki.developer.mindtouch.com/Sandbox">Sandbox</a></li><li><a rel="internal" href="http://wiki.developer.mindtouch.com/User:SteveB">User:SteveB</a></li><li><a rel="internal" href="http://wiki.developer.mindtouch.com/Sandbox/4e/Blubberxfsdfsd">Blubber</a></li><li><a rel="internal" href="http://wiki.developer.mindtouch.com/Sandbox/Mini_privat_Teschtsiite">Mini privat Teschtsiite</a></li><li><a rel="internal" href="http://wiki.developer.mindtouch.com/User:Jsmith99/My_new_test_page">My new test page</a></li><li><a rel="internal" href="http://wiki.developer.mindtouch.com/Sandbox/Another_Page/Page_Title">PrintTest</a></li><li><a rel="internal" href="http://wiki.developer.mindtouch.com/User:brizben">User:brizben</a></li><li><a rel="internal" href="http://wiki.developer.mindtouch.com/User:Aurora/Testing_1-2-3">Testing 1-2-3</a></li><li><a rel="internal" href="http://wiki.developer.mindtouch.com/User:rl23455">User:rl23455</a></li><li><a rel="internal" href="http://wiki.developer.mindtouch.com/Sandbox/Test_Page_3000">Test Page 3000</a></li></ul></div></body></html>


Tests of string.matches

                  

1 {{ string.matches( xml.text(wiki.search('tag:"test"', 10,  "-date"),
"/", nil, true), "(\\User:[a-zA-Z0-9]+)") }}  

1 [ "User:SteveB" ]  


                  

2 {{ string.matches( xml.text(wiki.search('tag:"test"', 10,  "date"),
"/", nil, true), "(\\User:[a-zA-Z0-9]+)") }}  

2 [ "User:erakauf" ]  


    

3 {{ string.matches( xml.text(wiki.search('tag:"test"', 10,  "date"),
"/", nil, true), "\\User:[a-zA-Z0-9]+") }}  

3 [ ]

      


      

4 {{ string.matches(xml.text(wiki.search('tag:"test"', 10,  "date"),
"/", nil, true), "(\\User:[a-zA-Z0-9]+)") }}  

4 [ ]


 


      

5 {{ string.match( xml.text(wiki.search('tag:"test"', 10,  "date"),
"/", nil, true), "(\\User:[a-zA-Z0-9]+)") }}  

5


The Full Function

    

1. {{ var search_results=wiki.search('tag:"test"', 10, "-date"); var results_text=xml.text(search_results,
"/", nil, true); var path_list=string.matches(results_text, "(\\User:[a-zA-Z0-9]+)"); foreach(var page_path in path_list) { wiki.page(page_path) } }}

1.


TwitterCounter for @bjorg

Reset Root password on VM

 

TODO

  • Publish "How To" for creating a service (use blog post material)
  • DekiWiki JavaScript functions

Missing Documentation

MindTouch SID Template

sid://mindtouch.com/{year}/{month}/{service-name}

Terminology

OO
SODA
Class Blueprint
Instance Service
Method Feature

   


2. {{ var search_results=wiki.search('tag:"test"', 10, "-date"); var results_text=xml.text(search_results,
"/", nil, true); var path_list=string.match(results_text, "(\\User:[a-zA-Z0-9]+)"); foreach(var page_path in path_list) { wiki.page(page_path) } }}

   

2. /div[4]/p[5]/span, str is not valid; expected list or map or xml or nil
 


                               

Go to Top

                      

Tag page
You must login to post a comment.
Powered by MindTouch Deki v.8.08.2