1
각 레코드의 다른 요소 값을 기반으로 요소 값을 가져와야합니다. 나는 두 그룹이 두 번째 요소 이뤄졌다는 점이고 기준에 따라 그들을 가지고 있습니다xslt를 사용하여 각 레코드의 다른 요소 값을 기반으로 요소 값을 얻는 방법
경우 RECORD_TYPE은 = '경고'나는이 경고에 따라 모든 레코드에 대한 모든 ERROR_DESC 값을 인쇄 할 수 있습니다 ERROR_DESC 을 경우 RECORD_TYPE = 'ERROR '그러면 모든 레코드의 모든 ERROR_DESC 값을 아래에 인쇄해야합니다. ERRORS : ERROR_DESC
각 오류 설명은 줄 바꿈으로 인쇄해야합니다.
<root>
<SellOutErrorRecord>
<RECORD_TYPE>WARNING</RECORD_TYPE>
<ERROR_DESC>record 1:location id is invalid</ERROR_DESC>
<RECORD_NO>1</RECORD_NO>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<PRODUCT_NUMBER>336549R-001</PRODUCT_NUMBER>
<PRODUCT_OPTION>0D1</PRODUCT_OPTION>
<PRODUCT_LINE>LA</PRODUCT_LINE>
</SellOutErrorRecord>
<SalesInErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>record 1:location id is invalid</ERROR_DESC>
<RECORD_NO>1</RECORD_NO>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<PRODUCT_NUMBER>336549R-001</PRODUCT_NUMBER>
<PRODUCT_OPTION>0D1</PRODUCT_OPTION>
<PRODUCT_LINE>LA</PRODUCT_LINE>
<PRODUCT_LINE_TYPE>C</PRODUCT_LINE_TYPE>
</SalesInErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>record 2:SO:invoiced net amount is invalid</ERROR_DESC>
<RECORD_NO>2</RECORD_NO>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<PRODUCT_NUMBER>3X-KN73C-DB</PRODUCT_NUMBER>
<PRODUCT_OPTION>0D1</PRODUCT_OPTION>
<PRODUCT_LINE>HA</PRODUCT_LINE>
<PRODUCT_LINE_TYPE>E</PRODUCT_LINE_TYPE>
</SellOutErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>record 3:SO:transaction currency is invalid</ERROR_DESC>
<RECORD_NO>3</RECORD_NO>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<PRODUCT_NUMBER>339112-B25</PRODUCT_NUMBER>
<PRODUCT_OPTION>0D1</PRODUCT_OPTION>
<PRODUCT_LINE>J3</PRODUCT_LINE>
<PRODUCT_LINE_TYPE>E</PRODUCT_LINE_TYPE>
</SellOutErrorRecord>
<SalesInErrorRecord>
<RECORD_TYPE>WARNING</RECORD_TYPE>
<ERROR_DESC>record 3:SI:buy quantity is zero</ERROR_DESC>
<RECORD_NO>3</RECORD_NO>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<PRODUCT_NUMBER>339112-B25</PRODUCT_NUMBER>
<PRODUCT_OPTION>0D1</PRODUCT_OPTION>
<PRODUCT_LINE>J3</PRODUCT_LINE>
<PRODUCT_LINE_TYPE>E</PRODUCT_LINE_TYPE>
</SalesInErrorRecord>
<SalesInErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>record 3:SI:transaction document id is invalid</ERROR_DESC>
<RECORD_NO>3</RECORD_NO>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<PRODUCT_NUMBER>339112-B25</PRODUCT_NUMBER>
<PRODUCT_OPTION>0D1</PRODUCT_OPTION>
<PRODUCT_LINE>J3</PRODUCT_LINE>
<PRODUCT_LINE_TYPE>E</PRODUCT_LINE_TYPE>
</SalesInErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>WARNING</RECORD_TYPE>
<ERROR_DESC>record 4:SO:invoiced net amount is invalid</ERROR_DESC>
<RECORD_NO>4</RECORD_NO>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<PRODUCT_NUMBER>445860-B21</PRODUCT_NUMBER>
<PRODUCT_OPTION>0D1</PRODUCT_OPTION>
<PRODUCT_LINE>MV</PRODUCT_LINE>
<PRODUCT_LINE_TYPE>C</PRODUCT_LINE_TYPE>
</SellOutErrorRecord>
<SalesInErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>record 5:SI:transaction currency is null or invalid</ERROR_DESC>
<RECORD_NO>5</RECORD_NO>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<PRODUCT_NUMBER>339112-B25</PRODUCT_NUMBER>
<PRODUCT_OPTION>0D1</PRODUCT_OPTION>
<PRODUCT_LINE>J3</PRODUCT_LINE>
<PRODUCT_LINE_TYPE>E</PRODUCT_LINE_TYPE>
</SalesInErrorRecord>
<InventoryErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>record 6:product id is invalid</ERROR_DESC>
<RECORD_NO>6</RECORD_NO>
<LOCATION_NAME>XYZ XYZ</LOCATION_NAME>
<PRODUCT_NUMBER>331184-B21</PRODUCT_NUMBER>
<PRODUCT_OPTION>0S1</PRODUCT_OPTION>
<PRODUCT_LINE>R8</PRODUCT_LINE>
<PRODUCT_LINE_TYPE>E</PRODUCT_LINE_TYPE>
</InventoryErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>record 6:SO:invoiced net amount is invalid</ERROR_DESC>
<RECORD_NO>6</RECORD_NO>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<PRODUCT_NUMBER>339112-B25</PRODUCT_NUMBER>
<PRODUCT_OPTION>0D1</PRODUCT_OPTION>
<PRODUCT_LINE>J3</PRODUCT_LINE>
<PRODUCT_LINE_TYPE>E</PRODUCT_LINE_TYPE>
</SellOutErrorRecord>
</root>
예상 출력
ERRORS:
<ERROR>record 1:location id is invalid</ERROR>
<ERROR>record 2:SO:invoiced net amount is invalid</ERROR>
<ERROR>record 3:SO:transaction currency is invalid</ERROR>
<ERROR>record 3:SI:transaction document id is invalid</ERROR>
<ERROR>record 5:SI:transaction currency is null or invalid</ERROR>
<ERROR>record 6:product id is invalid</ERROR>
<ERROR>record 6:SO:invoiced net amount is invalid</ERROR>
WARNINGS:
<ERROR>record 1:location id is invalid</ERROR>
<ERROR>record 3:SI:buy quantity is zero</ERROR>
<ERROR>record 4:SO:invoiced net amount is invalid</ERROR>