2012-05-17 5 views
0

У меня возникли серьезные трудности с получением значения определенных узлов в этом мыльном сообщении. Пожалуйста помоги.Имея серьезные проблемы с xpath против мыла, пожалуйста,

Мне нужно получить субтотальную узел (значение = 68682):

«/ ребенок :: мыла: Envelope/ребенок :: мыло: Body/ребенок :: Защита: ValuationOut/ребенок :: Защита: MMHValuation/child :: def: CalculationResult/child :: def: PrimaryStructureStandardizedCost/child :: def: SubTotal "

По какой-то причине вышеуказанное выражение xpath не работает. Пожалуйста помоги.

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> 
<soap:Header> 
<wsa:Action>http://abcdefg.com/expresslync/rct:ExportValuation-NumResponse</wsa:Action> 
<wsa:MessageID>urn:uuid:81566a22-9b8b-41bc-9e6b-66b72e73773f</wsa:MessageID> 
<wsa:RelatesTo>urn:uuid:ad4da6ca-690a-466e-aba0-16e94e153b55</wsa:RelatesTo> 
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To> 
<wsse:Security> 
<wsu:Timestamp wsu:Id="Timestamp-a3b7efdc-d0a3-40f9-bb14-8dcc1c64109d"> 
<wsu:Created>2012-05-16T21:40:53Z</wsu:Created> 
<wsu:Expires>2012-05-16T21:45:53Z</wsu:Expires> 
</wsu:Timestamp> 
</wsse:Security> 
</soap:Header> 
<soap:Body> 
<ValuationOut xmlns="http://abcdefg.com/expresslync/rct"> 
<MMHValuation xmlns="http://abcdefg.com/expresslync/rct/valuation"> 
<ValuationIdentifier> 
<RecordId>1677849</RecordId> 
<PolicyNumber>RBPFIKQNCPVUAELLGVKY</PolicyNumber> 
<VersionId>7091601</VersionId> 
</ValuationIdentifier> 
<RecordType>POL</RecordType> 
<PolicyStatus>Complete</PolicyStatus> 
<DataSource>BW</DataSource> 
<PropertyAddress> 
<Address1/> 
<Address2/> 
<City/> 
<StateOrProvince>CA</StateOrProvince> 
<ZipOrPostalCode>90048</ZipOrPostalCode> 
</PropertyAddress> 
<OwnerUser>UnknownUser</OwnerUser> 
<AssignedByUser>msbsupport</AssignedByUser> 
<CreateDate>2012-05-16T14:40:51.393</CreateDate> 
<CreateUser>msbsupport</CreateUser> 
<UpdateDate>2012-05-16T14:40:51.393</UpdateDate> 
<UpdateStatusDate>2012-05-16T14:40:51.393</UpdateStatusDate> 
<UpdateUser>msbsupport</UpdateUser> 
<PolicyEffectiveDate>2012-05-16T14:41:00</PolicyEffectiveDate> 
<PolicyRenewalDate>2013-05-16T14:41:00</PolicyRenewalDate> 
<InsuredCustomer> 
<MailingAddressSameAsPropertyAddress>false</MailingAddressSameAsPropertyAddress> 
<MailingAddress> 
<Address1/> 
<Address2/> 
<City/> 
<StateOrProvince/> 
<ZipOrPostalCode/> 
</MailingAddress> 
</InsuredCustomer> 
<CurrentCoverageAmount>111111</CurrentCoverageAmount> 
<Comment Type="Some Comment"/> 
<Comment Type="Some Other Comment"/> 
<AttachmentCount>0</AttachmentCount> 
<CalculationResult> 
<CalcUser>somesupport</CalcUser> 
<CalcDate>2012-05-16T14:40:51.377</CalcDate> 
<CostDataVersion> 
<Id>2012/05</Id> 
<Description/> 
<Date>2012-05-15</Date> 
</CostDataVersion> 
<BuildingSystemCost> 
<LaborCost>0</LaborCost> 
<EquipmentCost>0</EquipmentCost> 
<MaterialCost>0</MaterialCost> 
<System>Sitework</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>2292</LaborCost> 
<EquipmentCost>11</EquipmentCost> 
<MaterialCost>1755</MaterialCost> 
<System>Foundations</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>0</LaborCost> 
<EquipmentCost>0</EquipmentCost> 
<MaterialCost>0</MaterialCost> 
<System>SlabonGrade</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>4043</LaborCost> 
<EquipmentCost>13</EquipmentCost> 
<MaterialCost>13964</MaterialCost> 
<System>Framing</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>1249</LaborCost> 
<EquipmentCost>0</EquipmentCost> 
<MaterialCost>2348</MaterialCost> 
<System>Roofing</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>4833</LaborCost> 
<EquipmentCost>85</EquipmentCost> 
<MaterialCost>8831</MaterialCost> 
<System>ExteriorWalls</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>2619</LaborCost> 
<EquipmentCost>18</EquipmentCost> 
<MaterialCost>3040</MaterialCost> 
<System>Partitions</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>743</LaborCost> 
<EquipmentCost>9</EquipmentCost> 
<MaterialCost>859</MaterialCost> 
<System>WallFinishes</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>817</LaborCost> 
<EquipmentCost>0</EquipmentCost> 
<MaterialCost>1744</MaterialCost> 
<System>FloorFinishes</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>618</LaborCost> 
<EquipmentCost>8</EquipmentCost> 
<MaterialCost>329</MaterialCost> 
<System>CeilingFinishes</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>1366</LaborCost> 
<EquipmentCost>0</EquipmentCost> 
<MaterialCost>2742</MaterialCost> 
<System>ElectricalSystems</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>0</LaborCost> 
<EquipmentCost>0</EquipmentCost> 
<MaterialCost>0</MaterialCost> 
<System>AttachedStructures</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>0</LaborCost> 
<EquipmentCost>0</EquipmentCost> 
<MaterialCost>0</MaterialCost> 
<System>DetachedStructure</System> 
</BuildingSystemCost> 
<BuildingSystemCost> 
<LaborCost>0</LaborCost> 
<EquipmentCost>137</EquipmentCost> 
<MaterialCost>0</MaterialCost> 
<System>GeneralConditions</System> 
</BuildingSystemCost> 
<PrimaryStructureStandardizedCost> 
<InsurableReplacementCost>72109</InsurableReplacementCost> 
<InsuredValue>0</InsuredValue> 
<Depreciation>0</Depreciation> 
<Subtotal>**68682**</Subtotal> 
<Adjustment>0</Adjustment> 
<ActualCashValue>50477</ActualCashValue> 
<LaborCost>21862</LaborCost> 
<EquipmentCost>285</EquipmentCost> 
<MaterialCost>46535</MaterialCost> 
<SubTotal>68682</SubTotal> 
<TotalReplacementCost>72109</TotalReplacementCost> 
<PolicyExclusions>0</PolicyExclusions> 
<HistoricalDepreciation>21632</HistoricalDepreciation> 
<RCLessHistoricalDepreciation>50477</RCLessHistoricalDepreciation> 
<CurrentCoveragePercentOfIRC>154.00</CurrentCoveragePercentOfIRC> 
<DebrisRemoval>3427</DebrisRemoval> 
<SubtotalAfterDebrisRemoval>72109</SubtotalAfterDebrisRemoval> 
<FinishedFloorArea>1111</FinishedFloorArea> 
</PrimaryStructureStandardizedCost> 
<DetachedStructuresStandarddizedCost> 
<InsurableReplacementCost>0</InsurableReplacementCost> 
<InsuredValue>0</InsuredValue> 
<Depreciation>0</Depreciation> 
<Subtotal>0</Subtotal> 
<Adjustment>0</Adjustment> 
<ActualCashValue>0</ActualCashValue> 
<PercentOfPrimaryStructureIRC>0.00</PercentOfPrimaryStructureIRC> 
<DebrisRemoval>0</DebrisRemoval> 
<SubtotalAfterDebrisRemoval>0</SubtotalAfterDebrisRemoval> 
</DetachedStructuresStandarddizedCost> 
<WholeBuildingCost> 
<InsurableReplacementCost>72109</InsurableReplacementCost> 
<InsuredValue>72109</InsuredValue> 
</WholeBuildingCost> 
</CalculationResult> 
<Preferences> 
<ExcavationFlag>true</ExcavationFlag> 
</Preferences> 
<Adjustment> 
<GeneralPercentage>0.00</GeneralPercentage> 
<DepreciationChoice>EnteredPercentage</DepreciationChoice> 
<DepreciationPercentage>0.00</DepreciationPercentage> 
<DepreciationEffectiveAge>0</DepreciationEffectiveAge> 
<WageType>Reconstruction</WageType> 
<ApplyHistoricalDepreciation>true</ApplyHistoricalDepreciation> 
</Adjustment> 
<Building> 
<SiteAccess>Flat_Area_Roads</SiteAccess> 
<HomeStyle>SingleWide</HomeStyle> 
<Component> 
<Material>015123</Material> 
<Amount>100.00</Amount> 
</Component> 
<Component> 
<Material>015001</Material> 
<Amount>100.00</Amount> 
</Component> 
<Component> 
<Material>035503</Material> 
<Amount>75.00</Amount> 
</Component> 
<Component> 
<Material>055002</Material> 
<Amount>1.00</Amount> 
</Component> 
<Component> 
<Material>055102</Material> 
<Amount>2.00</Amount> 
</Component> 
<Component> 
<Material>060021</Material> 
<Amount>1.00</Amount> 
</Component> 
<Section> 
<Number>1</Number> 
<Name>Main</Name> 
<YearBuilt>2000</YearBuilt> 
<ContructionType>Standard</ContructionType> 
<NoOfStories>1.00</NoOfStories> 
<LivingArea>1111</LivingArea> 
<PerimeterChoice>Shape</PerimeterChoice> 
<LivingAreaEntryMethod>TotalLivingArea</LivingAreaEntryMethod> 
<FoundationAndBasement> 
<PiersRaisedPct>100</PiersRaisedPct> 
<BasementPct>0</BasementPct> 
</FoundationAndBasement> 
<Framing Type="Wood2x4" Percent="100"/> 
<HingedRoof>false</HingedRoof> 
</Section> 
</Building> 
</MMHValuation> 
</ValuationOut> 
</soap:Body> 
</soap:Envelope> 
+0

