Skip to content
New issue

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

Could not be unmarshalled #246

Open
dishant2612 opened this issue Oct 26, 2020 · 0 comments
Open

Could not be unmarshalled #246

dishant2612 opened this issue Oct 26, 2020 · 0 comments

Comments

@dishant2612
Copy link

dishant2612 commented Oct 26, 2020

Hello,

I tried the jsonix PO example, it works fine with marshalling and unmarshalling.

When I try to implement it in my use case I am getting the following error
Error: Element [{http://www.w3.org/2001/XMLSchema}xsd:schema] could not be unmarshalled as is not known in this context and the property does not allow DOM content.

Steps:

  1. created INVOICE.js in mappings folder using below command
    java -jar \lib\jsonix-schema-compiler-full-2.3.9.jar -d mappings -p INVOICE https://docs.oasis-open.org/ubl/os-UBL-2.1/xsd/maindoc/UBL-Invoice-2.1.xsd

  2. stored the same xsd (https://docs.oasis-open.org/ubl/os-UBL-2.1/xsd/maindoc/UBL-Invoice-2.1.xsd) as an example in invoice.xml

const Jsonix = require('jsonix').Jsonix,
    INVOICE = require('../mappings/INVOICE'),
    context = new Jsonix.Context([INVOICE]),
    unmarshaller = context.createUnmarshaller();

unmarshaller.unmarshalFile('../mappings/invoice.xml',
    function (unmarshalled) {
        console.log(unmarshalled.value.cac:InvoicePeriod.cbc:StartDate);
    });

Any help will be highly appreciated. Thanks

PS: code jsonixInvoice for reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant