TX Text Control ActiveX

Working With XML Files

Topic

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 toRead
See how an XML file, its CSS file and its DTD work togetherXML Basics
Open the sample program of this section and load an XML fileXML Basics
Handle invalid or not well-formed documents and save the CSS fileLoading and Saving XML Files
Know what users can do in the XML editor modeEditing XML Files
Read and change elements in codeProgramming XML Documents
Insert and delete elements in codeProgramming XML Documents

Where to Start

  1. Run the XML Basics sample from the Samples\vb6\XMLBasics sample source directory and read XML Basics alongside it.
  2. Read Loading and Saving XML Files for what happens when a document doesn't match its DTD.
  3. Continue with Editing XML Files and Programming XML Documents.

Pages in This Section