![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
The lightest XML parsing library. Only import the functions that you need.
npm install xml-utils
const getAttribute = require('xml-utils/src/get-attribute');
const xml = `<MDI key="INTERLEAVE">PIXEL</MDI>`;
const key = getAttribute(xml, 'key');
console.log(key);
// INTERLEAVE
const findTagByName = require('xml-utils/src/find-tag-by-name');
const xml = `<Metadata domain="IMAGE_STRUCTURE"><MDI key="INTERLEAVE">PIXEL</MDI></Metadata>`
const tag = findTagByName(xml, 'MDI');
console.log(tag);
will output:
{
outer: "<MDI key="INTERLEAVE">PIXEL</MDI>",
inner: "PIXEL"
}
const findTagsByName = require('xml-utils/src/find-tags-by-name');
const xml = `
<Metadata>
<MDI key="SourceBandIndex">1</MDI>
<MDI key="STATISTICS_MAXIMUM">255</MDI>
<MDI key="STATISTICS_MEAN">96.372431147996</MDI>
<MDI key="STATISTICS_MINIMUM">0</MDI>
<MDI key="STATISTICS_STDDEV">50.057898474622</MDI>
</Metadata>
`;
const tags = findTagsByName(xml, 'MDI');
// will output an array of tags
const findTagByPath = require('xml-utils/src/find-tag-by-path');
const xml = `
<gmd:referenceSystemIdentifier>
<gmd:RS_Identifier>
<gmd:code>
<gco:CharacterString>4326</gco:CharacterString>
</gmd:code>
<gmd:codeSpace>
<gco:CharacterString>EPSG</gco:CharacterString>
</gmd:codeSpace>
<gmd:version>
<gco:CharacterString>6.11</gco:CharacterString>
</gmd:version>
</gmd:RS_Identifier>
</gmd:referenceSystemIdentifier>
`;
const tag = findTagByPath(xml, ['gmd:RS_Identifier', 'gmd:code', 'gco:CharacterString']);
To get an array of tags that follow a path:
const findTagsByPath = require('xml-utils/src/find-tags-by-path');
const tags = findTagByPath(xml, ['Metadata', 'MDI']);
// will output an array of tags
download test files with:
npm run setup
npm run test
Post an issue at https://github.com/DanielJDufour/xml-utils/issues or email the package author at daniel.j.dufour@gmail.com
FAQs
Parse XML without Blowing Up Your Bundle Size
We found that xml-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.