Jump to content

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.)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.