uwlib-mig / schemasProject

Record and reuse metadata-creation guidance for UWL digital collections
1 stars 0 forks source link

Possible to transform three xml dds for output to HTML? #22

Closed briesenberg07 closed 3 years ago

briesenberg07 commented 3 years ago

Current scripting to output HTML uses an oXygen transformation scenario to process a single XML source file:

image

However I'm planning to use three separate property lists (three data-dictionary.xml files) to manage and present property sets for 1) textual resources 2) audio resources (songs) and 3) audio resources (oral histories).

If possible, I'd like to process all three XML docs for output to a single HTML doc which presents multiple property sets.

I don't have a method for doing this at the top of my head* and wondered whether @gerontakos might have any ideas for this within easy reach.

* One vague idea is to create a single stylesheet which uses fn:transform to iterate over the multiple source docs in some way, perhaps using multiple vars (xsl:sequence > fn:transform)...

gerontakos commented 3 years ago

There are ways to do this. I usually store a document in a variable using the document() function:

<xsl:variable name="doc3" select="document('path-to-document.xml')"/>

Your context will then be the document node and you can navigate the document using XPath as usual. You can also use a key to perform specific lookups, designating the external document in the third argument of the key() function.

I don't know if there's a new shiny approach in XSLT 3. If you find something in 3.0, I'd be interested to hear.

briesenberg07 commented 3 years ago

Thank you for the ideas @gerontakos ! I shall have to dive in a bit more and let you know what I come up with (or, as often happens, what trouble I run into). Thanks again ~

briesenberg07 commented 3 years ago

Resolved with this commit to libraryNotes, where I have the XSLT. See fn:document() in three variables at top of the transform. Thanks again @gerontakos ! Having this transform in working order is a big load off and now I can focus on getting our two remaining property lists in order.

Calls to named templates are still repeated in code (for example, the same named template is called here, here, and here for each of the three document variables). I think this could be improved, but I don't know at the moment how to iterate over the three documents in some way to eliminate this.