Closed GoogleCodeExporter closed 8 years ago
There are several unrelated issues here:
1. Inconsistent trailing slash. The trailing slash is optional on void
elements:
http://stackoverflow.com/questions/1946426/html-5-is-it-br-br-or-br
As such, the following code generates a slash in Firefox and none in Chrome:
new XMLSerializer().serializeToString(document.createElement('param'))
Both are acceptable and legal.
2. Only one param added. This one is your fault. Try this instead:
var example1 = document.createElement('param');
container.appendChild(example1);
var example2 = document.createElement('param');
container.appendChild(example2);
The appendChild function does not clone the element.
3. Bad indentation. This one is my fault. Blockly.Xml.domToPrettyText is
pretty ghetto; it's a non-rigourous cosmetic function that isn't smart enough
to get the indentation of void elements correct. I've made changes (r507) that
fix the indentation when void elements have a trailing slash. It still gets it
wrong where there is no trailing slash.
Original comment by neil.fra...@gmail.com
on 11 Nov 2012 at 2:00
hm okay.
2. If i append two separated children i still only see <param>. For HTML it may
be a valid and legal tag, but I would like to have xml code. And within this
xml code i need a <param> </param> block where several more children are
within. When i use params it works perfectly fine.
So even as you have mentioned in 1. the command/tag is valid my generated code
will not work because of errors in the interpreting process.
One final question. If the block tag would be such a void element, would
blockly then behave properly?
e.g.
<xml>
<block ... >
<mutation ... ></mutation>
<title ...></title>
<block ...>
<...>
<xml>
??
I hope I could make clear what i meant in the first place.
For HTML this is may valid, but the requirement for the xml code that i would
like to have is that leading and ending 'element' are existent and frame child
elements etc.
As said before at the moment is no problem for Blockly, because the chosen tag
names are unequal to the void elements (e.g. block, mutation, etc.).
Original comment by borntob...@googlemail.com
on 11 Nov 2012 at 11:48
Original issue reported on code.google.com by
borntob...@googlemail.com
on 9 Nov 2012 at 8:07