1

ZUL formatting problem

asked 2010-04-28 10:40:58 +0800

xmedeko gravatar image xmedeko
1021 1 16
http://xmedeko.blogspot.c...

updated 2010-04-29 02:58:03 +0800

Hi,
when i have two elements in ZUL like:

    <n:span>A<n:span><n:span>B<n:span>

then the automatic Eclipse formatting (Source->Format Ctrl+Shift+F) changes them to:
    <n:span>A<n:span>
    <n:span>B<n:span>

which makes a different result in the HTML: "AB" vs. "A B". Is there any way how to fix this?

Thanks

delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2010-05-04 21:23:16 +0800

iantsai gravatar image iantsai
2755 1

updated 2010-05-04 21:24:04 +0800

Is it a valid XML format?
Zul Editor requires a strict XML file for input, and there's no end tag for each of four <n:span> in your case.

link publish delete flag offensive edit

answered 2010-05-04 21:23:49 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

zul is registered as a kind of XML file and what you proceed is done by Eclipse formatter, not ZK Studio.

link publish delete flag offensive edit

answered 2010-05-05 01:36:08 +0800

xmedeko gravatar image xmedeko
1021 1 16
http://xmedeko.blogspot.c...

@iantsai: Sorry, it was a mistake. There should be proper end tags in my example.

@henrichen: May ZK Studio change these rules? Maybe Ant pluging do it ...

link publish delete flag offensive edit

answered 2010-05-05 19:42:25 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

Well, ZK Studio only handles part inside <zscript> tag. We would not change Eclipse's behavior since it is too risky. Maybe you want to check if there was any way to "configure" the Eclipse formatter.

link publish delete flag offensive edit

answered 2010-05-06 02:25:19 +0800

xmedeko gravatar image xmedeko
1021 1 16
http://xmedeko.blogspot.c...

Wow, I have found this in the spec http://www.w3.org/TR/2004/REC-xml-20040204/#sec-white-space and Eclipse (3.5, WTP) can handle it, so

<window xml:space="preserve">
  <n:span>A</n:span><n:span>B</n:span>
</window>

Does not change the format even if I run (Source->Format Ctrl+Shift+F).


Always learning ...

link publish delete flag offensive edit

answered 2010-05-11 07:13:18 +0800

xmedeko gravatar image xmedeko
1021 1 16
http://xmedeko.blogspot.c...

updated 2010-05-11 07:13:31 +0800

BTW. Generally, it should be possible to switch on/off in the XSD, see http://www.w3.org/TR/xmlschema-1/#cAttributeUse but I do not know how Eclipse handle it. I have tried to edit zul.xsd in the org.zkoss.eclipse.editor_0.9.6.v200912041237.jar, but the formatting was still generating new lines.

link publish delete flag offensive edit

answered 2013-07-23 08:33:18 +0800

RetoH gravatar image RetoH flag of Switzerland
44 5

updated 2013-07-23 08:33:54 +0800

When I use

<div xml:space="preserve">asdfasf</div>

I get this exception:

org.zkoss.zk.ui.metainfo.PropertyNotFoundException: Method setSpace not found for class org.zkoss.zul.Div

Did you ever solve this problem?

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: 2010-04-28 10:40:58 +0800

Seen: 1,088 times

Last updated: May 27 '16

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