I get the following error when trying to write a MusicXML document to disk :
?- [‘C:/path-to/file-name.pl’].
ERROR: c:/path-to/file-name.pl:757:
ERROR: source_sink `dtd(‘D:\path-to\schema\partwise.dtd’)’ does not exist
Warning: c:/path-to/file-name.pl:755:
Warning: Goal (directive) failed: user:write_musicxml
I’m using xml_write(Stream, Document, [doctype(‘score-partwise’), dtd(‘D:\path-to\schema\partwise.dtd’)]).
I get the same error for ‘D:/path-to/schema/partwise.dtd’ or when I drop the doctype(‘score-partwise’) option.
All .mod files the dtd refers to are in the directory of the partwise.dtd file.
I’m using the same dtd for transforming or selecting data from MusicXML files with the Saxon XSLT processor without issues.
For completeness reasons I include a test predicate :
write_musicxml :-
Document = [ element('score-partwise',
[],
[ element(part,
[ id="P1"],
[ element(measure,
[ number="1"],
[ element(note,
[ default-x="50", default-y="70"],
[ element(pitch,
[],
[ element(step, [], ['C']),
element(octave, [], ['4'])
]),
element(duration, [], ['4']),
element(type, [], ['quarter'])
])
])
])
])
],
open('R:/temp/test.xml', write, Stream),
xml_write(Stream, Document, [doctype('score-partwise'), dtd('D:path-to/schema/partwise.dtd')]),
close(Stream).
Can .xsd files be used for writing XML documents and how?
Thanks in advance for any help.