Указанный XPath действительно является правильным способом получить элемент, и он работает для меня. Проблема будет в другом месте. Поскольку я не знаю VB, я не могу помочь. Но попробуйте построить из более коротких и простых XPaths, попробуйте, например. '/ Ребенок :: мыло: Envelope'. Если это не может быть найдено, вы тоже узнаете, что у вас есть ошибка где-то еще. –

+0

Поиск в Интернете для: «XPath default namespace» - также есть много таких вопросов с хорошими ответами в тегах «xpath» и «xslt» –

ответ

0

только XPath: // SubTotal Виль вернет вам узел Subtotal.

+0

Спасибо, что посмотрели. Вот мой скрипт vbs. // SubTotal не работает. –

+0

'On Error Resume Next Set FSO = CreateObject ("Scripting.FileSystemObject") Set Fw = fso.CreateTextFile ("C: \ ALOGFILE.txt") fw.WriteLine ("ПЕРЕД CREATE XMLDOM OBJECT") набор xmlDoc = CreateObject ("Microsoft.XMLDOM") xmlDoc.async = ложно xmlDoc.LoadXml ("C: \ TestXml.xml") fw.WriteLine ("ПОСЛЕ CREATE XMLDOM OBJECT") дим SUBT, ДР, TRC , знач1, знач2, ​​val3 fw.WriteLine ("ДО Выбрать узел") Набор Узел = xmlDoc.documentElement.selectSingleNode ("// субтотальным") fw.WriteLine (Node.text) fw.WriteLine ("После выбора УЗЕЛ") fw.Close Если не xmlDoc ничего после этого Set xmlDoc = Nothing End If' –

+0

Попробуйте '// Subtotal' или' // оценка: Subtotal'. XPath чувствителен к регистру. – rishimaharaj