adzapper   adzapper Home | About Adzapper | Installing | Zaplets | Zaplet File Format | Zaplet Updates Python Powered  

Zaplet file format XML DTD

Version 0.9

This document specifies the zaplet file format using an XML v1.0 DTD.

 

<!ELEMENT zaplet (version, host, (enabled | modified | repository | comment)*, 
                                 (block_url | allow_url | block_popups | filter)* )>

<!ELEMENT version                       (#PCDATA)>
<!ELEMENT host                          (#PCDATA)>
<!ELEMENT enabled                       (#PCDATA)>
<!ELEMENT modified                      (#PCDATA)>
<!ELEMENT repository                    (#PCDATA)>
<!ELEMENT comment                       (#PCDATA)>

<!ELEMENT filter (filter_match_url, filter_match_text, filter_replace_text)>

<!-- type is either "regex", "literal", or "everything" -->

<!ELEMENT allow_url                      (#PCDATA)>
<!ATTLIST allow_url type           CDATA #REQUIRED>

<!ELEMENT block_url                      (#PCDATA)>
<!ATTLIST block_url type           CDATA #REQUIRED>

<!ELEMENT block_popups                   (#PCDATA)>
<!ATTLIST block_popups type        CDATA #REQUIRED>

<!ELEMENT filter (filter_match_url, filter_match_text, filter_replace_text>
<!ELEMENT filter_match_url               (#PCDATA)>
<!ATTLIST filter_match_url type    CDATA #REQUIRED>

<!ELEMENT filter_match_text              (#PCDATA)>
<!ATTLIST filter_match_text type   CDATA #REQUIRED>

<!ELEMENT filter_replace_text            (#PCDATA)>

Semantics

The attribute 'type' can be 'literal', 'regex', or 'everything'. When 'type' is 'everything', the contents of the 'block_url', 'allow_url', or 'filter_match_url' can be empty- this will cause all URLs to match. Only 'literal' and 'regex' are allowed for 'filter_match_text'.

When 'type' is 'regex', the contents of the tag are interpreted as a Perl-style regular expression, as specified by the Python re module documentation. For more information, see http://www.python.org/doc/current/lib/module-re.html

The tag 'comment' can contain a comment; it is ignored by adzapper.

The tags 'enabled', 'modified', and 'repository' are reserved for future use.

'block_url' specifies a range of URLs to block- a predefined piece of content, usually a transparent GIF, is returned instead. The entire URL is used as a target for the regular expression or literal to determine matching.

'allow_url' specifies a range of URLs to allow, even if they would otherwise be blocked by block_url statements. As with the 'block_url' statement, the entire URL is used as a target.

'block_popups' specifies a range of URLs to filter out java window.open() calls from. As with 'block_url', the entire URL is used as the target.

'filter_match_url' specifies the range of URLs to apply the filter to, the entire URL is used as the target. 'filter_match_text' specifies the text of an html (or xml or text) page to apply the filter to. 'filter_replace_text' is a literal string that the matching text will be replaced with.

 

Notes:

1. For more information on XML and XML Document Type Definitions (DTDs), please see the W3C website: http://www.w3.org/XML/


 

adzapper Home | About Adzapper | Installing | Zaplets | Zaplet File Format | Zaplet Updates


Adam Feuer
adamf at pobox.com (replace the 'at' with '@' to contact me via email)
Last modified
http://www.zaplet.org | sitemap