Open sshivananda opened 6 years ago
@sshivananda Unfortunately this is not possible 🤔There would be something like a @Value
annotation needed to mark a property as the value, of course. Basically what #
does for js2xmlparser
.
I am trying to add support for this and would to happy to raise a PR if I succeed - do you have pointers on where I could start
Hey @sshivananda, any help is appreciated 👍 So, here we go: The schema is processed in the XMLElement
model. For instance the attributes (which are defined via @
) are set here: https://github.com/RobinBuschmann/xml-typescript/blob/master/lib/models/XMLElement.ts#L163
Hope this helps!
Robin, I created a modified version which offers a @XMLText decorator (with a single option required). It creates the missing #
key inside the schema consumed by js2xmlparser
.
My local tests were positive.
Are you interested in a PR?
@rzacherl Yes, for sure 👍 Just create the PR so that I can review it
I am trying to model classes that can support mixed content. From the example at https://www.npmjs.com/package/js2xmlparser I could do this with
which gives me an xml
How would I go about doing this using xml-decorators?