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
When creating dynamic documents it's really useful to be able to import a document containing only child elements. Consider:
import { XMLElementOrXMLNode, create, begin } from "xmlbuilder"; const doc = begin(); const boldDoc = create('b'); boldDoc.text('Hello World'); doc.importDocument(boldDoc); const main = create('p'); main.importDocument(doc); console.log(main.toString());
I would expect this to result in XML document
<p><b>Hello World</b></p>
Instead I get an error: Cannot read property 'clone' of undefined (/node_modules/xmlbuilder/lib/XMLNode.js:569:32).
Cannot read property 'clone' of undefined
/node_modules/xmlbuilder/lib/XMLNode.js:569:32
doc is not undefined:
doc
console.log(doc.toString()); // <b>Hello World</b>
However doc.root() returns undefined, causing the issue.
doc.root()
Not sure if this is a bug or not, but reading the docs this is not what I was expecting :/
The text was updated successfully, but these errors were encountered:
Certainly a bug. I'll take a look. Thank you.
Sorry, something went wrong.
Add test case for #213
3c92647
Fix variable name for #213 test
95ea49d
Fix argument order for #213 test
fb85176
4d16ed1
No branches or pull requests
When creating dynamic documents it's really useful to be able to import a document containing only child elements. Consider:
I would expect this to result in XML document
Instead I get an error:
Cannot read property 'clone' of undefined
(/node_modules/xmlbuilder/lib/XMLNode.js:569:32
).doc
is not undefined:However
doc.root()
returns undefined, causing the issue.Not sure if this is a bug or not, but reading the docs this is not what I was expecting :/
The text was updated successfully, but these errors were encountered: