Functions Returning Locations

  Previous topic Next topic  

These functions return locations. They are often used when generating validation messages so that the proper location in the source document can be highlighted.

location getAttLocation(int exp index)
location getAttLocationForStartTag(int exp index)

Returns the location of an attribute of the tag, specified by the attribute index index. The first attribute has an index of 1. An index of 0 returns the location of the tag name.

Generates an error if the attribute at index does not exist.

getAttLocationForStartTag() is like getAttLocation() but can also be used in an end tag program to get the location of an attribute of the corresponding start tag, specified by the attribute index index; may require that runProgram(21) be used in the start tag name program (New v11.0112)

location getAttValueLocation(int exp index)
location getAttValueLocationForStartTag(int exp index)

Returns the location of an attribute value of an attribute of the tag. index is the index of the attribute whose value to get the location of. The first attribute has an index of 1.

Generates an error if the attribute at index does not exist or if index is 0 or less.

getAttValueLocationForStartTag() is like getAttValueLocation() but can also be used in an end tag program to get the location of an attribute value of the corresponding start tag, specified by the attribute index index; may require that runProgram(21) be used in the start tag name program (New v11.0112)

location getLocation(int exp locid, int exp auxint)

Returns a location based on locid and auxint.

locid - location ID

1 - location of a structure component; auxint is the structure component's ID number

2 - location of the current tag (or comment) with all attributes and values (New v4.9940)

Use 0 for auxint for standard behavior

Use 1 for auxint to include ending spaces (New v5.4910)

Use 2 for auxint to only include ending spaces (New v5.4910)

3 - location of the text referred to in getValueInt(23), getValueString(13), getValueString(30), or getValueString(32); auxint should be 0 (New v5.4930)

4 - location of the last child of the current node; auxint should be 0 (New v5.9920)

5 - location of the current CSS property if available; auxint should be 0 (New v7.9910)

6 - location of the first character of line number auxint (New v7.9910)

7 - location of the bad hyphens after calling checkStringEx(0,5); if not available then returns getLocation(2,1) (New v7.9920)

8 - location of the last child of the current node that is a tag; auxint should be 0 (New v10.0032)

9 - location of the first native CDATA section start text (New v11.0043)

10 - location of the last auxint characters of the current tag (or comment) with all attributes and values (New v11.0111)

As of v4.9940, the flags parameter has been changed to locid.

This function is implemented only in CSE HTML Validator v4.5091 and later.