How to store value in XSL and syntax for-each?

旧巷老猫 提交于 2019-12-12 03:15:13

问题


My request XML is :

<?xml version="1.0" encoding="utf-8"?>
<test123 class="test" version="str1234">
    <Header>
        <MYD>str1234</MYID>
    </Header>
    <Body>
        <Action method="Request" type="PROV">
            <Approval>
                <Approval1>1234567890</Approval1>
                <Linked123>
                    <XYZNumber>12345</XYZNumber>
                </Linked123>
                <Version>123</Version>
                <Country level="12"  hasModified="true" isSelected="true">
                    <Year>1999</Year>
                    <Month>Jan</MonthShortName>
                </Country>
                <Version>123</Version>
                <Country level="12"  hasModified="true" isSelected="true">
                    <Year>1990</Year>
                    <Month>May</MonthShortName>
                </Country>
            </Approval>
        </Action>
    </Body>
</test123>

My question is in XSL if field "version" is blank and "Approval1" is blank etc, then I will store all the error (my customise message) for every field in common variable and at the end I will return that variable value to forward requester, so that I will get the consolidated all the error in single variable and return back to user.

And also: how can I use for-each for the field of "country level" as it is repeating two times?

来源:https://stackoverflow.com/questions/39304301/issue-with-foreach-in-xsl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!