¶ 1 Leave a comment on paragraph 1 0 While Greg has been working on the front-end of end/line, I’ve been continuing with the back-end. Over the last week, I built the infrastructure for the user accounts and logging in and out. I used something called passport.js, which covers setting up and sessions and cookies and all the good stuff. I’m waiting until I talk with Greg today until I start to incorporate it into the front-end.
¶ 2 Leave a comment on paragraph 2 0 Other than that, I also wrote (what I think will be) the final version of the XML validation script. I tested it along with examples of TEI that I saw on Wikipedia. As long as there are no other crazy aspects of TEI that I don’t know about, we should be good there. If there are, it’s easy enough to add another pattern.
¶ 3 Leave a comment on paragraph 3 0 How the script works is by testing against three patterns of how XML should be written. These are:
¶ 4 Leave a comment on paragraph 4 0 <[word]>
¶ 5 Leave a comment on paragraph 5 0 <[word] [word]=”[word maybe with numbers]”>
¶ 6 Leave a comment on paragraph 6 0 <[word] [word]:[word]=”[word maybe with numbers]”>
¶ 7 Leave a comment on paragraph 7 0 If the tag doesn’t follow either of those, it will fail and report which tag has the error. To do this, I used a JavaScript regular expression. This was the first time I’ve written my own, so that was fun. Once that passes, it will then check to make sure there is a closing tag. That’s just the typical </[word]> tag.
¶ 8 Leave a comment on paragraph 8 0 I’m pretty confident that the script works for every possibility. Now I just need to work with Greg to get it implemented on the site.