Требуется XSLT-фильтрация XML узлов без атрибуции - PullRequest
0 голосов
/ 07 августа 2020

Мои XML записи имеют атрибуты изменения, такие как «isAdded», «isDeleted», «isUpdated» et c. а также есть записи, которые не имеют таких атрибутов, которые я хочу исключить на выходе XML

Мой источник XML выглядит как показано ниже,

    <weci:Workers_Effective_Stack xmlns:weci="urn:com.workday/weci">
          <weci:Worker>      
          <weci:Effective_Change weci:Sequence="1">         
                <weci:Payment_Election weci:isDeleted="1">
                <weci:Payment_Election_Rule>GBL_PaymentElectionRule_Default_Expense_Rule</weci:Payment_Election_Rule>
                <weci:Order>1</weci:Order>
                <weci:Payment_Type>GBL-PaymentType_Direct_Deposit</weci:Payment_Type>
                <weci:Country>ES</weci:Country>
                <weci:Currency>EUR</weci:Currency>            
                <weci:Distribution_Balance>1</weci:Distribution_Balance>
             </weci:Payment_Election>
             <weci:Payment_Election weci:isAdded="1">
                <weci:Payment_Election_Rule>GBL_PaymentElectionRule_Default_Expense_Rule</weci:Payment_Election_Rule>
                <weci:Order>1</weci:Order>
                <weci:Payment_Type>GBL-PaymentType_Direct_Deposit</weci:Payment_Type>
                <weci:Country>ES</weci:Country>
                <weci:Currency>EUR</weci:Currency>
                <weci:Bank_Account_Nickname>Expenses</weci:Bank_Account_Nickname>            
                <weci:Distribution_Balance>1</weci:Distribution_Balance>
             </weci:Payment_Election>
             <weci:Payment_Election>
                <weci:Payment_Election_Rule>GBL_PaymentElectionRule_Spain_Pay_Rule</weci:Payment_Election_Rule>
                <weci:Order>1</weci:Order>
                <weci:Payment_Type>GBL-PaymentType_Direct_Deposit</weci:Payment_Type>
                <weci:Country>ES</weci:Country>
                <weci:Currency>EUR</weci:Currency>            
                <weci:Distribution_Balance>1</weci:Distribution_Balance>
             </weci:Payment_Election>
          </weci:Effective_Change>
       </weci:Worker>
    </weci:Workers_Effective_Stack>

Мои ожидания выглядят так, как показано ниже :

    <weci:Workers_Effective_Stack xmlns:weci="urn:com.workday/weci">
          <weci:Worker>      
          <weci:Effective_Change weci:Sequence="1">         
                <weci:Payment_Election weci:isDeleted="1">
                <weci:Payment_Election_Rule>GBL_PaymentElectionRule_Default_Expense_Rule</weci:Payment_Election_Rule>
                <weci:Order>1</weci:Order>
                <weci:Payment_Type>GBL-PaymentType_Direct_Deposit</weci:Payment_Type>
                <weci:Country>ES</weci:Country>
                <weci:Currency>EUR</weci:Currency>            
                <weci:Distribution_Balance>1</weci:Distribution_Balance>
             </weci:Payment_Election>
             <weci:Payment_Election weci:isAdded="1">
                <weci:Payment_Election_Rule>GBL_PaymentElectionRule_Default_Expense_Rule</weci:Payment_Election_Rule>
                <weci:Order>1</weci:Order>
                <weci:Payment_Type>GBL-PaymentType_Direct_Deposit</weci:Payment_Type>
                <weci:Country>ES</weci:Country>
                <weci:Currency>EUR</weci:Currency>
                <weci:Bank_Account_Nickname>Expenses</weci:Bank_Account_Nickname>            
                <weci:Distribution_Balance>1</weci:Distribution_Balance>
             </weci:Payment_Election>             
          </weci:Effective_Change>
       </weci:Worker>
    </weci:Workers_Effective_Stack>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...