Computer software applications allow users to create a variety of documents to assist them in work, education, and leisure. For example, popular word processing applications allow users to create letters, articles, books, memoranda, and the like. Spreadsheet applications allow users to store, manipulate, print, and display a variety of alphanumeric data. Such applications have a number of well-known strengths including rich editing, formatting, printing, calculation, and on-line and off-line editing.
Unfortunately for users, documents received by users may contain unnecessary or unwanted executable code embedded in the document. For example, a possible problem for computer and computer software users is receiving a document containing a “virus” in the form of an embedded executable code that executes when the user opens the document or performs some action in the document and which may cause harm to the user's document or to the user's computer software applications or computer hardware, or result in otherwise undesirable behavior. In word processor documents represented using an Extensible Markup Language (XML)-based file format, executable code can be located in various places, and finding such executable code in a fast and efficient manner becomes challenging. Due to its flexibility, XML has the ability to represent the same data in a virtually infinite number of ways. Accordingly, XML data representing executable code embedded in a document may be defined or represented in a number of different ways which makes locating the executable code difficult and time consuming. For example, XML supports the ability to encode text so that characters do not appear in their literal form, but which must be converted according to certain rules or according to an entity definition possibly existing elsewhere in the file. The definition for converting the coded text itself possibly refers to other components or entities with individual definitions existing in yet other places within the file or even existing in locations remote from the document or file.
Additionally, executable code may be placed almost anywhere in the XML file provided that it follows the rules associated with the XML structure of the file. This means that in order to find the executable code, a parsing or consuming application must first parse all the elements of the file prior to the embedded executable code. Ultimately, such a process may find the executable code within the XML formatted file, but the performance of the process is very slow, if not unacceptable, in environments where speed is critical, particularly in the case of virus checking prior to application or document startup, for example when the file is processed by an email server or an Internet gateway.
It is with respect to these and other considerations that the present invention has been made.