У меня есть следующий XMLXSLT заменить атрибуты
<ExternalAssessmentRequest>
<ApplicationData Lender="Test">
<LiabilityList>
<RequestedLoan Identifier="New1" BaseAmount="250000" LoanAccountFees="100" LoanAccountLMI="2000" LoanTerm="25" LoanTermMonths="6" Product="Basic Variable" Repurposing="No" PrimaryPurpose="OwnerOccupied" TaxDeductible="No" InterestRate="0.075" ProductID="Product1" PaymentType="InterestOnly" ABSCode="123">
<Applicant RelatedIdentifier="Applicant1" Percentage="0.5"/>
<Applicant RelatedIdentifier="Applicant2" Percentage="0.5"/>
<Feature Code="SupaPackage"/>
</RequestedLoan>
</LiabilityList>
</ApplicationData>
<AdditionalAssessment Lender="MegaBank">
<RequestedLoan Product="Supa Variable" ProductID="Product2"/>
</AdditionalAssessment>
</ExternalAssessmentRequest>
мне нужно использовать Xpath, чтобы создать два отдельных элемента. Один из них - существующий, а другой - уже существующий, но только те элементы и атрибуты, которые указаны в нем, должны быть заменены.
Таким образом, конечный результат должен быть
<ExternalAssessmentRequest>
<ApplicationData Lender="Test">
<LiabilityList>
<RequestedLoan Identifier="New1" BaseAmount="250000" LoanAccountFees="100" LoanAccountLMI="2000" LoanTerm="25" LoanTermMonths="6" Product="Basic Variable" Repurposing="No" PrimaryPurpose="OwnerOccupied" TaxDeductible="No" InterestRate="0.075" ProductID="Product1" PaymentType="InterestOnly" ABSCode="123">
<Applicant RelatedIdentifier="Applicant1" Percentage="0.5"/>
<Applicant RelatedIdentifier="Applicant2" Percentage="0.5"/>
<Feature Code="SupaPackage"/>
</RequestedLoan>
</LiabilityList>
</ApplicationData>
<ApplicationData Lender="MegaBank">
<LiabilityList>
<RequestedLoan Identifier="New1" BaseAmount="250000" LoanAccountFees="100" LoanAccountLMI="2000" LoanTerm="25" LoanTermMonths="6" Product="Supa Variable" Repurposing="No" PrimaryPurpose="OwnerOccupied" TaxDeductible="No" InterestRate="0.075" ProductID="Product2" PaymentType="InterestOnly" ABSCode="123">
<Applicant RelatedIdentifier="Applicant1" Percentage="0.5"/>
<Applicant RelatedIdentifier="Applicant2" Percentage="0.5"/>
<Feature Code="SupaPackage"/>
</RequestedLoan>
</LiabilityList>
</ApplicationData>
</ExternalAssessmentRequest>
Pleaseeee помочь мне.
Это не соответствует вашему требованию, потому что вы еще не полностью определили, что вам нужно сделать еще большую работу для добровольцев. –
В ApplicationData будут другие элементы, кроме LiabilityList, есть ApplicantList> и некоторые другие элементы, которые также должны быть скопированы –
user1457881
Я разместил более подробный вопрос здесь: http://stackoverflow.com/questions/18776631/xslt- replace-elemetns-and-attributes – user1457881