slub / liszt_common

common tools for the Liszt catalog raisonné
GNU General Public License v3.0
1 stars 0 forks source link

Add XSLT conversion #14

Closed dikastes closed 2 months ago

dikastes commented 6 months ago

XmlDocument should be enabled to perform XSLT conversion. I'd like to be able to do something like

$document = XmlDocument::from($string);
$convertedDocument = $document->convert($xsltDocument);

where $xsltDocument is also of type XmlDocument and $document stays unmuted.

dikastes commented 6 months ago

Maybe it would be good to directly retrieve the XSLT file from a github repository, see for example https://github.com/KristinaRichts/mei-metadata-skripts.

$xsltDocument = XmlDocument::fromGithub(
    // repository
    'KristinaRichts/mei-metadata-skripts', 
    // filename
    'RISM2MEI_v2.xsl',
    // branch
    'main'
);
$document = XmlDocument::from($string);
$convertedDocument = $document->convert($xsltDocument);