Xerces-C ++ DOM节点行/列号位置 [英] Xerces-C++ DOM node line/column number location

查看:138
本文介绍了Xerces-C ++ DOM节点行/列号位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xerces-C ++编写一个自定义XML验证器。我当前的方法将文档加载到DOM中,然后执行检查。我需要的是访问DOM中节点的行/列号的方式。我一直在阅读API文档和谷歌搜索,但我很快就会发现。有可能以某种方式检索这种关于节点的信息?



实现 XMLValidator 界面看起来可能会为我提供这种信息,但它会需要完全重写预期的验证架构。坦白说,一个 XMLValidator 方法看起来很丑陋,整体。我有一个不同的,更简单的验证系统(一个也很容易并行化),一切正常;我需要的是节点的行/列号信息。我之前使用的Qt DOM实现(现在我不能使用)提供前面的信息,所以我看不清为什么Xerces使事情变得困难。

解决方案

可以找到一个可能的解决方案 here


I'm writing a custom XML validator using Xerces-C++. My current approach loads the document into a DOM, and then checks are performed on it. What I need is a way to access the line/column number of a node in the DOM. I've been reading the API docs and googling, but I'm coming up short. Is it possible to somehow retrieve this kind of information about the nodes?

Implementing the XMLValidator interface looks like it would probably provide me with that kind of info, but it would require completely rewriting the intended validation architecture. Frankly, an XMLValidator approach seems ugly and monolithic. I have a different and much simpler validation system in mind (one that is also easily parallelizable) and everything works; all I need is the line/column number info of the nodes. The Qt DOM implementation that I've used before (and which I can't use now) provides this information up front, so I can't see why Xerces is making things difficult.

解决方案

A possible solution can be found here.

这篇关于Xerces-C ++ DOM节点行/列号位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