[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Choosing a target name for a processing instruction


target name
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
http://www.saxonica.com/


From: Michael Good [mailto:musicxml@g...]
Sent: 28 April 2006 20:40
To: xml-dev@l...
Subject: 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 (http://www.w3.org/TR/2004/REC-xml-20040204/#NT-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
http://www.recordare.com/
 

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.