有没有办法做一个Select-Object
并获取不同级别节点的值?
我需要字段级别的名称和一堆字段,还需要 globalFormat categoryType。有没有办法让它们合二为一Select-Object
?
XML
<field name="FLD0000001" tableAlias="*SERVER" tableName="*SERVER">
<order>0</order>
<version></version>
<afterEditEvent></afterEditEvent>
<format></format>
<globalFormat categoryType="Number" countrySymbolCode="" dateFormat="" timeFormat="" imageFormat="None" decimalPlaces="2" leadingZero="0" isCentury="false" negativeFormat="NegativeSymbol" />
<columnGroupHeading></columnGroupHeading>
<dataFieldType>20</dataFieldType>
<columnHeading><![CDATA[FLD0000001]]></columnHeading>
<hideHeader>False</hideHeader>
<groupable>0</groupable>
<subTotal>0</subTotal>
<calculation></calculation>
<jScriptCalculation />
<editCalculation scriptContent="" scriptDisplayContent="">
<tokens />
<triggers />
</editCalculation>
<onCalculationEvent></onCalculationEvent>
<onValidationEvent></onValidationEvent>
<editableAdvanced></editableAdvanced>
<addRequired>0</addRequired>
<splitByRationOn></splitByRationOn>
<defaultValue></defaultValue>
<isCalculatable>0</isCalculatable>
<isUpdatable>0</isUpdatable>
<visibleAdvanced></visibleAdvanced>
<editableLevel>0</editableLevel>
<visibleLevel>10</visibleLevel>
<fullTypeName></fullTypeName>
<dataType>NUMERIC</dataType>
<dataLength>5</dataLength>
<description source="" format="4"></description>
<dimensionTitle></dimensionTitle>
<definition></definition>
<parameterName></parameterName>
<cubeDimensionOrder>0</cubeDimensionOrder>
<subTotalRestrictions></subTotalRestrictions>
<subTotalExceptions></subTotalExceptions>
<matrixHeaderValue></matrixHeaderValue>
<promptRestricted>0</promptRestricted>
<prompt processId="" />
<promptOption></promptOption>
<sortOrderForPrompt>NONE</sortOrderForPrompt>
<filterForPrompt></filterForPrompt>
<relatedFields></relatedFields>
<validateAgainstPrompt>False</validateAgainstPrompt>
<subGroupId></subGroupId>
<indexInGroup>0</indexInGroup>
<widthInFieldArea>2000</widthInFieldArea>
</field>
我基本上想检查dataFieldType,如果是20或21,检查globalFormat categoryType看是否没有,如果是,则在文件中输出为尚未正确设置的Field。但我喜欢那个 xml 中的数百个字段