PiperBaron / KPopRepo

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

Referencing xml:id Across Documents #4

Open PiperBaron opened 3 years ago

PiperBaron commented 3 years ago

@ebeshero @AreannaRussell

Here we can discuss how to reference the xml:id from one document on another. I've uploaded sample documents and their schemas to start!

ebeshero commented 3 years ago

@PiperBaron I see it, I think: You want the @ref attributes on this file https://github.com/PiperBaron/KPopRepo/blob/master/markedup_songs/song_markup_sample.xml to be checked by the @xml:idattributes defined here: https://github.com/PiperBaron/KPopRepo/blob/master/group_profiles/group_markup_sample.xml .

I'll give this a go with Schematron, and push something up shortly! I'll try and explain how it works, too in case you want to develop it a little. It will make more sense when we get to XPath.

ebeshero commented 3 years ago

@PiperBaron @AreannaRussell Can you tell me which elements in the group_markup_sample.xml file are meant to match up with these attributes?

PiperBaron commented 3 years ago

@ebeshero Sorry if it's kind of confusing! Please let me know if I'm not using the @xml:id and references incorrectly.

ebeshero commented 3 years ago

@PiperBaron Thanks—that helps! You’re coding this correctly—I just couldn’t tell exactly what the relationships were at first. The Schematron file will help clarify these connections and become part of the project documentation too. I’ll write it in the morning and we can see if it works correctly.

ebeshero commented 3 years ago

@PiperBaron @AreannaRussell With this commit, https://github.com/PiperBaron/KPopRepo/commit/a3644fcfe57c6afdb4aef7d7b02afc83a76e2948 , I have prepped a Schematron file that can check your @artistRef, @labelRef, and @ref attributes against values in the group document. I didn't see any @xml:id values defined on <stageName> elements, so I wasn't sure what to do there. I made that last rule for @ref basically say, Values must either be "All," or from an @xml:id on <stageName>, or an @xml:id on <member> elements that don't have xml:ids on their <stageName> elements inside. Currently we can only have xml:ids member elements, so that's what is validating your @ref ids at the moment. You may want to change this part? Let's talk more--maybe I can join your next meeting to go over this.

ebeshero commented 3 years ago

@PiperBaron @AreannaRussell When you do a git pull, notice there's a new schema association line on your song XML file, and I changed the IDREF datatype on those attributes over to just plain text in your song RNC file. I replaced it with the reserve word text just to stop the RNC file from being stymied about not finding xsdID values to validate inside the file, since we now have Schematron checking these.

PiperBaron commented 3 years ago

@ebeshero I replied on Slack, but I'll reply here too. Thank you for the help! I realized what I did with the element. I had the xml:id on the element in an earlier version of the file, then changed it to be on the element later, because I though it'd be less confusing. Then I forgot I did that! So, I'm going to edit the Schematron so the xml:id will just be on the element.

I'll push the edited xmlidChecker file (I have the original save in case I mess it up somehow) with some more song/group documents to make sure it all works.