Are multiple tags valid on a single line in .MSCX files?
Can I string multiple XML tags together or do I need to use a LF character?
e.g. would (Events)(Event)(len)1500(/len)(/Event)(/Events) be allowed.
(I know it should be angle brackets but they disappear when I post).
Comments
When in doubt, try it out!
I've just created a new score, saved it as mscx and closed it. Then removed all whitespace between tags and it reopened without any issues.
In reply to When in doubt, try it out! I… by jeetee
Much appreciated, this is very useful. (Yes, I should've just tried it).
In reply to Much appreciated, this is… by yonah_ag
> "(Yes, I should've just tried it)."
Ah well, who find the time these days, eh :-)
As a rule of thumb, anything valid XML goes.
MuseScore uses a
QXmlStreamReader
to read the files, even though it writes them manually asQTextStream
hoping it doesn’t ever get the XML encoding wrong.The manual writing causes consistent, if iffy, indentation (which I’ve made use of in my shell scripts) and ordering (which is a good thing). The reading as proper XML means anything you do editing the
.mscx
files with proper XML tools like XSLT will be understood.In reply to As a rule of thumb, anything… by mirabilos
This consistent indentation is certainly a bit "iffy" but also very useful. My processing is in VBA plus a few formulas. It will be up to me to ensure that I produce valid XML so I'll just follow what I see in the MSCX files but sometimes without whitespace. I am not familiar with XSLT but it sounds intriguing.