highsource / highsource/jsonix

Could not be unmarshalled

オープン
#246 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
JavaScript
スター
369
フォーク
85
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず mappings/INVOICE.js と mappings/invoice.xml から始め、context.createUnmarshaller() と unmarshalFile() を通じて失敗を再現します。このケースを、動作する JSONix PO の例および jsonixInvoice リファレンスリポジトリと比較します。提供された invoice.xml が unknown-element エラーなしでアンマーシャルされ、callback から請求書データにアクセスできれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。