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

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

问题描述

我使用Xerces-C ++编写了一个自定义XML验证器。我目前的方法将文档加载到DOM中,然后对其执行检查。我需要的是访问DOM中节点的行/列号的方法。我一直在阅读API文档和谷歌搜索,但我来了简短。是否可以以某种方式检索关于节点的这种信息?

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?

实现 XMLValidator 界面看起来像它可能会提供给我那种信息,完全重写预期的验证架构。坦率地说, XMLValidator 方法看起来很丑陋和整体。我有一个不同的和很多更简单的验证系统(一个也很容易并行化),一切工作;所有我需要的是节点的线/列号信息。我之前使用过的Qt DOM实现(我现在不能使用)

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.

推荐答案

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

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