[英]XML schema type information using libxml2
首先,我正在处理的应用程序使用 libxml2 来解析 XML 并根据模式验证这个 XML,我不能使用另一个 XML 解析库。
该模式包含 XML 中元素的类型信息,我正在尝试获取此类型信息但没有成功。
示例架构:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="rootElement" type="xsd:integer"/>
</xsd:schema>
示例 XML
<rootElement>13</rootElement>
我想从 libxml2 获得有关 rootElement 只能包含 integer 值的信息,如type="xsd:integer"
位所规定的。
I'm most interested in the simple types, ie xsd:integer
, xsd:string
, xsd:double
, xsd:boolean
, etc. If an element is a complex type, the exact type is not important.
libxml2 API 根本不支持模式检查,仅支持验证。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.