0

I have a method which returns below Xml string text that is returned from 3rd party libraries.

I am trying to get the value of 3431 which is at Node AnalysisID.

3431.

I tried accessing using /DlmInput/Clustername/AnalysisId/

It is not able to parse. Can you please help me to extract this value.

Thanks Rita

<?xml version="1.0" encoding="utf-16"?>
<DlmInput
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://Hydra.EngineContracts">
    <ClusterName i:nil="true"
        xmlns="http://Hydra.EngineContracts.Data" />
        <IsRetry
            xmlns="http://Hydra.EngineContracts.Data">false
        </IsRetry>
        <JobId
            xmlns="http://Hydra.EngineContracts.Data">0
        </JobId>
        <JobType
            xmlns="http://Hydra.EngineContracts.Data">1
        </JobType>
        <MachineName
            xmlns="http://Hydra.EngineContracts.Data">06DV
        </MachineName>
        <MustSucceedAllTasks
            xmlns="http://Hydra.EngineContracts.Data">true
        </MustSucceedAllTasks>
        <Name
            xmlns="http://Hydra.EngineContracts.Data">Analysis for SubId: 216 ExpID: 4124 DlmProfileId: 1280
        </Name>
        <OutputString i:nil="true"
            xmlns="http://Hydra.EngineContracts.Data" />
            <ParentRequestId
                xmlns="http://Hydra.EngineContracts.Data">0
            </ParentRequestId>
            <ProgressMsg
                xmlns="http://Hydra.EngineContracts.Data">
            </ProgressMsg>
            <RoutingIdentifier i:nil="true"
                xmlns="http://Hydra.EngineContracts.Data" />
                <Status
                    xmlns="http://Hydra.EngineContracts.Data">Waiting
                </Status>
                <SubmitTime
                    xmlns="http://Hydra.EngineContracts.Data">2018-01-03T11:00:23.1700526-05:00
                </SubmitTime>
                <TaskExecutionContextId
                    xmlns="http://Hydra.EngineContracts.Data">0
                </TaskExecutionContextId>
                <TaskId
                    xmlns="http://Hydra.EngineContracts.Data">0
                </TaskId>
                <Tasks
                    xmlns="http://Hydra.EngineContracts.Data" />
                    <UserFields
                        xmlns="http://Hydra.EngineContracts.Data">
                    </UserFields>
                    <UserId
                        xmlns="http://Hydra.EngineContracts.Data">Service-XL-D
                    </UserId>
                    <AnalysisDescription>45 NA Winterstorm</AnalysisDescription>
                    <AnalysisId>3431</AnalysisId>
                    <AnalysisMode>2</AnalysisMode>
                    <AnalysisName>Analysis for SubId: 216 ExpID: 4124 DlmProfileId: 1280</AnalysisName>
                    <AnalysisType>102</AnalysisType>
                    <Currency>USD</Currency>
                    <EventTypeFilter>0</EventTypeFilter>
                    <ExposureDataModelConnectionString>DSN=EDM;UID=sa;PWD=;SERVER=7DV;DATABASE=EDM;Trusted_Connection=Yes;</ExposureDataModelConnectionString>
                    <Lob></Lob>
                    <ProfileConnectionString>DSN=DLM PROFILES;UID=sa;PWD=;SERVER=7DV;DATABASE=DLMPROFIL;Trusted_Connection=Yes;</ProfileConnectionString>
                    <Region></Region>
                    <ResultsDataModelConnectionString>DSN=RDM;UID=sa;PWD=;SERVER=7DV;DATABASE=Rdm;Trusted_Connection=Yes;</ResultsDataModelConnectionString>
                    <SrcEdm>RMS_EDM_G3P</SrcEdm>
                    <SrcEdmDbGuid>e9efb9e3-b5ef-415c-a7ec-74d0f816b8b7</SrcEdmDbGuid>
                    <SrcEdmSvrName>7DV</SrcEdmSvrName>
                    <TreatyIds
                        xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
                        <User1></User1>
                        <User2></User2>
                        <User3></User3>
                        <User4></User4>
                        <WorkflowStatus></WorkflowStatus>
                        <AnalysisHazardConnectionString>DSN=ANALYSISHAZARD;UID=sa;PWD=;SERVER=7DV;DATABASE=ANALYSISHAZARD;Trusted_Connection=Yes;</AnalysisHazardConnectionString>
                        <DlmConfig>[OUTPUTS]
ConfigDataSource=RMS EVENT INFO
DistanceLimit=800
</DlmConfig>
                        <EmploymentConnectionString>DSN=RMS EMPLOYMENT;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_EMPLOYMENT;Trusted_Connection=Yes;</EmploymentConnectionString>
                        <EngineType>100</EngineType>
                        <EventInfoConnectionString>DSN=RMS EVENT INFO;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_EVENTINFO_original;Trusted_Connection=Yes;</EventInfoConnectionString>
                        <ExposureId>4124</ExposureId>
                        <ExposureName>BrinksP100M</ExposureName>
                        <ExposureType>8019</ExposureType>
                        <GeoHazardConnectionString>DSN=RMS GEOHAZARD;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_GEOHAZARD;Trusted_Connection=Yes;</GeoHazardConnectionString>
                        <GeocodeConnectionString>DSN=RMS GEOCODE;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_GEOCODE;Trusted_Connection=Yes;</GeocodeConnectionString>
                        <GeographyConnectionString>DSN=RMS GEOGRAPHY;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_GEOGRAPHY;Trusted_Connection=Yes;</GeographyConnectionString>
                        <GroundMotionConnectionString>DSN=RMS GROUNDMOTION;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_GROUNDMOTION;Trusted_Connection=Yes;</GroundMotionConnectionString>
                        <HistoricalConnectionString>DSN=RMS HISTORICAL;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_HISTORICAL;Trusted_Connection=Yes;</HistoricalConnectionString>
                        <PerilType>WT</PerilType>
                        <ProfileId>1280</ProfileId>
                        <SkipUnrecognizedConstructionAndOccupancy>true</SkipUnrecognizedConstructionAndOccupancy>
                        <StochasticConnectionString>DSN=RMS STOCHASTIC;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_STOCHASTIC;Trusted_Connection=Yes;</StochasticConnectionString>
                        <SystemDataConnectionString>DSN=RMS SYSTEM DATA;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_SYSTEMDATA;Trusted_Connection=Yes;</SystemDataConnectionString>
                        <TargetConnectionString>DSN=RMS TARGET;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_TARGET;Trusted_Connection=Yes;</TargetConnectionString>
                        <TotalLocations>7</TotalLocations>
                        <UseCustomVulnCurves>0</UseCustomVulnCurves>
                        <UserConfigConnectionString>DSN=RMS USER CONFIG;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_USERCONFIG;Trusted_Connection=Yes;</UserConfigConnectionString>
                        <VulnerabilityConnectionString>DSN=RMS VULNERABILITY;UID=sa;PWD=;SERVER=7DV;DATABASE=RMS_VULNERABILITY;Trusted_Connection=Yes;</VulnerabilityConnectionString>
                    </DlmInput>

1 Answers1

0

If you format your XML properly, you would see that AnalysisId is not nested inside Clustername.

Try using /DMInput/AnalysisId

NetMage
  • 26,163
  • 3
  • 34
  • 55