xsl-list
[Top] [All Lists]

Re: [xsl] A colon is not allowed in the name

2009-03-25 01:47:18
Hi Navpreet,

You haven't said whether this document:

<header type="new">
       <?QM: GENERATOR [Ref] 10055: ParaHeading: NEW?>Generate New Data
</header>

uses namespaces anywhere, nor how you are reading it in, nor what you are
using to process it.  This matters, because:

ERROR:  'A colon is not allowed in the name 'QM:' when namespaces are
enabled.'

is a rule that comes straight from the Namespaces-in-XML spec:
http://www.w3.org/TR/xml-names/#Conformance

QUOTE: in a namespace-well-formed document [...] No entity names,
processing instruction targets, or notation names contain any colons.

You can only avoid that restriction by (a) having whoever produced that
processing instruction stop using a colon (which you have said is outside
your power), or (b) strictly avoiding the use of namespaces in the source
document.  Doing (b) may require you to remind the XML parser that it is
parsing a non-namespaced document (see
http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/DocumentBuilderFactory.html#isNamespaceAware()
for one such mechanism).

As an aside, you can get away with (b) only because the XML spec
reluctantly permits colons in names, though the spec pretty much questions
the intelligence of anyone who does it:
http://www.w3.org/TR/xml/#sec-common-syn

QUOTE: The Namespaces in XML Recommendation [XML Names] assigns a meaning
to names containing colon characters. Therefore, authors should not use
the colon in XML names except for namespace purposes

You should show that to the person who stopped you from pursuing option (a).



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--