`id` function is not compliant to the spec
- Dominant language
- TypeScript
- Stars
- 38
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
As per the spec, `id` function selects elements by their unique ID and attribute for unique ID is declared using DTD.
Q. If no DTD is defined then is `id` attribute implicitly considered as unique ID of the element node?
Following test fails, because we are not handling DTD at this moment, right?
```
it.only('adhoc tests', () => {
const testDocument = xml`
]>
Some content
Another content
`;
const evaluator = new Evaluator({rootNode: testDocument});
const actual = evaluator.evaluate(`count(id('first second'))`);
expect(actual.numberValue).toBe(2);
})
```
This issue probably just needs documentation.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the supplied adhoc test and trace Evaluator.evaluate for the XPath id() call. Check the cited specification and the project's current DTD handling; done means documenting whether id attributes require DTD declarations and clarifying the expected result for this test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100