Validate XML view against the TagLibraryValidator classes of all imported tag libraries.
(PageData xmlView, Compiler compiler)
| 1599 | * Validate XML view against the TagLibraryValidator classes of all imported tag libraries. |
| 1600 | */ |
| 1601 | private static void validateXmlView(PageData xmlView, Compiler compiler) throws JasperException { |
| 1602 | |
| 1603 | StringBuilder errMsg = null; |
| 1604 | ErrorDispatcher errDisp = compiler.getErrorDispatcher(); |
| 1605 | |
| 1606 | for (Object o : compiler.getPageInfo().getTaglibs()) { |
| 1607 | |
| 1608 | if (!(o instanceof TagLibraryInfoImpl tli)) { |
| 1609 | continue; |
| 1610 | } |
| 1611 | |
| 1612 | ValidationMessage[] errors = tli.validate(xmlView); |
| 1613 | if ((errors != null) && (errors.length != 0)) { |
| 1614 | if (errMsg == null) { |
| 1615 | errMsg = new StringBuilder(); |
| 1616 | } |
| 1617 | errMsg.append("<h3>"); |
| 1618 | errMsg.append(Localizer.getMessage("jsp.error.tlv.invalid.page", tli.getShortName(), |
| 1619 | compiler.getPageInfo().getJspFile())); |
| 1620 | errMsg.append("</h3>"); |
| 1621 | for (ValidationMessage error : errors) { |
| 1622 | if (error != null) { |
| 1623 | errMsg.append("<p>"); |
| 1624 | errMsg.append(error.getId()); |
| 1625 | errMsg.append(": "); |
| 1626 | errMsg.append(error.getMessage()); |
| 1627 | errMsg.append("</p>"); |
| 1628 | } |
| 1629 | } |
| 1630 | } |
| 1631 | } |
| 1632 | |
| 1633 | if (errMsg != null) { |
| 1634 | errDisp.jspError(errMsg.toString()); |
| 1635 | } |
| 1636 | } |
| 1637 | } |
no test coverage detected