BREAKING CHANGE(core): Implement custom XmlBuilder, remove xmlbuilder2, upgrade fast-xml-parser, update SmartXml API, tests and CI

This commit is contained in:
2025-11-19 20:40:57 +00:00
parent 292e558d51
commit e7f6805eab
14 changed files with 4286 additions and 3012 deletions

View File

@@ -1,4 +1,5 @@
# @push.rocks/smartxml
a package for creating and parsing XML formatted files
## Install
@@ -55,8 +56,8 @@ const noteObject = {
to: 'Tove',
from: 'Jani',
heading: 'Reminder',
body: 'Don\'t forget me this weekend!'
}
body: "Don't forget me this weekend!",
},
};
const smartXml = new SmartXml();
@@ -74,21 +75,21 @@ Let's look at a more complex example that includes XML attributes:
```typescript
const complexObject = {
note: {
"@_id": "12345",
"@_priority": "high",
'@_id': '12345',
'@_priority': 'high',
to: 'Tove',
from: { "@_domain": "personal", "#text": 'Jani' },
from: { '@_domain': 'personal', '#text': 'Jani' },
heading: {
"@_style": "bold",
"#text": 'Reminder'
'@_style': 'bold',
'#text': 'Reminder',
},
body: 'This is a special note for the weekend.'
}
body: 'This is a special note for the weekend.',
},
};
const smartXml = new SmartXml();
const complexXmlString = smartXml.createXmlFromObject(complexObject, {
format: true
format: true,
});
console.log(complexXmlString);
@@ -102,7 +103,7 @@ The `@push.rocks/smartxml` package offers a straightforward and powerful means t
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.