1 | <HTML> |
---|
2 | <HEAD> |
---|
3 | </HEAD> |
---|
4 | <BODY> |
---|
5 | <PRE> |
---|
6 | FUNCTION CS_XmlReader(fileName) |
---|
7 | // |
---|
8 | // open a canSAS 1-D reduced SAS XML data file |
---|
9 | // returns: |
---|
10 | // 0 : successful |
---|
11 | // -1: XML file not found |
---|
12 | // -2: root element is not <SASroot> |
---|
13 | // -3: <SASroot> version is not 1.0 |
---|
14 | // -4: no <SASentry> elements |
---|
15 | // |
---|
16 | STRING fileName |
---|
17 | STRING origFolder |
---|
18 | STRING workingFolder = "root:Packages:CS_XMLreader" |
---|
19 | VARIABLE returnCode |
---|
20 | FUNCTION CS_1i_parseXml(fileID) |
---|
21 | FUNCTION CS_1i_collectMetadata(fileID, sasEntryPath) |
---|
22 | FUNCTION CS_fileExists(fileName) |
---|
23 | FUNCTION CS_appendMetaData(key, xpath, value) |
---|
24 | FUNCTION CS_findElementIndex(matchStr) |
---|
25 | FUNCTION CS_registerNameSpaces() |
---|
26 | FUNCTION/S CS_GetNameSpaceByKey(key) |
---|
27 | FUNCTION/S CS_GetKeyByNameSpace(ns) |
---|
28 | FUNCTION/S CS_XPath_NS(simpleStr) |
---|
29 | // this function adds namespace info as necessary to simpleStr (an XPath) |
---|
30 | FUNCTION/S CS_buildXpathStr(prefix, value) |
---|
31 | // this function can be used only with very simple XPath constructions |
---|
32 | FUNCTION/S CS_XmlStrFmXpath(fileID, prefix, value) |
---|
33 | FUNCTION CS_simpleXmlWaveFmXpath(fileID, prefix, value) |
---|
34 | FUNCTION CS_simpleXmlListXpath(fileID, prefix, value) |
---|
35 | Function/T TrimWS(str) |
---|
36 | Function/T TrimWSL(str) |
---|
37 | Function/T TrimWSR(str) |
---|
38 | FUNCTION CS_updateWaveNote(wavName, key, value) |
---|
39 | FUNCTION CS_1i_extractIdataColumn2Wave(fileID, basePath, colName, wavName) |
---|
40 | // this function pulls one column of data from each <Idata> element |
---|
41 | // easier to write this as a function than debug it all the times it is needed |
---|
42 | // |
---|
43 | // avoid the use os the semicolon in anything that might make it into |
---|
44 | // the IgorPro wavenote since the semicolon is a list delimiter. |
---|
45 | // The import macro defends against this by converting all semicolons |
---|
46 | // into the string " :semicolon: " |
---|
47 | FUNCTION CS_1i_extractSasData(fileID, SASdataPath, SASdata_folder) |
---|
48 | // (1i in the function name signifies this is a function that supports INPUT from version 1.0 XML files) |
---|
49 | FUNCTION prj_grabMyXmlData() |
---|
50 | FUNCTION prjTest_cansas1d() |
---|
51 | </PRE> |
---|
52 | </BODY> |
---|
53 | </HTML> |
---|
54 | |
---|