PDA

View Full Version : unterminated string literal with JSON decode



Robert82
12 Nov 2009, 7:10 AM
Hello,

I have the following JSON Object in my php-file


<?php
echo '{
"documents":[
{
"title":"A methodology for quality-based mashup of data sources",
"author":[
"Muhammad Raza",
"Farookh khadeer Hussain",
"Elizabeth Chang"
],
"year":"2008",
"conference":"Proceedings of the 10th International Conference on Information Integration and Web-based Applications & Services ",
"keywords":[
"CCCI metrics",
"mashup",
"quality",
"reputation",
"trust"
],
"abstrakt":"The concept of mashup is gaining tremendous popularity and its application can be seen in a large number of domains. Enterprises using and relying upon mashup have improved their mass collaboration and personalization. In order for mashup technology to be widely accepted and widely used, we need a methodology by which can make use of the quality of the input to the mashup process as a governing principle to carry out mashup. This paper reviews the concept of mashup in different domains and proposes a conceptual solution framework for providing quality based mashup process."
},
{
"title":"Modeling the mashup space",
"author":[
"Serge Abiteboul",
"Ohad Greenshpan",
"Tova Milo"
],
"year":"2008",
"conference":"Proceeding of the 10th ACM workshop on Web information and data management ",
"keywords":[
"data",
"information",
"integration",
" mashup",
"model",
"web"
],
"abstrakt":"We introduce a formal model for capturing the notion of mashup in its globality. The basic component in our model is the mashlet. A mashlet may query data sources, import other mashlets, use external Web services, and specify complex interaction patterns between its components. A mashlet state is modeled by a set of relations and its logic specified by datalog-style active rules. We are primarily concerned with changes in a mashlet state relations and rules. The interactions with users and other applications, as well as the consequent effects on the mashlets composition and behavior, are captured by streams of changes. The model facilitates dynamic mashlets composition, interaction and reuse, and captures the fundamental behavioral aspects of mashups."
},{
"title":"Towards a mashup-driven end-user programming of SOA-based applications",
"author":[
"Tobias Nestler"
],
"year":"2008",
"conference":"Proceedings of the 10th International Conference on Information Integration and Web-based Applications & Services",
"keywords":[
"UI integration",
"lightweight processingn",
"presentation oriented service composition",
" mashup"
],
"abstrakt":"Recent technologies and standards in the field of Service-Orientated Architectures (SOA) have focused on Service-to-Service interaction and do not consider Service-to-User scenarios. This results in a lack of a service-consumer-orientation in order to empower the user to get easy access to the functionalities of services. The paper argues for the need of new concepts that extend existing mashup approaches to enable a more end-user driven application development. It presents an insight into existing mashup technologies and identifies shortcomings concerning the creation of more complex applications. The paper offers ways how to extend the existing concepts and shows their potential as a key technology for an end-user programming in the field of SOA. The empowerment of the actual service consumer can bridge the gap between the user and the service infrastructure."
},
{
"title":"Application framework with demand-driven mashup for selective browsing",
"author":[
"Sohei Ikeda",
"Takakazu Nagamine",
"Tomio Kamada"
],
"year":"2008",
"conference":"Proceedings of the 10th International Conference on Information Integration and Web-based Applications & Services",
"keywords":[
"Ajax",
"web application",
"web service",
"mashup",
"web"
],
"abstrakt":""
}
]
}';
?>


This works, but I have a problem with the last empty abstrakt-string. If I put there some text in, then I get the unterminated string literal error when I use
var json = Ext.util.JSON.decode(data);

The Text looks like the following:

"This paper proposes a mashup framework for creating flexible mashup applications in which the user can selectively browse through mashup items. Our framework provides a data management engine for on-demand data generation, and GUI components called widgets that can be used to browse through mashed-up data selectively. The application developer has to only prepare a mashup relation specifying the web service combinations and widget configurations specifying how to display the mashed-up data. On the basis of these configurations, widgets monitor user interactions and requests data from the data management engine that processes the demand-driven creation of mashed-up data. To enable selective browsing, a table widget, for instance, allows selection of columns to be displayed, provides a limited view with scroll bars, and filtering facilities. Our framework also offers a mechanism for widget coordination where a widget can change the display target according to states or events of other widgets. We introduce a sample application for tour planning using five cooperative widgets, and discuss the usability and performance advantages of our framework."

What is the problem?

hendricd
12 Nov 2009, 8:07 AM
Sounds like you might need to convert CRLF to \n in your text blocks (or a unicode header on your string?)

Snoop the server-response with Firebug and look for oddities.