admin管理员组文章数量:1123181
I am writing a page to display a xml data use react-xml-viewer, I only need one page html, so I use cdn to import the lib. but the result page show a error error on line 1 at column 1: Start tag expected, '<' not found
what's wrong with the code?
page code here
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src=".0.2/umd/react.development.js"></script>
<script src=".0.2/umd/react-dom.development.js"></script>
<script src="/@lionelbr/[email protected]/lib/XmlViewer.min.js"></script>
</head>
<body>
<div id="root"></div>
<script>
const XmlViewer = window['react-xml-view'].default;
const App = () => {
let xmlData = '<?xml version="1.0" encoding="UTF-8"?><hello id="aa">World</hello>';
return React.createElement('div', null,
React.createElement(XmlViewer, { xml: xmlData })
);
};
ReactDOM.render(React.createElement(App), document.getElementById('root'));
</script>
</body>
</html>
page show error:
<parsererror style="display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black">
<h3>
This page contains the following errors:
</h3>
<div style="font-family:monospace;font-size:12px">
error on line 1 at column 1: Start tag expected, '<' not found
</div>
<h3>
Below is a rendering of the page up to the first error.
</h3>
</parsererror>
本文标签:
版权声明:本文标题:xml visualizer - use react-xml-view to write a page to display xml info, show the error page , why? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736106411a1904138.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论