0

problem with && operator

asked 2006-03-23 20:22:08 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3647603

By: nobody

i have the following instruction:

if((cnpjText.value.length() != 14) && (incraText.value.length() != 13)) {
flag += 1;
}

but the container throw this exception:

com.potix.lang.SystemException: org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
com.potix.lang.Classes.newInstance(Classes.java:81)
com.potix.lang.Exceptions.wrap(Exceptions.java:164)
com.potix.lang.SystemException$Aide.wrap(SystemException.java:49)
com.potix.util.resource.ResourceCache.get(ResourceCache.java:139)
com.potix.web.util.resource.ResourceCaches.get(ResourceCaches.java:121)
com.potix.zk.ui.http.Definitions.getPageDefinition(Definitions.java:56)
com.potix.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:326)
com.potix.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:308)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



Why is this happening? Is it because the && operator??

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2006-03-24 00:48:04 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3648039

By: henrichen

zul file is also a standard xml file. The && in the xml would be interpreted by the xml parser as an "entity reference".

In your case, you should either

1. enclose your code inside <![CDATA[ ... ]]> to tell the parser that don't interpret the enclosed parts.(My preference)

2. write && then the xml parser would interprete it into && as your wish.

/henri

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2006-03-23 20:22:08 +0800

Seen: 525 times

Last updated: Mar 24 '06

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More