HTML Attribute Occurrence Duplicate Audit

Audit duplicate attribute occurrences under HTML ASCII name lowercase without parsing a tag or losing duplicates; supplied occurrence indexes remain observable.

Description

Audit duplicate attribute occurrences under HTML ASCII name lowercase without parsing a tag or losing duplicates; supplied occurrence indexes remain observable.

Attribute names that differ only in ASCII case can describe duplicate observations. This audit exposes those collisions without discarding their source positions.

When to use this tool

Audit duplicate attribute occurrences under HTML ASCII name lowercase without parsing a tag or losing duplicates; supplied occurrence indexes remain observable.

  • Prepare the supplied attributesJson fields for this operation.
  • Compare the complete example with the representation used by your own input before carrying the result into another step.

How to use the tool and how it works

  1. Enter attributesJson. Use the exact text syntax, units and index conventions explained below.
  2. Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
  3. Read result.duplicates. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.

Parse attributesJson as name/value objects, reject forbidden name characters and normalize names with ASCII lowercase. Group equal normalized names and report repeated groups with source indexes.1

Input fieldMeaning and representationAccepted input
attributesJsonJSON text, entered as one text field. The decoded structure is illustrated below; it is not a separate file.Text

For the JSON text fields, the following decoded structures show the example records before they are serialized into input strings. Keep field names, list nesting and value types as shown.

json
[
  {
    "field": "attributesJson",
    "decoded": [
      {
        "name": "ID",
        "value": "a"
      },
      {
        "name": "id",
        "value": "b"
      },
      {
        "name": "class",
        "value": "c"
      }
    ]
  }
]
Output fieldInterpretation
resultObject containing the named outputs below.
result.duplicatesThe duplicates list in the ordering and representation described above.
json
{
  "input": {
    "attributesJson": "[{\"name\":\"ID\",\"value\":\"a\"},{\"name\":\"id\",\"value\":\"b\"},{\"name\":\"class\",\"value\":\"c\"}]"
  },
  "output": {
    "result": {
      "duplicates": [
        {
          "key": "id",
          "indexes": [
            0,
            1
          ]
        }
      ]
    }
  }
}

Limitations and assumptions

  • The input is an observation list rather than HTML markup. The audit does not decide which occurrence a consumer should keep.
  • All declared input fields are required and unexpected top-level fields are rejected. Numbers must be finite; lists are limited to 128 entries and ordinary text fields to 8,192 UTF-16 code units, with tighter limits where stated.
  • JSON text inputs must parse within bounded nesting and size limits. Numeric outputs outside the safe finite range are rejected; large exact integer results use decimal strings. Indexes and half-open spans are zero-based unless a rank is explicitly described as one-based.

Alternative or Complementary methods

For actual document behavior, inspect a parsed DOM and the relevant HTML algorithm. These tools transform supplied tokens, observations or coordinates; compare the browser result when parsing or layout matters.

References

  1. Tool behavior and example: HTML Attribute Occurrence Duplicate Audit — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies