检查特定的子标记值

时间:2013-11-25 11:12:01

标签: xml xslt-1.0

我需要查找标记<RouteNodeElementTypeCode>的值。如果找到所需的值,则需要从该组中提取某些值。下面是输入xml 可以有<ROW></ROW>个任意数量的块。我试图遍历每个块。但<ROW>块的数量是动态的。对此有任何帮助

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"          xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soap:Body>
    <ReadResponse xmlns="http://jerseytelecom.com/">
        <ReadResult>
            <ISD_XMLGateway xmlns="">
                <Entity>NGN_LPI</Entity>
                <Params>
                    <Param Name="ResponseCode" Value="0"></Param>
                    <Param Name="ResponseText" Value="OK"></Param>
                    <Param Name="Response" Value="NGN_LPI_Response">
                        <NGN_LPI>
                            <Response>
                                <Table>
                                    <Row>
                                        <RouteRecordID>1525571</RouteRecordID>
                                        <LineTypeID>100010</LineTypeID>
                                        <RouteNodeElementID>12066107</RouteNodeElementID>
                                        <RouteNodeElementPosition>329</RouteNodeElementPosition>
                                        <RouteNodeElementBlock>W </RouteNodeElementBlock>
                                        <RouteNodeID>277110</RouteNodeID>
                                        <RouteNodeElementTypeCode>MDF</RouteNodeElementTypeCode>
                                        <Circuit>743980</Circuit>
                                        <Suffix>0</Suffix>
                                        <SortOrder>0</SortOrder>
                                        <RouteNodeElementTypeID>2</RouteNodeElementTypeID>
                                        <RouteOrder>1</RouteOrder>
                                        <NodeID>MDF-S </NodeID>
                                        <ParentNodeTypeID>2</ParentNodeTypeID>
                                        <StatusID>1</StatusID>
                                        <RouteStatusID>1</RouteStatusID>
                                        <ProcessorID></ProcessorID>
                                        <ExchangeID>4</ExchangeID>
                                        <SchemeID></SchemeID>
                                        <SchemeNumber></SchemeNumber>
                                        <RouteConditionID>1</RouteConditionID>
                                        <Spare>False</Spare>
                                        <DesignationID>0</DesignationID>
                                        <Organisation></Organisation>
                                        <AddressLine1>LE CLOS, MAUDELINE ESTATE</AddressLine1>
                                        <AddressLine2>LA ROUTE ORANGE</AddressLine2>
                                        <AddressLine3>ON FIBRE</AddressLine3>
                                        <AddressLine4>St Brélade </AddressLine4>
                                        <AddressLine5>Jersey</AddressLine5>
                                        <PostCode>JE3 8GT</PostCode>
                                        <AddressID>188916</AddressID>
                                        <CustomerID></CustomerID>
                                        <CustomerOrganisation></CustomerOrganisation>
                                        <Title></Title>
                                        <Forename></Forename>
                                        <Surname></Surname>
                                        <CircuitID>501199</CircuitID>
                                        <CableID>300649</CableID>
                                        <CableIDIn>0</CableIDIn>
                                        <DASS>False</DASS>
                                        <RouteTypeID>1</RouteTypeID>
                                        <ChildNodeID></ChildNodeID>
                                        <ChildExchangeID>0</ChildExchangeID>
                                        <ChildRouteNodeElementTypeID>0</ChildRouteNodeElementTypeID>
                                        <ChildNodeTypeID>0</ChildNodeTypeID>
                                        <CAMIVPositionID>0</CAMIVPositionID>
                                        <MDFSuiteID></MDFSuiteID>
                                        <MDFModuleID></MDFModuleID>
                                        <ModuleNumber></ModuleNumber>
                                        <Shelf></Shelf>
                                        <Slot></Slot>
                                        <Position></Position>
                                        <SuiteName></SuiteName>
                                        <TiePairID>0</TiePairID>
                                        <LCT>0</LCT>
                                        <ConnectionStatusID>2</ConnectionStatusID>
                                        <CeaseDate>01/01/2001 00:00:00</CeaseDate>
                                        <FaultTypeID>0</FaultTypeID>
                                        <CAMIVPositionIDOut>0</CAMIVPositionIDOut>
                                        <MDFSuiteIDOut></MDFSuiteIDOut>
                                        <MDFModuleIDOut></MDFModuleIDOut>
                                        <ModuleNumberOut></ModuleNumberOut>
                                        <ShelfOut></ShelfOut>
                                        <SlotOut></SlotOut>
                                        <PositionOut></PositionOut>
                                        <SuiteNameOut></SuiteNameOut>
                                        <CableNodeIDOut>80762</CableNodeIDOut>
                                        <LoopResistanceOut>82.620002746582</LoopResistanceOut>
                                        <DBLossOut>0.583200037479401</DBLossOut>
                                        <PairCountOut>400</PairCountOut>
                                        <FaultyPairCountOut>8</FaultyPairCountOut>
                                        <CurrentPairUsageOut>400</CurrentPairUsageOut>
                                        <CableNodeIDIn></CableNodeIDIn>
                                        <LoopResistanceIn></LoopResistanceIn>
                                        <DBLossIn></DBLossIn>
                                        <PairCountIn></PairCountIn>
                                        <FaultyPairCountIn></FaultyPairCountIn>
                                        <CurrentPairUsageIn></CurrentPairUsageIn>
                                        <HouseNumber></HouseNumber>
                                        <WorkflowPending>False</WorkflowPending>
                                        <OrderNumber>3540497</OrderNumber>
                                        <EquipmentTypeID>0</EquipmentTypeID>
                                        <StrowgerVertIn></StrowgerVertIn>
                                        <StrowgerVertOut></StrowgerVertOut>
                                        <JobListID>0</JobListID>
                                        <ShortCircuit>743980</ShortCircuit>
                                        <CablePair>0</CablePair>
                                        <FibreModule>0</FibreModule>
                                        <FibreShelf>0</FibreShelf>
                                        <SchemeStatusID></SchemeStatusID>
                                        <ABSDSB>0</ABSDSB>
                                        <RequiredDate>14/09/2012 08:25:05</RequiredDate>
                                        <ParentExchangeID>4</ParentExchangeID>
                                        <ElementExchangeID>4</ElementExchangeID>
                                    </Row>

                                </Table>
                            </Response>
                            <ResponseCode>0</ResponseCode>
                            <ResponseText>Ok</ResponseText>
                        </NGN_LPI>
                    </Param>
                </Params>
            </ISD_XMLGateway>
        </ReadResult>
      </ReadResponse>
    </soap:Body>
  </soap:Envelope>

0 个答案:

没有答案