-
Notifications
You must be signed in to change notification settings - Fork 181
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
RangeError: Maximum call stack size exceeded #21
Comments
I tested the original xml file I had and converted it into json, it comes with "_attributes", after adjusting the json file, it solved the problem. |
@yverenoir |
@yverenoir Can you please explain more about the cause of this issue here? Cause I run into the same issue. Thanks a lot ; ) |
@bidiu , you probably missing Using, the above json input provided by @yverenoir will not work as it is missing {
"vertical": {
"-display_name": {
"_text": "Exercise"
},
"html": {
"-url_name": {
"_text": "12345"
}
},
"lti_consumer": {
"-url_name": {
"_text": "12345"
},
"-xblock-family": {
"_text": "xblock.v1"
},
"-accept_grades_past_due": {
"_text": "false"
},
"-weight": {
"_text": "14.0"
},
"-has_score": {
"_text": "true"
},
"-display_name": {
"_text": "Exercise"
},
"-ask_to_send_username": {
"_text": "true"
},
"-ask_to_send_email": {
"_text": "true"
},
"-button_text": {
"_text": "Launch Exercise"
},
"-custom_parameters": {
"_text": "none"
},
"-lti_id": {
"_text": "id"
},
"-launch_target": {
"_text": "new_window"
},
"-launch_url": {
"_text": "url"
}
}
}
} Which will produce this result: <vertical>
<-display_name>Exercise</-display_name>
<html>
<-url_name>12345</-url_name>
</html>
<lti_consumer>
<-url_name>12345</-url_name>
<-xblock-family>xblock.v1</-xblock-family>
<-accept_grades_past_due>false</-accept_grades_past_due>
<-weight>14.0</-weight>
<-has_score>true</-has_score>
<-display_name>Exercise</-display_name>
<-ask_to_send_username>true</-ask_to_send_username>
<-ask_to_send_email>true</-ask_to_send_email>
<-button_text>Launch Exercise</-button_text>
<-custom_parameters>none</-custom_parameters>
<-lti_id>id</-lti_id>
<-launch_target>new_window</-launch_target>
<-launch_url>url</-launch_url>
</lti_consumer>
</vertical> For more discussion on why Please let me know if this solves the issue you are facing. |
There is another reason why you might get this error: If the text value should appear in the attributes of the xml node rather than its body, then Thus, @yverenoir has probably used this input to solve his problem: {
"vertical": {
"_attributes": {
"-display_name": "Exercise"
},
"html": {
"_attributes": {
"-url_name": "12345"
}
},
"lti_consumer": {
"_attributes": {
"-url_name": "12345",
"-xblock-family": "xblock.v1",
"-accept_grades_past_due": "false",
"-weight": "14.0",
"-has_score": "true",
"-display_name": "Exercise",
"-ask_to_send_username": "true",
"-ask_to_send_email": "true",
"-button_text": "Launch Exercise",
"-custom_parameters": "none",
"-lti_id": "id",
"-launch_target": "new_window",
"-launch_url": "url"
}
}
}
} Which will produce this xml output: <vertical -display_name="Exercise">
<html -url_name="12345"/>
<lti_consumer -url_name="12345" -xblock-family="xblock.v1" -accept_grades_past_due="false" -weight="14.0" -has_score="true" -display_name="Exercise" -ask_to_send_username="true" -ask_to_send_email="true" -button_text="Launch Exercise" -custom_parameters="none" -lti_id="id" -launch_target="new_window" -launch_url="url"/>
</vertical> |
@nashwaan Thank you so much for replying and following up. Yes, the cause of my problem is exactly what you said. Right now I solved it. For the record, what I was trying to do is to convert xml to js (compact version), and then process the js a little, and finally convert it back to xml. The problem is that I set some texts to the js directly. However, I should set the text to "_text" property instead. Thank you once again. The issue could be closed now I think. |
Hi,
I am trying to parse json to xml (both in code with
json2xml
and with cli), but it gives me this error:The original json file is:
I would be grateful for any insights!
Thanks!
Yve
The text was updated successfully, but these errors were encountered: