JSON output style
Posted: Thu Aug 25, 2011 4:44 pm
Hi,
I was trying to make a style that outputs Bookends records in the JSON format in order to work with them with javascript.
Here is what I did:
${
"id": "$@$",
"author": "$a$",
"title": "$t$",
"editor": "$e$",
"journal": "$j$",
"volume": "$v$",
"pages": "$p-$",
"date": "$d$",
"publisher": "$u$",
"location": "$l$",
"url": "$z$",
"title": "$s$",
"user1": "$w$",
"user2": "$x$",
"user3": "$c$",
"user4": "$g$",
"abstract": "$b$",
"keywords": "$k$",
"notes": "$n$",
"user5": "$u5$",
"user6": "$u6$",
"user7": "$u7$",
"user8": "$u8$",
"user9": "$u9$",
"user10": "$u10$",
"user11": "$u11$",
"user12": "$u12$",
"user13": "$u13$",
"user14": "$u14$",
"user15": "$u15$",
"user16": "$u16$",
"attachments": "$h$"
},
However, when I format certain records, the output is messed up. What is
@Article{Schlesinger-1942-Developments,
author = {Schlesinger, Rudolf},
title = {Recent Developments in Soviet Legal Theory},
journal = {The Modern Law Review},
volume = {6},
number = {1/2},
pages = {21-38},
year = {1942},
abstract = {},
location = {},
keywords = {}}
in BibTex, becomes this in my style:
{
“id”: “96262”,
“author”: “Schlesinger, Rudolf”,
“title”: “Recent Developments in Soviet Legal TheoryThe Modern Law Review”,
“volume”: “6”,
“pages”: “21-38”,
“date”: “1942http://www.jstor.org/stable/1090543”,
“title”: “Recent Developments in Soviet Legal Theory”,
“user1”: “Schlesinger-1942-DevelopmentsSchlesinger-1942-Developments.pdf”
},
Sometimes, the output even stops in the middle of the record.
What am I doing wrong?
Thanks,
C.
I was trying to make a style that outputs Bookends records in the JSON format in order to work with them with javascript.
Here is what I did:
${
"id": "$@$",
"author": "$a$",
"title": "$t$",
"editor": "$e$",
"journal": "$j$",
"volume": "$v$",
"pages": "$p-$",
"date": "$d$",
"publisher": "$u$",
"location": "$l$",
"url": "$z$",
"title": "$s$",
"user1": "$w$",
"user2": "$x$",
"user3": "$c$",
"user4": "$g$",
"abstract": "$b$",
"keywords": "$k$",
"notes": "$n$",
"user5": "$u5$",
"user6": "$u6$",
"user7": "$u7$",
"user8": "$u8$",
"user9": "$u9$",
"user10": "$u10$",
"user11": "$u11$",
"user12": "$u12$",
"user13": "$u13$",
"user14": "$u14$",
"user15": "$u15$",
"user16": "$u16$",
"attachments": "$h$"
},
However, when I format certain records, the output is messed up. What is
@Article{Schlesinger-1942-Developments,
author = {Schlesinger, Rudolf},
title = {Recent Developments in Soviet Legal Theory},
journal = {The Modern Law Review},
volume = {6},
number = {1/2},
pages = {21-38},
year = {1942},
abstract = {},
location = {},
keywords = {}}
in BibTex, becomes this in my style:
{
“id”: “96262”,
“author”: “Schlesinger, Rudolf”,
“title”: “Recent Developments in Soviet Legal TheoryThe Modern Law Review”,
“volume”: “6”,
“pages”: “21-38”,
“date”: “1942http://www.jstor.org/stable/1090543”,
“title”: “Recent Developments in Soviet Legal Theory”,
“user1”: “Schlesinger-1942-DevelopmentsSchlesinger-1942-Developments.pdf”
},
Sometimes, the output even stops in the middle of the record.
What am I doing wrong?
Thanks,
C.