[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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

Subject: RE: [xsl] A colon is not allowed in the name
From: "SINGH Navpreet" <navpreet.singh@xxxxxxxxxxxxxx>
Date: Wed, 25 Mar 2009 17:06:29 +1100

Hi Deborah,

Thanks for your reply.
I am using usual namespaces in xsl file not in xml file as follows

<xsl:stylesheet version="2.0"

I am creating javax.xml.transform.Source object for xml file and pass it
to transform method of javax.xml.transform.Transformer.

I've written a java class that uses org.apache.fop.apps.Fop to convert
xml to PDF using xsl file.


-----Original Message-----
From: Deborah Pickett [mailto:debbiep-list-xsl@xxxxxxxxxx]
Sent: Wednesday, 25 March 2009 4:47 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] A colon is not allowed in the name

Hi Navpreet,

You haven't said whether this document:

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

uses namespaces anywhere, nor how you are reading it in, nor what you
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:

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
your power), or (b) strictly avoiding the use of namespaces in the
document.  Doing (b) may require you to remind the XML parser that it is
parsing a non-namespaced document (see
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
the intelligence of anyone who does it:

QUOTE: The Namespaces in XML Recommendation [XML Names] assigns a
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

Disclaimer :
The contents of this e-mail including any attachments are intended only
for the person or entity to which this e-mail is addressed.  If you are not,
or believe you may not be, the intended recipient, please advise the sender
immediately by return e-mail, delete this e-mail and destroy any copies.
The Company does not warrant nor guarantee that this email communication is
from errors, virus, interception or interference.

Current Thread