QName::=(NCName':')?NCName error when tml is parsed

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

QName::=(NCName':')?NCName error when tml is parsed

Jens Breitenstein
Hi T5 Users!

I am struggling with an strange error in T5.3.7 and hopefully one of you
can give me a hint how to track it down..

I wrote a "Icon" component to show bootstrap glyphicons:

public class Icon
{
     @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
     @Property private String _name;

     boolean beginRender(final MarkupWriter writer)
     {
         // <span class="glyphicon glyphicon-log-in"/>
         writer.element("span", "class", "glyphicon glyphicon-" + _name);
         writer.end();
         return true;
     }
}


So it's possible to show a glyphicon in a page by

<t:Icon name="exclamation-sign"/>

Everthing worked fine until I moved to component to a "common library
package". After starting Jetty and accessing a page which uses this
component I get:

Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException:
Failure parsing template
classpath:de/xyz/application/client/pages/DataManaging.tml: Element or
attribute do not match QName production: QName::=(NCName':')?NCName.  
[at classpath:de/xyz/application/pages/DataManaging.tml, line 9]
     at
org.apache.tapestry5.internal.services.SaxTemplateParser.parse(SaxTemplateParser.java:173)
     at
org.apache.tapestry5.internal.services.TemplateParserImpl$1.invoke(TemplateParserImpl.java:61)
     at
org.apache.tapestry5.internal.services.TemplateParserImpl$1.invoke(TemplateParserImpl.java:58)
     at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
     ... 98 more
Caused by: org.xml.sax.SAXParseException: Element or attribute do not
match QName production: QName::=(NCName':')?NCName.
     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
     at
org.apache.tapestry5.internal.services.XMLTokenStream.parse(XMLTokenStream.java:317)
     at
org.apache.tapestry5.internal.services.SaxTemplateParser.parse(SaxTemplateParser.java:163)


Even more confusing is the fact the error never appears again it only
occurs on first access.


Thanks in advance


Jens


Reply | Threaded
Open this post in threaded view
|

Re: QName::=(NCName':')?NCName error when tml is parsed

Jens Breitenstein
It looks like the library mapping name is causing this effect: in case the name begins with a digit as first character like "1st" component rendering fails. Using "first" instead fixes the problem and everything works as expected.

To me it looks like bug, but if it is expected behaviour I would prefer an "Illegal libray mapping name" exception. What do you think?

Jens







Von meinem iPhone gesendet

> Am 06.05.2014 um 00:42 schrieb Jens Breitenstein <[hidden email]>:
>
> Hi T5 Users!
>
> I am struggling with an strange error in T5.3.7 and hopefully one of you can give me a hint how to track it down..
>
> I wrote a "Icon" component to show bootstrap glyphicons:
>
> public class Icon
> {
>    @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
>    @Property private String _name;
>
>    boolean beginRender(final MarkupWriter writer)
>    {
>        // <span class="glyphicon glyphicon-log-in"/>
>        writer.element("span", "class", "glyphicon glyphicon-" + _name);
>        writer.end();
>        return true;
>    }
> }
>
>
> So it's possible to show a glyphicon in a page by
>
> <t:Icon name="exclamation-sign"/>
>
> Everthing worked fine until I moved to component to a "common library package". After starting Jetty and accessing a page which uses this component I get:
>
> Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException: Failure parsing template classpath:de/xyz/application/client/pages/DataManaging.tml: Element or attribute do not match QName production: QName::=(NCName':')?NCName.  [at classpath:de/xyz/application/pages/DataManaging.tml, line 9]
>    at org.apache.tapestry5.internal.services.SaxTemplateParser.parse(SaxTemplateParser.java:173)
>    at org.apache.tapestry5.internal.services.TemplateParserImpl$1.invoke(TemplateParserImpl.java:61)
>    at org.apache.tapestry5.internal.services.TemplateParserImpl$1.invoke(TemplateParserImpl.java:58)
>    at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
>    ... 98 more
> Caused by: org.xml.sax.SAXParseException: Element or attribute do not match QName production: QName::=(NCName':')?NCName.
>    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>    at org.apache.tapestry5.internal.services.XMLTokenStream.parse(XMLTokenStream.java:317)
>    at org.apache.tapestry5.internal.services.SaxTemplateParser.parse(SaxTemplateParser.java:163)
>
>
> Even more confusing is the fact the error never appears again it only occurs on first access.
>
>
> Thanks in advance
>
>
> Jens
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: QName::=(NCName':')?NCName error when tml is parsed

kristian marinkovic-3
In reply to this post by Jens Breitenstein
Hi Jens,

never seen an exception like that but i'd guess a namespace is missing.
either tapestry or xml

<t:layout t:id="pageLayout" xmlns="http://www.w3.org/1999/xhtml"
  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
xmlns:p="tapestry:parameter">

cheers,
Kris


On Tue, May 6, 2014 at 12:42 AM, Jens Breitenstein <[hidden email]>wrote:

> Hi T5 Users!
>
> I am struggling with an strange error in T5.3.7 and hopefully one of you
> can give me a hint how to track it down..
>
> I wrote a "Icon" component to show bootstrap glyphicons:
>
> public class Icon
> {
>     @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
>     @Property private String _name;
>
>     boolean beginRender(final MarkupWriter writer)
>     {
>         // <span class="glyphicon glyphicon-log-in"/>
>         writer.element("span", "class", "glyphicon glyphicon-" + _name);
>         writer.end();
>         return true;
>     }
> }
>
>
> So it's possible to show a glyphicon in a page by
>
> <t:Icon name="exclamation-sign"/>
>
> Everthing worked fine until I moved to component to a "common library
> package". After starting Jetty and accessing a page which uses this
> component I get:
>
> Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException:
> Failure parsing template classpath:de/xyz/application/client/pages/DataManaging.tml:
> Element or attribute do not match QName production:
> QName::=(NCName':')?NCName.  [at classpath:de/xyz/application/pages/DataManaging.tml,
> line 9]
>     at org.apache.tapestry5.internal.services.SaxTemplateParser.
> parse(SaxTemplateParser.java:173)
>     at org.apache.tapestry5.internal.services.TemplateParserImpl$1.
> invoke(TemplateParserImpl.java:61)
>     at org.apache.tapestry5.internal.services.TemplateParserImpl$1.
> invoke(TemplateParserImpl.java:58)
>     at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.
> invoke(OperationTrackerImpl.java:74)
>     ... 98 more
> Caused by: org.xml.sax.SAXParseException: Element or attribute do not
> match QName production: QName::=(NCName':')?NCName.
>     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>     at org.apache.tapestry5.internal.services.XMLTokenStream.parse(
> XMLTokenStream.java:317)
>     at org.apache.tapestry5.internal.services.SaxTemplateParser.
> parse(SaxTemplateParser.java:163)
>
>
> Even more confusing is the fact the error never appears again it only
> occurs on first access.
>
>
> Thanks in advance
>
>
> Jens
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: QName::=(NCName':')?NCName error when tml is parsed

Andreas Fink
In reply to this post by Jens Breitenstein
Can you post DataManaging.tml

> Caused by: org.xml.sax.SAXParseException: Element or attribute do not match QName production: QName::=(NCName':')?NCName.

The 'production' part seems odd.

Cheers,
Andi.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Fwd: QName::=(NCName':')?NCName error when tml is parsed

Jens Breitenstein
In reply to this post by Jens Breitenstein
Hi Andi, hi Kristian!

We solved the puzzle several days ago, but unfortunately the mail never appeared in the mailing list even my phone tells me it is sent :-(
See below

Thanks Jens

Von meinem iPhone gesendet

Anfang der weitergeleiteten E‑Mail:

> Von: "[hidden email]" <[hidden email]>
> Datum: 7. Mai 2014 08:51:12 MESZ
> An: Tapestry users <[hidden email]>
> Betreff: Re: QName::=(NCName':')?NCName error when tml is parsed
>
> It looks like the library mapping name is causing this effect: in case the name begins with a digit as first character like "1st" component rendering fails. Using "first" instead fixes the problem and everything works as expected.
>
> To me it looks like bug, but if it is expected behaviour I would prefer an "Illegal libray mapping name" exception. What do you think?
>
> Jens
>
>
>
>
>
>
>
> Von meinem iPhone gesendet
>
>> Am 06.05.2014 um 00:42 schrieb Jens Breitenstein <[hidden email]>:
>>
>> Hi T5 Users!
>>
>> I am struggling with an strange error in T5.3.7 and hopefully one of you can give me a hint how to track it down..
>>
>> I wrote a "Icon" component to show bootstrap glyphicons:
>>
>> public class Icon
>> {
>>   @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
>>   @Property private String _name;
>>
>>   boolean beginRender(final MarkupWriter writer)
>>   {
>>       // <span class="glyphicon glyphicon-log-in"/>
>>       writer.element("span", "class", "glyphicon glyphicon-" + _name);
>>       writer.end();
>>       return true;
>>   }
>> }
>>
>>
>> So it's possible to show a glyphicon in a page by
>>
>> <t:Icon name="exclamation-sign"/>
>>
>> Everthing worked fine until I moved to component to a "common library package". After starting Jetty and accessing a page which uses this component I get:
>>
>> Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException: Failure parsing template classpath:de/xyz/application/client/pages/DataManaging.tml: Element or attribute do not match QName production: QName::=(NCName':')?NCName.  [at classpath:de/xyz/application/pages/DataManaging.tml, line 9]
>>   at org.apache.tapestry5.internal.services.SaxTemplateParser.parse(SaxTemplateParser.java:173)
>>   at org.apache.tapestry5.internal.services.TemplateParserImpl$1.invoke(TemplateParserImpl.java:61)
>>   at org.apache.tapestry5.internal.services.TemplateParserImpl$1.invoke(TemplateParserImpl.java:58)
>>   at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
>>   ... 98 more
>> Caused by: org.xml.sax.SAXParseException: Element or attribute do not match QName production: QName::=(NCName':')?NCName.
>>   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>>   at org.apache.tapestry5.internal.services.XMLTokenStream.parse(XMLTokenStream.java:317)
>>   at org.apache.tapestry5.internal.services.SaxTemplateParser.parse(SaxTemplateParser.java:163)
>>
>>
>> Even more confusing is the fact the error never appears again it only occurs on first access.
>>
>>
>> Thanks in advance
>>
>>
>> Jens
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: QName::=(NCName':')?NCName error when tml is parsed

Thiago H de Paula Figueiredo
In reply to this post by Jens Breitenstein
On Wed, 07 May 2014 03:51:12 -0300, [hidden email]  
<[hidden email]> wrote:

> It looks like the library mapping name is causing this effect: in case  
> the name begins with a digit as first character like "1st" component  
> rendering fails. Using "first" instead fixes the problem and everything  
> works as expected.
>
> To me it looks like bug, but if it is expected behaviour I would prefer  
> an "Illegal libray mapping name" exception. What do you think?

As far as I can see, Tapestry couldn't even provide a good error message  
because the exception occurs inside the XML parser. Of course, Tapestry  
could throw an exception when you add the library mapping itself. JIRA  
please?

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]