我在index.html中使用过xml名称空间,如下所示。
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">如何在jsx代码中访问这些属性?正如它所说的,这些属性是未定义的。
<p class=MsoNormal>
<span class=subheader1>
<span style='font-size:13.0pt'></span>
</span>
<span style='font-size:12.0pt;font-family:"Arial",sans-serif'><o:p></o:p></span></p>发布于 2020-11-24 13:01:18
你为什么需要它?但以下内容可能会对您有所帮助:
render(){
return (
<div attr={document.children[0].attributes['xmlns:w'].value}>
<div>{document.children[0].attributes['xmlns:o'].value}<div>
<div>
)
}document.children[0]是当前html页面的html标记。I希望这能对你有所帮助。
https://stackoverflow.com/questions/63518869
复制相似问题