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>

本文标签: