You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alex Rudnev <al...@dc.gov> on 2003/09/26 21:43:37 UTC

[HELP]Element or attribute do not match QName production: QName::=(NCName':')?NCName - problems with default namespace in xsp / xscript.

I was playing with samples in "soap" section and got strange error,
which happens when you try to use default namespace in xsp / xscript
code.

I'm using Cocoon 2.1 with Tomcat 4.1.27 under Sun's JDK 1.4.2. Xerces
2.4.0 included in Cocoon, but I'm not sure it matters here.

Thanks in advance,
Ru.

Here is simplified xsp file which defines default namespace in
declaration of xscript variable:
 
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
xmlns:xscript="http://apache.org/xsp/xscript/1.0">
	<page>
		<xscript:variable name="test-xml">
			<test xmlns="urn:some-url">!!!</test>
		</xscript:variable>

		<xscript:get name="test-xml" />
	</page>
</xsp:page>

Description:
org.apache.cocoon.ProcessingException: 
Failed to execute pipeline.: 
xscript:inline:4283206:4:16:org.xml.sax.SAXParseException: 
Element or attribute do not match QName production:
QName::=(NCName':')?NCName.

Here is part of the stack trace:

org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
xscript:inline:4283206:4:16:org.xml.sax.SAXParseException: Element or
attribute do not match QName production: QName::=(NCName':')?NCName. 
	at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process
XMLPipeline(AbstractProcessingPipeline.java:553)
	at
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipe
line.processXMLPipeline(AbstractCachingProcessingPipeline.java:229)
	at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process
(AbstractProcessingPipeline.java:491)
	...
Caused by: org.xml.sax.SAXParseException: Element or attribute do not
match QName production: QName::=(NCName':')?NCName. 
	at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unkno
wn Source)
	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
	at org.apache.xerces.impl.XMLEntityScanner.scanQName(Unknown
Source)
	at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown
Source)
	at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
	at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scan
RootElementHook(Unknown Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
	at
org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:318)
	at
org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:337)
	at
org.apache.cocoon.components.xscript.XScriptObject.toSAX(XScriptObject.j
ava:163)
	at
org.apache.cocoon.components.xscript.XScriptObject.toEmbeddedSAX(XScript
Object.java:153)
	at
org.apache.cocoon.www.samples.soap.pages.test_xsp.generate(org.apache.co
coon.www.samples.soap.pages.test_xsp:181)
	at
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGe
nerator.java:260)
	at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process
XMLPipeline(AbstractProcessingPipeline.java:547)
	... 63 more



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [HELP]Element or attribute do not match QName production: QName::=(NCName':')?NCName - problems with default namespace in xsp / xscript.

Posted by Joerg Heinicke <jh...@virbus.de>.
Alex Rudnev wrote:
> 
> After last conversation with Vadim I figured out that cocoon that I was
> using (2.1) is not the last released version (2.1.1). I checked for
> changes at http://cocoon.apache.org/2.1/changes.html before sending my
> first e-mail, but it looks like this page is out of synch with the real
> live (especially now, when 2.1.2 is available). I guess it should work
> even in 2.1.1, but it definitely works in 2.1.2. 
> 
> Closed.
> 
> Thanks to everyone, sorry for disturbance :)
> 
> Ru

But Vadim *has* fixed a bug, hasn't he? So your /disturbance/ resulted 
at least in higher quality of XScript :-)

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: [HELP]Element or attribute do not match QName production: QName::=(NCName':')?NCName - problems with default namespace in xsp / xscript.

Posted by Alex Rudnev <al...@dc.gov>.
> Alex Rudnev wrote:
> 
> > Done
> >
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23516
> >
> > Thanks,
> > Ru
> 
> Thanks. And as you might have seen it's already fixed - thanks to
Vadim.
> Can you please test it and close the bug afterwards.
> 
> Joerg

After last conversation with Vadim I figured out that cocoon that I was
using (2.1) is not the last released version (2.1.1). I checked for
changes at http://cocoon.apache.org/2.1/changes.html before sending my
first e-mail, but it looks like this page is out of synch with the real
live (especially now, when 2.1.2 is available). I guess it should work
even in 2.1.1, but it definitely works in 2.1.2. 

Closed.

Thanks to everyone, sorry for disturbance :)

Ru





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [HELP]Element or attribute do not match QName production: QName::=(NCName':')?NCName - problems with default namespace in xsp / xscript.

Posted by Joerg Heinicke <jh...@virbus.de>.
Alex Rudnev wrote:

> Done
> 
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23516
> 
> Thanks,
> Ru

Thanks. And as you might have seen it's already fixed - thanks to Vadim. 
Can you please test it and close the bug afterwards.

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: [HELP]Element or attribute do not match QName production: QName::=(NCName':')?NCName - problems with default namespace in xsp / xscript.

Posted by Alex Rudnev <al...@dc.gov>.
Done

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23516

Thanks,
Ru

> -----Original Message-----
> From: Joerg Heinicke [mailto:jheinicke@virbus.de]
> Sent: Monday, September 29, 2003 2:42 PM
> To: users@cocoon.apache.org
> Subject: Re: [HELP]Element or attribute do not match QName production:
> QName::=(NCName':')?NCName - problems with default namespace in xsp /
> xscript.
> 
> Can you file a bug at http://nagoya.apache.org/bugzilla/ please?
> 
> Thanks,
> 
> Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [HELP]Element or attribute do not match QName production: QName::=(NCName':')?NCName - problems with default namespace in xsp / xscript.

Posted by Joerg Heinicke <jh...@virbus.de>.
Can you file a bug at http://nagoya.apache.org/bugzilla/ please?

Thanks,

Joerg

Alex Rudnev wrote:

> Hi Joerg,
> 
> 
>>I would interpret it as a message about an invalid QName for an
> 
> element.
> 
>>When you point out the usage of the default namespace am I correct
> 
> that
> 
>>it works using a namespace prefix.
> 
> 
> That's right. Basically this code works:
> 
> ...
> <xscript:variable name="test-xml">
> 	<bla-bla:test xmlns:bla-bla="urn:some-url">!!!</ bla-bla:test>
> </xscript:variable>
> <xscript:get name="test-xml" />
> ...
> 
> , and this one doesn't:
> 
> ...
> <xscript:variable name="test-xml">
> 	<test xmlns="urn:some-url">!!!</test>
> </xscript:variable>
> <xscript:get name="test-xml" />
> ...
> 
> 
>>If so, I guess there is a bug anywhere in the code. 
>>Maybe only a simple prefix + ":" + localname and
>>the prefix is an empty string.
> 
> 
> My assumption is that there is a bug in cocoon code somewhere, most
> probably in translation from xsp to java, or somewhere in xscript
> related classes, which are responsible for generation of SAX evens based
> on the current value of xscript variable. Probably you a right, I did
> not have a chance to review the code, but what I looked at was working
> either with SAX and maybe somewhere internally with DOM, and did not
> produce string / binary representation of xml, so I was very surprised
> by this parser's error.
> 
> 
>>Can you confirm this. Is your example based on the samples delivered
>>with Cocoon?
> 
> 
> It's not some of the samples shipped with the cocoon, but I started with
> samples in soap directory when I found this problem (I tried to point it
> to our service, which has use="literal" in soap:body in the wsdl and has
> soap:Body content encoded in default namespace by axis). After playing
> around with sample xsp I figured out that problem actually is in
> xscript-based code and the xsp file (content of which I sent before)
> reproduces the problem - just put it samples/soap/pages directory of
> cocoon webapp.
> 
> When I don't use xscript to process results of soap invocation (just
> output result into some root element of xsp and process it later with
> xslt on sitemap level) everything works fine.
> 
> Sincerely,
> Ru


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: [HELP]Element or attribute do not match QName production: QName::=(NCName':')?NCName - problems with default namespace in xsp / xscript.

Posted by Alex Rudnev <al...@dc.gov>.
Hi Joerg,

> I would interpret it as a message about an invalid QName for an
element.
> When you point out the usage of the default namespace am I correct
that
> it works using a namespace prefix.

That's right. Basically this code works:

...
<xscript:variable name="test-xml">
	<bla-bla:test xmlns:bla-bla="urn:some-url">!!!</ bla-bla:test>
</xscript:variable>
<xscript:get name="test-xml" />
...

, and this one doesn't:

...
<xscript:variable name="test-xml">
	<test xmlns="urn:some-url">!!!</test>
</xscript:variable>
<xscript:get name="test-xml" />
...

> If so, I guess there is a bug anywhere in the code. 
> Maybe only a simple prefix + ":" + localname and
> the prefix is an empty string.

My assumption is that there is a bug in cocoon code somewhere, most
probably in translation from xsp to java, or somewhere in xscript
related classes, which are responsible for generation of SAX evens based
on the current value of xscript variable. Probably you a right, I did
not have a chance to review the code, but what I looked at was working
either with SAX and maybe somewhere internally with DOM, and did not
produce string / binary representation of xml, so I was very surprised
by this parser's error.

> Can you confirm this. Is your example based on the samples delivered
> with Cocoon?

It's not some of the samples shipped with the cocoon, but I started with
samples in soap directory when I found this problem (I tried to point it
to our service, which has use="literal" in soap:body in the wsdl and has
soap:Body content encoded in default namespace by axis). After playing
around with sample xsp I figured out that problem actually is in
xscript-based code and the xsp file (content of which I sent before)
reproduces the problem - just put it samples/soap/pages directory of
cocoon webapp.

When I don't use xscript to process results of soap invocation (just
output result into some root element of xsp and process it later with
xslt on sitemap level) everything works fine.

Sincerely,
Ru



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [HELP]Element or attribute do not match QName production: QName::=(NCName':')?NCName - problems with default namespace in xsp / xscript.

Posted by Joerg Heinicke <jh...@virbus.de>.
Hello Alex,

I would interpret it as a message about an invalid QName for an element. 
When you point out the usage of the default namespace am I correct that 
it works using a namespace prefix. If so, I guess there is a bug 
anywhere in the code. Maybe only a simple prefix + ":" + localname and 
the prefix is an empty string.

Can you confirm this. Is your example based on the samples delivered 
with Cocoon?

Joerg

Alex Rudnev wrote:

> I was playing with samples in "soap" section and got strange error,
> which happens when you try to use default namespace in xsp / xscript
> code.
> 
> I'm using Cocoon 2.1 with Tomcat 4.1.27 under Sun's JDK 1.4.2. Xerces
> 2.4.0 included in Cocoon, but I'm not sure it matters here.
> 
> Thanks in advance,
> Ru.
> 
> Here is simplified xsp file which defines default namespace in
> declaration of xscript variable:
>  
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
> xmlns:xscript="http://apache.org/xsp/xscript/1.0">
> 	<page>
> 		<xscript:variable name="test-xml">
> 			<test xmlns="urn:some-url">!!!</test>
> 		</xscript:variable>
> 
> 		<xscript:get name="test-xml" />
> 	</page>
> </xsp:page>
> 
> Description:
> org.apache.cocoon.ProcessingException: 
> Failed to execute pipeline.: 
> xscript:inline:4283206:4:16:org.xml.sax.SAXParseException: 
> Element or attribute do not match QName production:
> QName::=(NCName':')?NCName.
> 
> Here is part of the stack trace:
> 
> org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
> xscript:inline:4283206:4:16:org.xml.sax.SAXParseException: Element or
> attribute do not match QName production: QName::=(NCName':')?NCName. 
> 	at
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process
> XMLPipeline(AbstractProcessingPipeline.java:553)
> 	at
> org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipe
> line.processXMLPipeline(AbstractCachingProcessingPipeline.java:229)
> 	at
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process
> (AbstractProcessingPipeline.java:491)
> 	...
> Caused by: org.xml.sax.SAXParseException: Element or attribute do not
> match QName production: QName::=(NCName':')?NCName. 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org