We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We currently require our consumers to coerce and validate their attributes themselves within their converter callbacks.
It may be beneficial to coerce the type of each XML node attribute value for use within a converter callback.
e.g.,
<Party> <Person name="Mary" age="20" ready="true" /> </Party>
const xmlToReact = new XMLToReact({ Person: convertPerson }); function convertPerson (attributes) { typeof attributes.name; // 'string' typeof attributes.age; // 'string' typeof attributes.ready; // 'string' return { type: 'div', props: attributes }; }
The value of each XML node attribute is a string. If we coerce each the type of each value, we would instead the following:
function convertPerson (attributes) { typeof attributes.name; // 'string' typeof attributes.age; // 'number' typeof attributes.ready; // 'boolean' return { type: 'div', props: attributes }; }
for boolean attributes, we should consider HTML's approach
related: #16 (comment)
The text was updated successfully, but these errors were encountered:
I was thinking we'd:
'undefined'
JSON.parse()
anything else? XML doesn't have implicit boolean attributes like HTML (or am i crazy?)
Sorry, something went wrong.
No branches or pull requests
We currently require our consumers to coerce and validate their attributes themselves within their converter callbacks.
It may be beneficial to coerce the type of each XML node attribute value for use within a converter callback.
e.g.,
The value of each XML node attribute is a string.
If we coerce each the type of each value, we would instead the following:
for boolean attributes, we should consider HTML's approach
related: #16 (comment)
The text was updated successfully, but these errors were encountered: