highsource / highsource/jsonix

Could not be unmarshalled

Offen
#246 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
369
Forks
85
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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](https://github.com/dishantindept/jsonixInvoice) for reference

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start with mappings/INVOICE.js and mappings/invoice.xml, then reproduce the failure through context.createUnmarshaller() and unmarshalFile(). Compare this case with the working JSONix PO example and the jsonixInvoice reference repository. Done when the supplied invoice.xml unmarshals without the unknown-element error and the callback can access the invoice data.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.