Working With XML Files
If your application edits structured data such as address lists, the XML features of TX Text Control Enterprise let users work on XML files in the word processor while a DTD keeps the structure valid. TXTextControl opens an XML file, displays it with the formatting of a CSS style sheet and gives your code access to every element.
The pages below start with a Visual Basic sample that opens an XML file together with its CSS style sheet and DTD, and go on to the properties and methods for loading, saving, editing and programming XML documents.
How XML Documents Work in TX Text Control
- Three files describe an XML document: the XML file holds the data, the CSS file its formatting and the DTD, the document type definition, the elements it may contain and their order.
- Loading with the Load method validates the document against its DTD. A valid document is opened in the XML editor mode, which keeps it valid while it is edited.
- Your code reaches the elements through the XMLElements property and the XMLElement object.
Find the Right Page
| If you want to | Read |
|---|---|
| See how an XML file, its CSS file and its DTD work together | XML Basics |
| Open the sample program of this section and load an XML file | XML Basics |
| Handle invalid or not well-formed documents and save the CSS file | Loading and Saving XML Files |
| Know what users can do in the XML editor mode | Editing XML Files |
| Read and change elements in code | Programming XML Documents |
| Insert and delete elements in code | Programming XML Documents |
Where to Start
- Run the XML Basics sample from the Samples\vb6\XMLBasics sample source directory and read XML Basics alongside it.
- Read Loading and Saving XML Files for what happens when a document doesn't match its DTD.
- Continue with Editing XML Files and Programming XML Documents.
Pages in This Section
- Loading and Saving XML Files: validation, load errors and saving the CSS file.
- Editing XML Files: the XML editor mode, formatting styles and the XML combo boxes.
- Programming XML Documents: reading, setting, inserting and deleting elements.
- XML Basics: the sample program with its XML file, CSS file and DTD.