Autoloading XML files

Using XMLHttpRequest() to configure entire ToolBook pages.

Autoloading XML files

Postby Clifton » Thu Dec 03, 2020 12:59 pm

PowerPac v15 allows for autoloading XML files based on page names used in your application.
To use this feature:
    Enable Auto-load XML for each page in the Export Options ... of the PowerPac Menu.
    Menu.png
    PowerPac Export Options Menu with Auto-load XML checked
    Menu.png (36.44 KiB) Viewed 22532 times

    Then, for each page of your application that you want load an XML configuration file create an XML file which matches the page name that it is designed to configure. (e.g.: For a page named "Question_1" create the xml file "Question_1.xml") For best results, your pages should be named without spaces in their names.
      NOTE: After each page XML has loaded, a user event is sent to the page for notification purposes. The [value] parameter of the user even will equal the XML document object. All page XML files are cached for rapid reloading during page navigation.
In order to autoload an XML file when the book loads, name an XML file "tbk.xml" or "book.xml" (it is the developer's preference on xml name but you must use one or the other). When the book loads, the "tbk.xml" or "book.xml" will execute before the first page of the application loads.

Of course, you can use the PowerPac function XMLHttpRequest() to load your XML files at any time or in connection with any event. You can also use the function within an XML file to chain load mutiple XML files at the same time.

Have FUN!
:P
Clifton
Site Admin
 
Posts: 731
Joined: Tue Jan 14, 2014 1:04 am

Return to XML Configurations – Plugin Examples

Who is online

Users browsing this forum: No registered users and 1 guest

cron