brendanburns / droiddraw

Automatically exported from code.google.com/p/droiddraw
0 stars 0 forks source link

Suggestion: Simple Widgets as Empty elements <Button /> #221

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In Mono for Android (Monodroid) xml layout is verified against xsd
2. Pasting code generated in DroidDraw into Visual Studio causes warnings
3.

What is the expected output? What do you see instead?
================================================================
if Button declared as for example EMPTY element in DTD:
cannot have child elements.
Wouldn't form
<Button /> or <Button></Button>
be better than
<Button>
</Button>

Newline is whitespace thus element is not EMPTY according to
schema.

Expected:
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
android:id="@+id/widget0"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<Button
android:id="@+id/widget31"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_x="0px"
android:layout_y="48px"
>
</Button>
<Button
android:id="@+id/widget32"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_x="0px"
android:layout_y="48px"
/>
<Button
android:id="@+id/widget33"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_x="43px"
android:layout_y="89px"
></Button>
</AbsoluteLayout>

================================================================
Generated:
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
android:id="@+id/widget0"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<Button
android:id="@+id/widget31"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_x="0px"
android:layout_y="48px"
>
</Button>
<Button
android:id="@+id/widget32"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_x="0px"
android:layout_y="48px"
>
</Button>
<Button
android:id="@+id/widget33"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_x="43px"
android:layout_y="89px"
>
</Button>
</AbsoluteLayout>
================================================================

What version of the product are you using? On what operating system?
v=r1b20
os=Windows.Vista

Please provide any additional information below.

None

regards

mel

http://www.holisticware.net

Original issue reported on code.google.com by miljenko...@gmail.com on 5 Jul 2011 at 10:41

GoogleCodeExporter commented 9 years ago

Original comment by brendan....@gmail.com on 12 Aug 2011 at 4:00

GoogleCodeExporter commented 9 years ago
Fix committed to SVN.  Will roll out w/ the next release.

Original comment by brendan....@gmail.com on 1 Jan 2012 at 5:43