We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

LINQ Reporting Engine - Which characters are not allowed in JsonDataSource?

If the name of a JSON object starts with a @ then the JsonDataSource constructor fails with

java.lang.IllegalStateException: There is an error on reading the JSON. Cannot get an XML string value from token type '1'. Path 'customers.@label', line 1, position 26.

Are there any other characters that are not allowed for the JsonDataSource?

My example program:

public class AsposeTestCase {

    public static void main(String[] args) throws Exception {
        String jsonAsString = createJsonAsString();
        new JsonDataSource(new ByteArrayInputStream(jsonAsString.getBytes(UTF_8)));
        System.out.println("Testcase finished successfully");
    }

    private static String createJsonAsString() {
        return "{\"customers\": {\"@label\": {\"name\" : \"name-of-the-group\"}}}";
    }
}

I tested the above test case with aspose-words:22.12

@bottemav

The set of allowed characters is essentially the same as for XML element names. Please check the official reference.