int pe = pXML.indexOf("</" + TAG_JWF_MOVIE + ">", ps + 1);
if (pe < 0)
return null;
movieXML = pXML.substring(ps, pe);
}
FlameMovie movie = new FlameMovie(prefs);
// Movie attributes
{
int ps = movieXML.indexOf("<" + TAG_JWF_MOVIE + " ");
int pe = -1;
boolean qt = false;
for (int i = ps + 1; i < movieXML.length(); i++) {
if (movieXML.charAt(i) == '\"') {
qt = !qt;
}
else if (!qt && movieXML.charAt(i) == '>') {
pe = i;
break;
}
}
String hs = movieXML.substring(ps + 7, pe);
parseMovieAttributes(movie, hs);
}
// parts
{
int p = 0;
while (true) {
int ps = movieXML.indexOf("<" + TAG_JWF_MOVIE_PART + " ", p + 1);
if (ps < 0)
break;
int pe = movieXML.indexOf("</" + TAG_JWF_MOVIE_PART + ">", ps + 1);
if (pe < 0) {
pe = movieXML.indexOf("/>", ps + 1);
}
String hs = movieXML.substring(ps + TAG_JWF_MOVIE_PART.length() + 1, pe);
FlameMoviePart part = new FlameMoviePart();
movie.addPart(part);
int psFlame = hs.indexOf("<flame ");
if (psFlame > 0) {
int peFlame = hs.indexOf("</flame>", psFlame + 1);
String flameXML = hs.substring(psFlame, peFlame + 8);
Flame flame = new FlameReader(prefs).readFlamesfromXML(flameXML).get(0);