workspace.xmlWriteExamples
This is a fat page containing workspace.xmlWriteExamples.
It visits every cell in system.verbs.builtins.xml.examples, and for each cell called taggedText, it creates a file in a folder on your system disk called xml examples. It creates the folder if it doesn't exist.
I wrote this script because I'm preparing to test Frontier's XML compatibility with Microsoft's XML Notepad mini-app. Now that we have something to test against, it's a good time to explore compatibility issues. After all the point of XML is to be compatible with other software.
Listing
Here's a listing of the script:
local (adrtable = @system.verbs.builtins.xml.examples) |
local (folder = file.getSystemDisk () + "xml examples" + file.getPathChar ()) |
file.sureFolder (folder) //create the folder if it doesn't exist |
| if string.lower (nameOf (adr^)) != "taggedtext" //only write out objects called taggedText |
| return (true) |
| local (f = folder + nameOf (parentOf (adr^)^) + ".xml") //it gets its name from its parent |
| msg (f) //display the file name in the About Frontier window |
| file.writeWholeFile (f, string (adr^)) |
| return (true) |
table.visit (adrtable, @visit) |
Screen shot
Here's a screen shot of the table we traverse.
|