Lists Home |
Date Index |
- To: firstname.lastname@example.org
- Subject: Choosing a target name for a processing instruction
- From: "Michael Good" <email@example.com>
- Date: Fri, 28 Apr 2006 12:40:29 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=QbRTNuutWnOdiB99LgaR7/7IEWQRYwYxqAZrUaeJcV8O3xP1fDXFZCx5ZicI0jzKlGKKj7yTonKTvysRudbzGjUOelcYDevbaSn5w/4YQvCGx6hHEX+GmbWe24xS6Be/d1UC743o1s/MdjqGIRZXqn6mCMHzGWuszEHZRXXmbt8=
I don't see much about best practices for processing instruction, so I was hoping to tap the xml-dev list wisdom on this issue. My question goes a little bit beyond what Elliotte has written about in Effective XML.
We have a situation where we need to add a new capability to the MusicXML language. This would best be handled by added a new feature to the MusicXML DTD, but we have customers who need its right now and cannot wait for MusicXML
1.2. So the best choice seems to be to add a processing instruction to the MusicXML 1.1 output. The feature is really simple, so a PI lets us add the new feature while keeping the document valid and adding little parsing overhead.
The XML spec says "The PI begins with a target (PITarget
) used to identify the application to which the instruction is directed." But in our case, we are targeting any MusicXML application that cares about this particular feature. Should we just use the name of the feature instead? If we do that, then matching the target name will convey all the necessary information, and there will be no extra PI data required.
This is sort of the approach that's used in many of the processing instruction examples in Elliotte's Effective XML book. But that section is more addressing the question of when to use processing instructions rather than the choice of target name. If there are any other best practices writeups related to this topic, please let me know. Most of the others seem to be variations of "avoid processing instructions if possible." I agree and have avoided them for 6 years, but in this case I see no better choice.
Thank you in advance for any advice you can offer!