PiperBaron / KPopRepo

A project dedicated to providing translation and background to popular K-Pop songs and groups!
2 stars 0 forks source link

Project Checkpoint 3 review #14

Open ebeshero opened 3 years ago

ebeshero commented 3 years ago

You're producing some terrific markup for the project and you'll be in a great position to start processing it very soon as we start working with XSLT. I'm excited to see how the date you're coding for the group profiles comes together with the song markup! Also, the website looks wonderful (and very gloriously purple) so far!

I have a question about how you're working with artist names in the song markup, for example here: https://github.com/PiperBaron/KPopRepo/blob/master/markedup_songs/NCT_Dream_Ridin.xml I can see you're referencing multiple artists in the verse elements:

<verse versenum="1" artistname="Jaemin, Haechan, Jisung, Chenle, All">

You're using a comma + space to separate the names, which makes sense but isn't how this sort of thing is typically handled in XML. In XML attributes, there's a way to do this to make it possible to use a plural list of attributes instead of just one value. When you do that, you separate with just a space in between the values, like so:

<verse versenum="1" artistname="Jaemin Haechan Jisung Chenle All">

There's a way to designate that in your Relax NG schema, to permit plural values, using a special reserve word, list. Here's a GitHub issue showing how to set that up: https://github.com/ebeshero/DHClass-Hub/issues/596

I'm pretty sure you want to use your Schematron for this, though! I don't think we have a Schematron rule testing for these artist names in your schema--you're testing other attributes there, but not @artistName. We can do that and we can use one of the XPath string functions, tokenize() to divide up the members of the list by the spaces between them. Then we can test each "token" value against your list of artist names. Let me know if I can help with any of this!

@PiperBaron @AreannaRussell

PiperBaron commented 3 years ago

@ebeshero

I've been playing around with this (I couldn't sleep and thought it'd be fun :P), but I think I'll need your help! I started with trying to use tokenize() with the Schematron, but I kept getting an error, because more than 1 item isn't allowed. (I included a collection of the marked_up song docs for this, too)

`

` This clearly isn't right, so any help would be awesome... Also, I'm in the middle of working on a few documents for the repo, so if you have a solution, please put it here instead of pushing something. Thanks!
ebeshero commented 3 years ago

@PiperBaron I hope you are getting some sleep! I can help here: You need a special syntax that basically introduces a “for loop“ to address each token in the sequence one by one and check if it is one of your @xml:id values. I’ll send up either a comment or a modification on your file with the syntax you need...

PiperBaron commented 3 years ago

@ebeshero Awesome, it all validates. Thanks so much for your help, Dr. B!