获取节点的行号不会返回大于65535的行号。 [英] Get line number for a node won't return line number larger than 65535.

查看:81
本文介绍了获取节点的行号不会返回大于65535的行号。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DOMNode的getLineNo()方法用于获取定义节点的行号。

DOMNode's getLineNo() method is to get line number for where the node is defined.

但是如果文件的行数超过65535,则该方法将不返回那些高行号。

But if the file has more than 65535 lines then the method, it will not return those high line numbers. Is there any work-around for it?

请提出其他选择。
任何帮助将不胜感激。

Please suggest any alternative. any help will be really appreciated.

推荐答案

我了解您的XML文件很大。

I understand that your XML file is very big.

如果您使用的是libxml 2.9或更高版本,这不再是问题,但是您必须定义一个特定选项。

If you use libxml 2.9 or higher this is no longer a problem but you have to define a specific option.

<?php
define('XML_PARSE_BIG_LINES', 4194304);
$dom = new DOMDocument;
$dom->loadXML($xml, XML_PARSE_BIG_LINES);
?>

这篇关于获取节点的行号不会返回大于65535的行号。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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