-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
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
XML support #2488
Comments
There is #2471, however it seems a bit questionable whether it will be part of std |
While this might not be the answer you're looking for, most DOM parsers are able to parse XML as well: import { DOMParser } from "https://esm.sh/[email protected]";
const xml = `
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
`;
const document = new DOMParser().parseFromString(xml, "text/xml");
const to = document.querySelector("to").innerText;
const from = document.querySelector("from").innerText;
console.log("To: " + to + ", from: " + from); // => "To: Tove, from: Jani" |
I feel like there should be a decision made by either the core team or the community on whether or not XML parsing should be in std. My sense is that it is overly complicated and there are already /x/ libraries for it, but I'm curious to hear from not just myself. |
I'm -1 on this. I don't see a benefit of a implementation in std if existing third party modules work great. I've used a couple of them before. |
@iuioiua do you have a few that you'd like to recommend here? I know I'm personally not super excited at the thought of maintaining an XML library unless absolutely necessary 😄 |
I'm going to close this out based on the feedback in #2471, as well as the availability of third party modules. |
XML is common. It would be nice if the standard library could support XML to JS and some JS to XML.
Is your feature request related to a problem? Please describe.
Just like: #231, #431
Describe the solution you'd like
https://www.npmjs.com/package/xml2js
Describe alternatives you've considered
The text was updated successfully, but these errors were encountered: