You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem occurs if purchaseClass is not included. In this case, the converted javascript object looks like this, where the Purchase property is a string rather than an object:
Purchase: 'Test_Purchase'
Here is the example, where the purchaseClass property is optional.
arrayAccessForm is a config property that allows you to identify arrays in your XML. Is there a similar concept for objects with optional properties to avoid having the issue described above?
The text was updated successfully, but these errors were encountered:
I have XML which contains a
Purchase
which has an optional attribute calledpurchaseClass
.So the XML could look like this:
or this:
Test_Purchase
I'm using the following code to convert the above XML string into JS:
This works as expected when the
purchaseClass
attribute and the inner text is specified. The resulting converted JS object looks like this:The problem occurs if
purchaseClass
is not included. In this case, the converted javascript object looks like this, where thePurchase
property is a string rather than an object:Here is the example, where the
purchaseClass
property is optional.arrayAccessForm
is a config property that allows you to identify arrays in your XML. Is there a similar concept for objects with optional properties to avoid having the issue described above?The text was updated successfully, but these errors were encountered: