TextPipe: Online Help
    Restrict to tag/attribute
 

Submit feedback on this topic 

 Home  User Assistance   Tutorials   How to Use TextPipe
 Menus: File   Edit   Filters[ Wizards  Convert   Unicode   Add   Remove   Replace   Extract   Special   Maps   Restrict ]  Tools   Window   Help   Advanced
Home
Up

 

 

This filter can be used to restrict a sub filter to just a small fragment of HTML or XML.

Restriction Type Example Possible use
Restrict to tag <table> <table height="10" width="20"> .... </table>  
 - with Include the entire tag checked <table height="10" width="20"> .... </table> Just add a Remove All sub filter to remove the tag entirely
Restrict to attribute 'height' <table height="10" width="20"> .... </table>  
 - with Include the quotes checked <table height="10" width="20"> .... </table>  
 - with Include the attribute name checked <table height="10" width="20"> .... </table> Just add a Remove All sub filter to remove the attribute entirely
Restrict to between tags <table> and </table> <table height="10" width="20"> .... </table>  
- with Include the start and end tag checked <table height="10" width="20"> .... </table> Just add a Remove All sub filter to remove the tag entirely

If your tag or attribute is not in the list, just type it in.

Note:

  • This filter copes with single and double quotes, and escaped quotes (either doubled or escaped with backslash)
  • This filter copes with angle brackets within single and double quotes
  • <!-- --> comment tags are handled specially. Comment tags can have ANY text inside them - quotes are not matched
  • <!DOCTYPE > tags are handled specially to allow for included DTDs enclosed in []
  • <!CDATA[ ... ]]> tags are handled specially to allow for any text within the square brackets
  • This filter will match a maximum of 4KB of text, so if your tags have more than 4KB of text between them you'll have to use a search/replace filter as the restriction instead.

 

Type 1. Restrict to tag

This filter restricts sub filters to operate on just the text of a single tag. If your tag is not in the list, just type it in.

Include the entire tag

When checked, the entire tag is passed to the sub filter, not just the text after the tag name. Normally this is not required as the existing tag is being edited. If you want to remove the entire tag, then check this field, and add a Remove All sub filter.

Type 2. Restrict to attribute

This filter restricts sub filters to operate on just the text within the given tag. Normally this filter is inside a Restrict to tag filter e.g. 'Restrict to tag <table...>', sub filter of 'Restrict to attribute height="..."', sub filter of search and replace. If your attribute is not in the list, just type it in.

Include the quotes

When checked, the surrounding single or double quotes (if any) are also sent to the sub filter. Normally they are not required as the existing value is being edited. If you want to remove the entire attribute, then check this field and the next field, and add a Remove All sub filter.

Include the attribute name

When checked, the actual attribute name and the equals sign are also sent to the sub filter. Normally they are not required as the existing value is being edited. If you want to remove the entire attribute, then check this field and the previous field, and add a Remove All sub filter.

Type 3. Restrict to between tags

This filter restricts sub filters to operate on just the text between the given tag pairs (which need not match). If your tag is not in the list, just type it in.

Include the start and end tag

When checked, the actual start and end tags are also sent to the sub filter. Normally they are not required as the existing value is being edited. If you want to remove the start and end tag and all text between them, then check this field, and add a Remove All sub filter.


Options

The following options apply to ALL the restriction types above:

Match case

When checked, the tag name must match the case of the name exactly. Normally this is checked for XML, which is case-sensitive, and unchecked for HTML, which is not case-sensitive.

Maximum match size

If you find that the filter is not matching all occurrences of the HTML or XML you're trying to find, increase the maximum match size so that it is larger than the maximum amount of text you expect to find. The default value is 32768 bytes (32K).

 

See also

Remove duplicate lines
Count duplicates
Randomize lines
Restriction filters

 Contact Us   Support   Community   Tutorials and User Guides (online)
 Copyright © 1999-2006 DataMystic. All rights reserved.