Как провалить проверку схемы, если значение в одном узле больше, чем значение в другом? - PullRequest
0 голосов
/ 12 октября 2009

Я все, учитывая следующий фрагмент xml, как будет выглядеть xsd, будет гарантировать, что проверка chema не удастся, если MortgageProductInterestRateCollarLimitPct будет больше, чем MortgageProductInterestRateCappedLimitPct?

<MortgageInterestRate>
  <MortgageInterestRatePercentage>1.99</MortgageInterestRatePercentage> 
  <MortgageInterestRatePeriodInMonths>0</MortgageInterestRatePeriodInMonths> 
  <MortgageInterestRateTypeCode>V</MortgageInterestRateTypeCode> 
  <MortgageInterestRateTierName>Standard Mortgage Rate</MortgageInterestRateTierName> 
  <MortgageProductInterestRateLoadingPct>0.00</MortgageProductInterestRateLoadingPct> 
  <MortgageProductInterestRateBaseRateTypeCode>4</MortgageProductInterestRateBaseRateTypeCode> 
  <MortgageProductInterestRateCappedLimitPct>234534<MortgageProductInterestRateCappedLimitPct /> 
  <MortgageProductInterestRateCollarLimitPct>654<MortgageProductInterestRateCollarLimitPct /> 
</MortgageInterestRate>

Спасибо

1 Ответ

2 голосов
/ 12 октября 2009

Это тип проверки, который не может обработать XML-схема. Вы можете определить структурные ограничения и ограничения для отдельных узлов и их значений, но вы не можете получить проверки, которые зависят от других узлов и их значений.

Для этого вам придется взглянуть на другие механизмы проверки XML, такие как Schematron или другие.

Марк

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...