我需要解析被注释掉的XML标签,例如
<DataType Name="SecureCode" Size="4" Type="NVARCHAR">
<!-- <Validation>
<Regex JavaPattern="^[0-9]*$" JSPattern="^[0-9]*$"/>
</Validation> -->
<UIType Size="4" UITableSize="4"/>
</DataType>
但我所找到的只有
setIgnoringComments(boolean)
。Document doc = docBuilder.parse(new File(PathChecker.getDataTypesFile()));
docFactory.setIgnoringComments(true); // ture or false, no difference
但这似乎没有改变任何东西。 有没有其他方法来解析这些注释?我必须使用DOM。
问候