Skip to content

A minor detail that compromised one of my projects

Remember this?

I just found out what made it crash. It wasn’t the Russian DBMS, it was something else. A combination of lack of features from the Mozilla team’s products and lack of sleep from me.

After I convinced myself not to change the project (I was planning to do a Firefox extension), I returned to the CoW project and started rewriting almost the whole thing. But the same crash. I couldn’t explain it. Then, after some debugging (after a good night sleep), I narrowed it down to this:

Hmm.. Doesn’t really say anything, except for the major fact that the XAML i’m feeding my application is corrupt.

Then, I actually took a look at the XAML. In the actual XAML, not the one that the Sedna administration console was showing me.

Take a look:

<CANVAS name=”D1″ width=”700″ height=”455″ canvas.left=”0″ canvas.top=”0″>
<PATH width=”800″ height=”500″ stroke=”#FF125632″ canvas.left=”0″ canvas.top=”0″ data=”M 10,10 L 100,100″ name=”ln110″/>
<ELLIPSE width=”200″ height=”100″ fill=”#FF123456″ canvas.left=”100″ canvas.top=”100″ name=”ec111″/>
<RECTANGLE width=”10″ height=”10″ fill=”#FF125632″ canvas.left=”100″ canvas.top=”100″ name=”re112″/></CANVAS>

Yes, that’s right, the tags are all uppercase and the attribute names are also messed up.

Ok, so where did I get this XAML from?

I have a JavaScript that processes a xml after a xslt and then uses XMLSerializer.serializeToString (I’m doing the development in Firefox). The xslt is good, tested, etc. It must be the serializeToString method. It really is.

Quote:

This is much more convenient since XML standard itself is case-sensitive.

…..

3. XMLDocument object keeps the dom document by converting all tags to UPPERCASE

4. XMLSerializer.serializeToString returns all the tag names in UPPERCASE

Then, I ask myself. If XML is case-sensitive, then why the hell does serializeToString return all the tag names in uppercase?

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*