| 254 |
|
) |
| 255 |
|
{ |
| 256 |
|
char *path; |
| 257 |
< |
ezxml_t fl, wld, wdb; |
| 257 |
> |
ezxml_t fl, wtl, wld, wdb; |
| 258 |
|
struct BSDF_data *dp; |
| 259 |
|
|
| 260 |
|
path = getpath(fname, getrlibpath(), R_OK); |
| 270 |
|
return(NULL); |
| 271 |
|
} |
| 272 |
|
if (ezxml_error(fl)[0]) { |
| 273 |
< |
sprintf(errmsg, "BSDF \"%s\": %s", path, ezxml_error(fl)); |
| 273 |
> |
sprintf(errmsg, "BSDF \"%s\" %s", path, ezxml_error(fl)); |
| 274 |
|
error(WARNING, errmsg); |
| 275 |
|
ezxml_free(fl); |
| 276 |
|
return(NULL); |
| 277 |
|
} |
| 278 |
+ |
if (strcmp(ezxml_name(fl), "WindowElement")) { |
| 279 |
+ |
sprintf(errmsg, |
| 280 |
+ |
"BSDF \"%s\": top level node not 'WindowElement'", |
| 281 |
+ |
path); |
| 282 |
+ |
error(WARNING, errmsg); |
| 283 |
+ |
ezxml_free(fl); |
| 284 |
+ |
return(NULL); |
| 285 |
+ |
} |
| 286 |
+ |
wtl = ezxml_child(ezxml_child(fl, "Optical"), "Layer"); |
| 287 |
|
dp = (struct BSDF_data *)calloc(1, sizeof(struct BSDF_data)); |
| 288 |
< |
for (wld = ezxml_child(fl, "WavelengthData"); |
| 288 |
> |
for (wld = ezxml_child(wtl, "WavelengthData"); |
| 289 |
|
wld != NULL; wld = wld->next) { |
| 290 |
|
if (strcmp(ezxml_txt(ezxml_child(wld,"Wavelength")), "Visible")) |
| 291 |
|
continue; |