As suggested in several places on the web, I have used jQuery in my web application as a quick and dirty way for creating and manipulating XML documents. For example:
var doc = $("<root/>")
var foo = $("<foo/>").appendTo(doc)
var bar = $("<bar/>").appendTo(foo).text("hello")
console.log(doc.html())
However I just found out that tags in XML are case sensitive, whereas in HTML5 they are not. This turns out to be a big problem because my server requires some mixed case tags, however JavaScript automatically converts everything to lowercase:
$("<FooBar/>")
<foobar></foobar>'
Is there some way I can work around this, e.g. by making the top element (doc) an xml node? Or do I have to rewrite my entire application to use proper XML manipulation rather than DOM tools?
No comments:
Post a Comment