PDA

View Full Version : XML unterminated regular expression literal



ostghost
8 Apr 2010, 11:29 PM
XML from http://www2.rozhlas.cz/program/static/vysilame_RADIOWAVE
Seems to be valid http://validator.w3.org/check?uri=http%3A%2F%2Fwww2.rozhlas.cz%2Fprogram%2Fstatic%2Fvysilame_RADIOWAVE%3Fi%3D2%26_dc%3D1270796060661%26callback%3DstcCallback1007&charset=%28detect+automatically%29&doctype=Inline&group=0

But error "unterminated regular expression literal" is thrown.



<program>
<den>
<porad stanice="WAVE">
<nazev/>
<pisnicka>
<nazev/>
<autor>Author</autor>
<pisnicka>Song</pisnicka>
</porad>
</den>
</program>




var dataStore = new Ext.data.Store( {

proxy : new Ext.data.ScriptTagProxy( {
url : 'http://www2.rozhlas.cz/program/static/vysilame_RADIOWAVE?i=2'
}),

reader : new Ext.data.XmlReader( {
record : 'pisnicka'
}, [ {
name : 'song',
mapping : 'nazev'
}, {
name : 'author',
mapping : 'autor'
} ])
})
dataStore.load( {
callback : function(records, options, success) {
console.log("callback", records, options, success);
}
});


Any idea?

evant
8 Apr 2010, 11:33 PM
You can't use a ScriptTagProxy with XML.

From the docs (you read that, right? ;))


The content passed back from a server resource requested by a ScriptTagProxy must be executable JavaScript source code because it is used as the source inside a <script> tag.

Animal
8 Apr 2010, 11:33 PM
Did you read what ScriptTagProxy does? Or even wonder what the name means?