Description
Construct caller data-* names and escaped values with optional uppercase controls, comparing source and parsed name checks and raw lexical round trips without a DOM dataset claim.
A protocol fixture is local test data representing headers, messages, identifiers, or request decisions. Serialization and parsing can be checked without contacting a server, while authentication, delivery, and actual client behavior require separate tests.
Construct caller data-* names and escaped values with optional uppercase controls, comparing source and parsed name checks and raw lexical round trips without a DOM dataset claim.
When to use this tool
Use this generator to create reproducible data attribute round trip fixture cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply suffixes, values, uppercaseControl, count in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read cases. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Build data-attribute names from supplied suffixes, optionally uppercase the source spelling, escape values, and delegate lexical start-tag parsing. Compare the original name check with the parser-normalized name check while verifying the raw encoded value survives.1
Delegated operations used for this result: data attribute naming validator. Their calculation or parsing conventions apply to the corresponding result fields.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| suffixes | Suffixes | Required. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 32. |
| values | Values | Required. Array of Text; maximum UTF-16 length 256.; minimum items 1; maximum items 32. |
| uppercaseControl | Uppercase Control | Required. Boolean. |
| count | Count | Required. Safe integer; minimum 1; maximum 32. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| cases | Cases | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 32. |
| cases[].sourceName | Source Name | Required. Text; maximum UTF-16 length 256. |
| cases[].originalValue | Original Value | Required. Text; maximum UTF-16 length 256. |
| cases[].encodedValue | Encoded Value | Required. Text; maximum UTF-16 length 2048. |
| cases[].tag | Tag | Required. Text; maximum UTF-16 length 131072. |
| cases[].parsedName | Parsed Name | Required. Text; maximum UTF-16 length 256. |
| cases[].parsedValue | Parsed Value | Required. Text; maximum UTF-16 length 2048. |
| cases[].sourceCheck | Source Check | Required. Object; no unknown keys. |
| cases[].sourceCheck.valid | Valid | Required. Boolean. |
| cases[].sourceCheck.datasetKey | Dataset Key | Required. Text. |
| cases[].parsedCheck | Parsed Check | Required. Object; no unknown keys. |
| cases[].parsedCheck.valid | Valid | Required. Boolean. |
| cases[].parsedCheck.datasetKey | Dataset Key | Required. Text. |
| randomness | Replay source and normalized 32-bit seed, or null seed for an advancing context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional safe-integer replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"suffixes": [
"item-count",
"user-id"
],
"values": [
"A&B",
"x\"y"
],
"uppercaseControl": true,
"count": 1,
"seed": 42
},
"output": {
"cases": [
{
"sourceName": "DATA-USER-ID",
"originalValue": "A&B",
"encodedValue": "A&B",
"tag": "<div DATA-USER-ID=\"A&B\">",
"parsedName": "data-user-id",
"parsedValue": "A&B",
"sourceCheck": {
"valid": false,
"datasetKey": ""
},
"parsedCheck": {
"valid": true,
"datasetKey": "userId"
}
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Parsed lexical values retain entity spellings instead of decoding DOM dataset values. Uppercase source and lowercase normalized checks can differ; this does not validate application data, execute HTML, or inspect a browser.
- A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random Form URLencoded Round-Trip Corpus Generator
Construct ordered form fields from supplied strings and retain exact UTF-8 form encoder and decoder round-trip expectations.
- Random CSV Long and Wide Round-Trip Fixture Generator
Construct a complete entity/measure grid with planted duplicate observations, explicitly sum duplicates, reshape to fixed-header wide CSV and unpivot the aggregate answer using reviewed CSV converters.