UNC-Libraries / jquery.xmleditor

jQuery based XML editor plugin.
153 stars 71 forks source link

Cannot read property 'name' of undefined when trying to load the schema #53

Closed ruchidalal closed 7 years ago

ruchidalal commented 9 years ago

I want to edit my xml using this plugin. However, when trying to read the xsd:

var extractor = new Xsd2Json("hl7.xsd", {"schemaURI":"/assets/Admin/xsd/", "rootElement": "hl7"});

it gives me this error: Cannot read property 'name' of undefined when trying to load the schema I have validated the schema and looks good. On debug found that it is failing in this fucntion: setOriginatingRoot in schema_manager. Any suggestions ?

bbpennel commented 9 years ago

Hi ruchidalal,

My first suggestion would be to try loading it without the rootElement option specified. Could you try that and let me know if it gives the same error?

var extractor = new Xsd2Json("hl7.xsd", {"schemaURI":"/assets/Admin/xsd/"});

ruchidalal commented 9 years ago

Hi, I tried var extractor = new Xsd2Json("hl7.xsd", {"schemaURI":"/assets/Admin/xsd/", "rootElement": null}); in the evening.. This worked for me. I am sure what you r suggesting will work as well. But I cant understand the reason here. Also, to give you a background, I am not populating the entire xml in xmleditor, it should allow me to edit only the selected tag in editor(This way I have will have a different root every time). Could this be the reason ?

Thanks