Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Syntax for PI "target" is supposed to permit colons?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Leif Stainsby" <lstainsby AT galdosinc.com>
  • To: <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] Syntax for PI "target" is supposed to permit colons?
  • Date: Mon, 3 May 2010 16:09:49 -0700

Hi,

We wanted to qualify our application specific PI "targets" with an
XML-ish prefix like so:
<?app:some-pi pi-data?>
where "app" is a prefix which is consistently used to refer to our
application. But it seems that some tools/libraries do not like this.
We initally encountered the problem on JDOM 1.0 (fed by Xerces 2.9.0)
and further investigation indicated what appears to be an inconsistency
between the XML 1.0 spec and some commonly used XML tools, such as XOM.

It seems that a PI "target" is explicitly allowed to contain a colon
(":").

XML 1.0 (Fifth edition), see the NameStartChar production:
http://www.w3.org/TR/REC-xml/#NT-NameStartChar

and has since the beginning, XML 1.0 (First edition), see the NT-Name
production:
http://www.w3.org/TR/1998/REC-xml-19980210#NT-Name

Yet XOM restricts a PI "target" to the NCName production, thus expressly
excluding our friend the colon (":"). See the XOM JavaDoc for
ProcessingInstructions:

http://www.xom.nu/apidocs/nu/xom/ProcessingInstruction.html#ProcessingIn
struction%28java.lang.String,%20java.lang.String%29

<quote>
IllegalTargetException - if the target is not a non-colonized name or
is the string "xml" in any case
</quote>

Has anyone else noticed this? Is this a known issue that everyone
simply ignores?

Regards,

...Leif






Archive powered by MHonArc 2.6.24.

Top of Page