highsource / highsource/jsonix

Expected start or end tag when unmarshalling

Open
#223 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
369
Forks
85
PR merge metrics
No merged PRs in 30d

Description

I'm currently assessing jsonix as a component for an open souce capability for Enterprise Models visualisation.
From an XML schema, I created the P0 mapping.
I then referenced it for unmarshaling an xml file created according to the schema. But I had the message error indicated in the title.
I tried it with a simpler schema, but had the same error message.
I've difficulties interpreting where the problem comes from.
Error message is the following:
`/Users/nicolasfigay/node_modules/jsonix/jsonix.js:1298
throw new Error('Expected start or end tag.');
^

Error: Expected start or end tag.
at Object.nextTag (/Users/nicolasfigay/node_modules/jsonix/jsonix.js:1298:10)
at Object.unmarshalDocument (/Users/nicolasfigay/node_modules/jsonix/jsonix.js:2129:9)
at /Users/nicolasfigay/node_modules/jsonix/jsonix.js:2099:18
at /Users/nicolasfigay/node_modules/jsonix/jsonix.js:164:8
at Object.handleTransport (/Users/nicolasfigay/node_modules/jsonix/jsonix.js:309:7)
at transport.onreadystatechange (/Users/nicolasfigay/node_modules/jsonix/jsonix.js:298:13)
at dispatchEvent (/Users/nicolasfigay/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
at setState (/Users/nicolasfigay/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
at handleError (/Users/nicolasfigay/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:532:5)
at ClientRequest.errorHandler (/Users/nicolasfigay/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:459:14)`

Code is the following:
`ar http = require('http');
var fs = require('fs');
var Jsonix = require('jsonix').Jsonix;
var PO = require('./PO.js').PO;

http.createServer(function (req, res) {

// First we construct a Jsonix context - a factory for unmarshaller (parser)
// and marshaller (serializer)
var context = new Jsonix.Context([PO]);

// Then we create a unmarshaller
var unmarshaller = context.createUnmarshaller();

unmarshaller.unmarshalURL('./Model_View.xml',
function (unmarshalled) {
console.log('OK');
});

res.writeHead(200, {'Content-Type': 'text/html'});
res.end('Hello World!');
}).listen(8080);`

Any idea concerning the origin of the error?

Best regards.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.