Home Page   We Generate Your Software.
Products Services Company Technology Demo Contact Site Map Search
The Somusar/SoProTech[tm] Booklet Series
Volume VI

"somusar/Tefigel: Reference Guide"

Printer friendly


Contents
1. Introduction
2. File Sections
3. Commands and Instructions
4. Markers
5. Comments
6. Special Characters
7. Variables
8. Arithmetic Computation
9. Boolean Computation
10. Control Flow
11. Subroutines and Functions
12. Built-in Functions
13. Input and Output
14. Packages and Libraries
15. Tag File Processing
15.1 Purpose
15.2 Usage
15.3 Description
16. CSV File Processing
17. Filters
18. Links and Traps
19. Name Spaces
20. Miscellaneous
21. Further Reading

Chapter 15 - Tag File Processing

15.1 - Purpose        top

Associate Tefigel processors (subroutines) with tag file contents and process a tag file (typically, XML or HTML files).

15.2 - Usage        top

Process a tag file applying corresponding user-defined Tefigel scripts from a given directory:

   [call] tag_file_process(<tag-file>,<subroutine-dir>,<case-sensitive>)

15.3 - Description        top

The built-in subroutine tag_file_process parses the specified <tag-file> and processes its contents through user-defined Tefigel scripts contained in directory <subroutine-dir>. Both <tag-file> and <subroutine-dir> are specified as <file-reference>'s. The optional <case-sensitive> flag, which defaults to 1, can be set to 0 for case-insensitive tag identifiers, such as HTML tags.

When processing <tag-file>, Tefigel calls subroutines from <subroutine-dir> according to the scheme described below. Only available subroutines are called: it is not required to supply all subroutines described below. Missing subroutines will result in Tefigel silently ignoring them.

  1. On entering and exiting the processing of the tag file, Tefigel calls subroutines tag_tree.in and tag_tree.out respectively;

  2. On entering and exiting the processing of each tag node, Tefigel calls subroutines tag_node.in and tag_node.out respectively;

  3. On entering and exiting the processing of a tag node (element) identified by tagId, Tefigel calls subroutines tagId.in and tagId.out respectively;

  4. Input text within one element tagId is processed through subroutines tag_node.tval and tagId.tval;

  5. XML CDATA sections are processed through subroutine tag_cdata;

  6. Comment tags are processed through subroutine tag_comment.

Calls to subroutines 2-4 above are issued only if the current tag matches the tag path search criteria specified by means of variable TARGET_TAG_PATH, which should be set to a regular expression according to the tag nodes of interest. The following variables are automatically set by Tefigel when executing a tag_file_process request:
  1. TAG_MACRO_LIB_PATH is set to the path of <subroutine-dir>;

  2. TAG_PATH is set to the current tag nesting path;

  3. TAG_CONTENTS is set to the source contents of the current tag;

  4. TAG_ID is set to the identifier of the current tag;

  5. Value of each tag attribute tagAttr is assigned to a corresponding variable tp_tagAttr;

  6. Input text within one element is assigned to variable TAG_TEXT;

  7. CDATA text within XML CDATA sections is assigned to variable TAG_CDATA_TEXT;

  8. Each comment tag is assigned to variable TAG_COMMENT_TEXT.

Variables 2-6 in the above list change dynamically with each tag node being processed. All punctuation marks in tag identifiers are converted to underscore _.

[Previous chapter]    [Next chapter]    [Back to top]

http:// www.somusar.com  / doc  / booklets  / tefigel_ref  - Powered by SoProMach
Copyright © 2003-2012 Somusar - Trademarks - Legal - Privacy - Webmaster