Changeset 44
- Timestamp:
- May 19, 2008 10:18:11 PM (13 years ago)
- Location:
- 1dwg/trunk/IgorPro
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
1dwg/trunk/IgorPro/cansasXML.ipf
r40 r44 183 183 184 184 FOR (i=0; i < DimSize(SASentryList, 0); i += 1) 185 SASentryPath = SASentryList[i][0]185 SASentryPath = "/cs:SASroot/cs:SASentry["+num2str(i+1)+"]" 186 186 SetDataFolder root:Packages:CS_XMLreader 187 187 … … 193 193 WAVE/T M_listXPath 194 194 IF ( DimSize(M_listXPath, 0) == 1) 195 CS_1i_getOneSASdata(fileID, Title, M_listXPath[0][0])195 CS_1i_getOneSASdata(fileID, Title, SASentryPath+"/cs:SASdata") 196 196 CS_1i_collectMetadata(fileID, SASentryPath) 197 197 ELSE … … 199 199 STRING SASdataFolder = CS_cleanFolderName("SASdata_" + num2str(j)) 200 200 NewDataFolder/O/S $SASdataFolder 201 CS_1i_getOneSASdata(fileID, Title, M_listXPath[j][0])201 CS_1i_getOneSASdata(fileID, Title, SASentryPath+"/cs:SASdata["+num2str(j+1)+"]") 202 202 CS_1i_collectMetadata(fileID, SASentryPath) 203 203 SetDataFolder :: // back up to parent directory … … 253 253 suffix = "_" + num2str(i) 254 254 ENDIF 255 CS_appendMetaData(fileID, "Run" + suffix, M_listXPath[i][0], "")256 CS_appendMetaData(fileID, "Run/@name" + suffix, M_listXPath[i][0] + "/@name", "")255 CS_appendMetaData(fileID, "Run" + suffix, SASdataPath + "/../cs:Run["+num2str(i+1)+"]", "") 256 CS_appendMetaData(fileID, "Run/@name" + suffix, SASdataPath + "/../cs:Run["+num2str(i+1)+"]/@name", "") 257 257 ENDFOR 258 258 … … 326 326 igorWave = xmlElement // can we trust this one? 327 327 ENDSWITCH 328 xPathStr = M_listXPath[j][0] // clear name reference 329 pos = strsearch(xPathStr, "/", Inf, 3) // peel off the tail of the string and reform 330 xmlElement = xPathStr[pos,Inf] // find last element on the path 331 prefix = xPathStr[0, pos-1-4]+"/*" // ALL Idata elements 328 // 329 // // This will need some work to support foreign namespaces here 330 // // 331 // // 332 // xPathStr = M_listXPath[j][0] // clear name reference 333 // pos = strsearch(xPathStr, "/", Inf, 3) // peel off the tail of the string and reform 334 // xmlElement = xPathStr[pos,Inf] // find last element on the path 335 // prefix = xPathStr[0, pos-1-4]+"/*" // ALL Idata elements 336 // CS_1i_getOneVector(fileID,prefix, xmlElement, igorWave) // loads ALL rows (Idata) of the column at the same time 337 // 338 // Could there be a problem with a foreign namespace here? 339 prefix = SASdataPath+"//cs:Idata" // ALL Idata elements 340 xmlElement = "cs:" + M_listXPath[j][1] // just this column 332 341 CS_1i_getOneVector(fileID,prefix, xmlElement, igorWave) // loads ALL rows (Idata) of the column at the same time 333 342 ENDFOR … … 384 393 suffix = "_" + num2str(i) 385 394 ENDIF 386 detailsPath = detailsList[i][0]395 detailsPath = sasEntryPath+"/cs:SASsample/cs:details["+num2str(i+1)+"]" 387 396 CS_appendMetaData(fileID, "SASsample/details"+suffix+"/@name", detailsPath + "/@name", "") 388 397 CS_appendMetaData(fileID, "SASsample/details"+suffix, detailsPath, "") … … 426 435 preMeta += "_" + num2str(i) 427 436 ENDIF 428 collimationPath = SAScollimationList[i][0]437 collimationPath = sasEntryPath+"/cs:SASinstrument/cs:SAScollimation["+num2str(i+1)+"]" 429 438 CS_appendMetaData(fileID, preMeta + "/@name", collimationPath + "/@name", "") 430 439 CS_appendMetaData(fileID, preMeta + "/length", collimationPath + "/cs:length", "") … … 460 469 preMeta += "_" + num2str(i) 461 470 ENDIF 462 detectorPath = SASdetectorList[i][0]471 detectorPath = sasEntryPath+"/cs:SASinstrument/cs:SASdetector["+num2str(i+1)+"]" 463 472 CS_appendMetaData(fileID, preMeta + "/@name", detectorPath + "/cs:name", "") 464 473 CS_appendMetaData(fileID, preMeta + "/SDD", detectorPath + "/cs:SDD", "") … … 504 513 WAVE/T M_listXPath 505 514 DUPLICATE/O/T M_listXPath, SASprocessList 506 STRING SASprocessPath 515 STRING SASprocessPath, prefix 507 516 FOR (i = 0; i < DimSize(SASprocessList, 0); i += 1) 508 517 preMeta = "SASprocess" … … 510 519 preMeta += "_" + num2str(i) 511 520 ENDIF 512 SASprocessPath = SASprocessList[i][0]521 SASprocessPath = sasEntryPath+"/cs:SASprocess["+num2str(i+1)+"]" 513 522 CS_appendMetaData(fileID, preMeta+"/@name", SASprocessPath + "/@name", "") 514 523 CS_appendMetaData(fileID, preMeta+"/name", SASprocessPath + "/cs:name", "") 515 524 CS_appendMetaData(fileID, preMeta+"/date", SASprocessPath + "/cs:date", "") 516 525 CS_appendMetaData(fileID, preMeta+"/description", SASprocessPath + "/cs:description", "") 517 XmlListXpath(fileID, SASprocess List[i][0]+"//cs:term", nsStr)526 XmlListXpath(fileID, SASprocessPath+"//cs:term", nsStr) 518 527 FOR (j = 0; j < DimSize(M_listXPath, 0); j += 1) 519 CS_appendMetaData(fileID, preMeta+"/term_"+num2str(j)+"/@name", M_listXPath[j][0] + "/@name", "") 520 CS_appendMetaData(fileID, preMeta+"/term_"+num2str(j)+"/@unit", M_listXPath[j][0] + "/@unit", "") 521 CS_appendMetaData(fileID, preMeta+"/term_"+num2str(j), M_listXPath[j][0], "") 528 prefix = SASprocessPath + "/cs:term[" + num2str(j+1) + "]" 529 CS_appendMetaData(fileID, preMeta+"/term_"+num2str(j)+"/@name", prefix + "/@name", "") 530 CS_appendMetaData(fileID, preMeta+"/term_"+num2str(j)+"/@unit", prefix + "/@unit", "") 531 CS_appendMetaData(fileID, preMeta+"/term_"+num2str(j), prefix, "") 522 532 ENDFOR 523 533 // ignore <SASprocessnote> … … 533 543 preMeta += "_" + num2str(i) 534 544 ENDIF 535 notePath = SASnoteList[i][0]545 notePath = sasEntryPath+"//cs:SASnote["+num2str(i+1)+"]" 536 546 CS_appendMetaData(fileID, preMeta+"/@name", notePath + "/@name", "") 537 547 CS_appendMetaData(fileID, preMeta, notePath, "")
Note: See TracChangeset
for help on using the changeset viewer.