-
Notifications
You must be signed in to change notification settings - Fork 9
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
💬 Fixes pbcore json double quote bug #2896
Conversation
I keep improving this script and it keeps revealing new bugs! 🐞 🪰 🪱 TesterRequires curl https://americanarchive.org/catalog/cpb-aacip-211-46d25n09.pbcore | xsltproc ~/gbh/aapb/AAPB2/lib/pbcore_xml_to_json.xsl - | jq Overall, I'm getting about 1% error rate with the latest revision, which is much better than the 10-20% errors before! WorkingDouble quotescpb-aacip-211-46d25n09 now properly escapes quotes in the Newlinescpb-aacip-254-18dfn5gb was breaking with the original xsl, but is now properly escaping double quotes and newlines in Backslashescpb-aacip-211-49g4fnmn now properly escapes lone backslash characters
Not workingHTMLcpb-aacip-211-46d25p4w has html that is not being escaped (breaking on unescaped double quote in |
nice stylesheet - much cleaner than mine (adapted for FMP) but too simple where it globally "escapes" (for JSON) the backslash with another. XML expressing simple things like a line feed as hideous hex code like '\0x0A' instead of |
https://americanarchive.org/catalog/cpb-aacip-211-46d25p4w.pbcore is not valid XML, so a pretty tall order to transform it as XML. I cannot find a way using XSL without preprocessing it |
LOL all the crap I've added to my XSL to handle weird hex codes and idiotic backslashes is better dealt with using your code! I'm going to adopt your sequence of escaping and expect it to work just fine. |
Kevin confirms this looks good to him |
Fixes double quote escaping bug in
pbcore_xml_to_json.xsl
Closes #2697