
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
xml-path-resolver
Advanced tools
This npm module is used to convert xml to json after resolving the cross reference.
The cross reference keys in xml can be identified by the regex .If crossRefKey is not mentioned, default value would be "id".
npm i xml-path-resolver
const xmlPathResolver = require("xml-path-resolver");
const xmlString = `
<?xml version="1.0" encoding="utf-8"?>
<note id="1212" importance="high" logged="true" x_note="23">
<title>Happy</title>
<todo>Work</todo>
<todo>Play</todo>
</note>
<note id="23" importance="high" logged="true">
</note>
<note importance="high" logged="true">
</note>
<person x_note="1212">
</person>
`;
const resolvedJSON = xmlPathResolver(xmlString,{ crossRefKey: "id", crossReference: /x_(.*)/ });
Example :
<?xml version="1.0" encoding="utf-8"?>
<note id="1212" importance="high" logged="true" x_note="23">
<title>Happy</title>
<todo>Work</todo>
<todo>Play</todo>
</note>
<note id="23" importance="high" logged="true">
</note>
<note importance="high" logged="true">
</note>
<person x_note="1212">
</person>
The above xml has cross reference paths, The resolved JSON output is
{
"_declaration": {
"_attributes": {
"version": "1.0",
"encoding": "utf-8"
}
},
"note": [
{
"_attributes": {
"id": "1212",
"importance": "high",
"logged": "true",
"x_note": {
"_attributes": {
"id": "23",
"importance": "high",
"logged": "true"
}
}
},
"title": {
"_text": "Happy"
},
"todo": [
{
"_text": "Work"
},
{
"_text": "Play"
}
]
},
{
"_attributes": {
"id": "23",
"importance": "high",
"logged": "true"
}
},
{
"_attributes": {
"importance": "high",
"logged": "true"
}
}
],
"person": {
"_attributes": {
"x_note": {
"_attributes": {
"id": "1212",
"importance": "high",
"logged": "true",
"x_note": {
"_attributes": {
"id": "23",
"importance": "high",
"logged": "true"
}
}
},
"title": {
"_text": "Happy"
},
"todo": [
{
"_text": "Work"
},
{
"_text": "Play"
}
]
}
}
}
}
FAQs
Resolves xml paths even with cross reference
The npm package xml-path-resolver receives a total of 1 weekly downloads. As such, xml-path-resolver popularity was classified as not popular.
We found that xml-path-resolver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.