我想在DOM中显示XML表。 我有一些非常复杂的xml表数据,要在DOM中显示。 如何做到这一点。
我已经尝试过sanitizer.bypassSecurityTrustHtml()
,但是它什么也没显示。
<div [innerHTML] ="analysisList">
this.analysisList = this.sanitizer.bypassSecurityTrustHtml(
this.bankTabResponse[0]['analysisList'][0]['monthlyDetails']
);
例如,这是xml数据之一
<MonthlyDetails>
<MonthlyDetail balAvg="142.71" balMax="650.24" balMin="0.24" cashDeposits="1" cashWithdrawals="0" chqDeposits="0" chqIssues="0" credits="8" debits="8" inwBounces="0" monthName="Nov-18" outwBounces="0" salaries="0" startDate="2018-11-01" totalCashDeposit="4500.00" totalCashWithdrawal="0.00" totalChqDeposit="0.00" totalChqIssue="0.00" totalCredit="37472.00" totalDebit="36996.00" totalSalary="0.00"/>
<MonthlyDetail balAvg="4682.59" balMax="20048.24" balMin="6.24" cashDeposits="0" cashWithdrawals="4" chqDeposits="0" chqIssues="0" credits="22" debits="22" inwBounces="0" monthName="Dec-18" outwBounces="0" salaries="0" startDate="2018-12-01" totalCashDeposit="0.00" totalCashWithdrawal="36000.00" totalChqDeposit="0.00" totalChqIssue="0.00" totalCredit="88828.00" totalDebit="87537.00" totalSalary="0.00"/>
<MonthlyDetail balAvg="2506.35" balMax="18060.99" balMin="25.50" cashDeposits="1" cashWithdrawals="6" chqDeposits="0" chqIssues="0" credits="19" debits="51" inwBounces="0" monthName="Jan-19" outwBounces="0" salaries="0" startDate="2019-01-01" totalCashDeposit="9000.00" totalCashWithdrawal="17500.00" totalChqDeposit="0.00" totalChqIssue="0.00" totalCredit="75341.00" totalDebit="77232.74" totalSalary="0.00"/>
<MonthlyDetail balAvg="3616.50" balMax="16215.50" balMin="6.78" cashDeposits="0" cashWithdrawals="6" chqDeposits="0" chqIssues="0" credits="22" debits="38" inwBounces="0" monthName="Feb-19" outwBounces="0" salaries="2" startDate="2019-02-01" totalCashDeposit="0.00" totalCashWithdrawal="19500.00" totalChqDeposit="0.00" totalChqIssue="0.00" totalCredit="80297.00" totalDebit="77338.72" totalSalary="21929.00"/>
</MonthlyDetails>
如何像此工具一样将其显示为表格