Jump to content

PHP Search XML by Line/Column No.


kool_samule

Recommended Posts

Hi Chaps,

 

I have been given an invalid XML file, which when run through 3rd party software, gives me the line & column numbers of the error.

 

Instead of opening the file and manually searching for the line/column numbers (which can take a whie, as the file is vast!), is there a way to parse the XML file and locate the error, using the line/column numbers? And maybe display/highlight the error in a browser?

 

e.g.:

1: open bad-file.xml

2: read bad-file.xml

3. go-to line 50

4. go-to column 3620

5. open in browser

6. highlight error

 

Cheers

 

S

Link to comment
https://forums.phpfreaks.com/topic/273018-php-search-xml-by-linecolumn-no/
Share on other sites

Use an editor which has the Jump-to-line command. If you're worried about the file being too big, you can always use vim or similar. To jump to a specific line it in, just write :{line} when in command mode. (insert will bring you to edit mode, and esc back to command mode.)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.