OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: [xml-dev] Choosing a target name for a processing instruction

[ Lists Home | Date Index | Thread Index ]

I've always wondered why processing instruction names weren't namespaced just like elements and attributes. I imagine someone thought PIs weren't used much so they might as well be allowed to die quietly.
Given that you can't use a namespace, I think you apply the same rule as with all naming: choose a name that's likely to be unique within the set of names that it has to be distinguished from. I would go for something like "MusicXML.newFeature".
Michael Kay

From: Michael Good [mailto:musicxml@gmail.com]
Sent: 28 April 2006 20:40
To: xml-dev@lists.xml.org
Subject: [xml-dev] Choosing a target name for a processing instruction

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.
I will be bringing this up on the MusicXML mailing list (http://www.recordare.com/lists#MusicXML ), but wanted to tap the wider range of XML application experience on this list too.
Thank you in advance for any advice you can offer!
Best regards,
Michael Good
Recordare LLC


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS