ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

ZUL formatting problem

xmedekoTop Contributor
28 Apr 2010 10:40:58 GMT
28 Apr 2010 10:40:58 GMT

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

iantsai
4 May 2010 21:23:16 GMT
4 May 2010 21:23:16 GMT

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.

henrichen
4 May 2010 21:23:49 GMT
4 May 2010 21:23:49 GMT

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

xmedekoTop Contributor
5 May 2010 01:36:08 GMT
5 May 2010 01:36:08 GMT

@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 ...

henrichen
5 May 2010 19:42:25 GMT
5 May 2010 19:42:25 GMT

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.

xmedekoTop Contributor
6 May 2010 02:25:19 GMT
6 May 2010 02:25:19 GMT

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 ...

xmedekoTop Contributor
11 May 2010 07:13:18 GMT
11 May 2010 07:13:18 GMT

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.