Is it possible to specifiy the XSLT file as part of an XML output? I've got XML output working fine, and reading too *, but for this plugin I want all data present in the XML file, and with the XSL summoned in the file's header? Can I do this with the SDK?
* Anyone seen XPATH? Is it missing from the SDK?
xmlDomInstance:text() appears to work, but isn't documented.
I wonder if there's anything else.
OK, here is how I did it. The key is to set theXML instance so the XML declaration is omitted:
local xmlBuilder = LrXml.createXmlBuilder(true)
Then you can add the declaration by code, add the XSLT stylesheet link in the same manner, and then the XML blocks. So, assuming FileStr is the name of the XML file and xmlString contains the data you're exporting:
Hnd = io.open(FileStr, "w")
Hnd:write ( '<?xml version="1.0"?>' )
Hnd:write ( '<?xml-stylesheet type="text/xsl" href="spreadsheet.xsl"?>' )