Skip to main content
June 21, 2023
Question

xpathsnippet in version 23.2 yields error

  • June 21, 2023
  • 3 replies
  • 0 views

Following code worked fine up until 23.2:
xpathsnippet(local!xml, "//fs:PartyRoleCollection/fs:PartyRole[1]/fs:Party/fs:PartyReference/text()")

Now we receive an error: "Namespace with prefix 'fs' has not been declared."

Anyone else experience this?

3 replies

June 21, 2023

Can you please share the XML snippet also? Make sure that you have correctly defined namespace for the prefix - fs in the Xpath.

It is working perfectly fine with the 23.2 version as well.

June 22, 2023

As said it has worked (for over 3 years) before version 23.2. Here is part of the XML:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="">schemas.xmlsoap.org/.../"
xmlns:force="
">schemas.datacontract.org/.../Force.Mortgages.Agreements.Contracts.V1.Queries"
xmlns:fs="">schemas.datacontract.org/.../Force.Mortgages.Agreements.Contracts.V1.FinancialStructure"
xmlns:com="">schemas.datacontract.org/.../Force.Mortgages.Agreements.Contracts.V1.Common"
xmlns:tp="">schemas.datacontract.org/.../Force.Mortgages.Agreements.Contracts.V1.TerminatedParts"
xmlns:quer="queries.agreements.mortgages.finance.topicus.nl"
xmlns:xsi="">www.w3.org/.../XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<quer:GetResponse>
<quer:FinancialStructure>
<force:FinancialStructureNumber>XXXXXX</force:FinancialStructureNumber>
<force:Whitelabel>
<fs:Reference>XXXXX</fs:Reference>
</force:Whitelabel>
<force:IntermediaryReference>XXXXX</force:IntermediaryReference>
<force:AgreementCollection>
<fs:Agreement>
<fs:Number>9</fs:Number>
<fs:Lender>
<fs:Reference>XXX</fs:Reference>
</fs:Lender>
<fs:Productline>
<fs:Code>XXX</fs:Code>
<fs:CommercialName>XXXXXXXXX</fs:CommercialName>
</fs:Productline>
<fs:TermsAndConditions>
<fs:PenaltyTerms>
<fs:PenaltyFreePercentage>0.10000</fs:PenaltyFreePercentage>
<fs:PenaltyCalculationMethod>XXXXXXXXXXXXXX</fs:PenaltyCalculationMethod>
</fs:PenaltyTerms>
<fs:RelocationTermInMonths>1</fs:RelocationTermInMonths>
<fs:Version>1</fs:Version>
</fs:TermsAndConditions>
<fs:StartDate>2011-09-09T00:00:00</fs:StartDate>
<fs:TermsAndConditionsApplicationDate>2011-09-09T00:00:00</fs:TermsAndConditionsApplicationDate>
<fs:OriginalPrincipal>
<com:CurrencyType>EUR</com:CurrencyType>
<com:Value>1.00</com:Value>
</fs:OriginalPrincipal>
<fs:LoanCollection>
<fs:RelatedLoan>
<fs:Reference>XXXXXXX-1</fs:Reference>
</fs:RelatedLoan>
<fs:RelatedLoan>
<fs:Reference>XXXXXXX-2</fs:Reference>
</fs:RelatedLoan>
<fs:RelatedLoan>
<fs:Reference>XXXXXXX-3</fs:Reference>
</fs:RelatedLoan>
</fs:LoanCollection>
<fs:PartyRoleCollection>
<fs:PartyRole>
<fs:Party>
<fs:PartyReference>1234567</fs:PartyReference>
</fs:Party>
<fs:RoleType>XXXXXXX</fs:RoleType>
</fs:PartyRole>
</fs:PartyRoleCollection>
</fs:Agreement>
</force:AgreementCollection>
>>>>cut off<<<<<

June 22, 2023

I pasted this XML snippet in an online XML validator and it says that it is invalid.

Here is an example to show that xpathsnippet() works with Xpath having prefix defined.