Documentation
The Turtlebite Online XML Editor is available in english and german.
For the time being it is provided as a hosted service and as a desktop application.
Naming nodes
When you enter a node name, it is not possible to type "bad" characters like äöüéàè+"*ç%&/?! etc. Also, the node name must not start with a number, punctuation characters or «xml». This is all taken care of automatically.
Tip: To rename a node, you can also double-click on the node name in the attribute section.
Opening and closing child nodes
Tip: If you want to open or close all child nodes of a node, hold down the SHIFT key while clicking on the open/close triangle.
Drag and copy a node
Tip: If you hold down the SHIFT key while dragging a node to a new place, the node is copied instead of moved. (The indicator color will change to give you feedback).
Scrolling while dragging a node
When you drag a node which has to be placed outside of the visible area just drag it over the arrow, it will then start to scroll. You can accelerate the speed of the scrolling by dragging the node more towards the bottom border to scroll down or towards the top border to scroll up. If there is no need to scroll no arrows will appear.
Manage Attributes
Once you have added an attribute by clicking on the "Add Attribute" button, you can also use the context menu. Select an attribute and use right-click on the mouse to add, duplicate or delete an attribute. If you want to re-order the attributes, just drag and drop them around. Please notice that the first attribute value is also displayed on the node itself for your convenience. Double-click on the name or value to edit the content. It is not possible to use "bad" characters like äöüéàè+"*ç%&/?! etc. in the attribute name.
XML output
After editing, you will end up with a plain xml file. In the XML output window you can see what it looks like. Every change you do is updated in realtime in the XML output window. Please use «Highlight Syntax» wisely: if your document gets larger, it will eventually take some time to process the highlighting.
JSON output
Need JSON? Simply export the XML data as JSON. When you save XML files online, you can have JSON exported on the fly by enabling it in the «Settings». It will then be saved in a directory named «json» which is in the same place as your XML files. If you want to see what the JSON data will look like in a pretty format, open the output window under «Window» > «JSON output».
Rich Text Editor
You can also edit and save text as rich text within a text node. Later you will use CSS to style your text. 8 special classes are provided:
- Normal: .txe_normal
- Bold: .txe_bold
- Italic: .txe_italic
- Small: .txe_small
- 4 Titles: .txe_t1, .txe_t2, .txe_t3, txe_t4
A extra PHP class is included for easy XML parsing. Here is a code example:
<?php
// load class
require_once ('TxeXmlReader.php');
// load xml file
$txeXmlReader = new TxeXmlReader('richtext_demo.xml');
// get content of node "someNode"
$pageContent = $txeXmlReader -> getContent('someNode');
?>
Check it out here: Rich Text Demo
I could explain every detail, but it's so much easier if you just download the demo files and analyze them: turtlebite_xml_editor_scripts.zip.
There is really no magic in there. In the end it's just plain xml.
Let's see if we can create files on your server!
- Download and unzip the systemcheck file: turtlebite_xml_editor_systemcheck.zip
- Create a directory on your server where you want your xml files to be later on.
- Upload systemcheck.php into that directory and create 2 more directories inside called «backup» and «json».
-
Start the file in your browser, for example: http://www.your-domain.com/content/your-xml-files/systemcheck.php.
If the systemcheck runs successfully, your directory should look something like this:
Each time a file is saved, a backup file gets created in the backup folder. That way you don't have to worry and can always go back!
Let's shake hands: your Server and xml-editor.kaegi.net
In order for the Turtelbite XML Editor to open and save files on your server it needs permission. You provide this by placing a so called crossdomain xml file in the root of your server. It looks like this:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="xml-editor.kaegi.net"/>
</cross-domain-policy>
Download the file here: crossdomain.xml. (Right click and save as). Then upload it in the root directory of your server.
Upload the Script Files
In fact, you should already have created a directory on your server when you ran the system check. Now you need to upload 4 more files there, listed here:
- txe_list_files.php (used to select a file in the XML editor for editing)
- txe_save_xml_file.php (saves your edited files back to your server)
- txe_save_json_file.php (saves your edited files back to your server in JSON format)
- txe_secu.php (used for security. More about this in Step 4 «Set Script Password»)
Download the 4 files here: turtlebite_xml_editor_scripts.zip.
So, the content of the directory, where your xml files are going to be later on, finally looks like this:
Let the XML Editor know where to look for XML Files
Have a look at the screenshot below: Enter the path to your xml files.
Extra Security: Set Script Password
To make sure that there is no chance to run the Turtlebite XML Editor scripts on your server by anyone else but you,
you can set a script password. «txe_list_files.php», «txt_save_xml_file.php» and «txt_save_json_file.php» all include «txe_secu.php». If the password does not match, the scripts will exit.
Have a look at the screenshot below. Set your script password in the settings panel, then use the same password in «txe_secu.php».
Download the 4 files here: turtlebite_xml_editor_scripts.zip.
Then upload them into the same directory where your xml files are going to be.