kool_samule Posted January 11, 2013 Share Posted January 11, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/273018-php-search-xml-by-linecolumn-no/ Share on other sites More sharing options...
Christian F. Posted January 11, 2013 Share Posted January 11, 2013 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.) Quote Link to comment https://forums.phpfreaks.com/topic/273018-php-search-xml-by-linecolumn-no/#findComment-1404986 Share on other sites More sharing options...
kool_samule Posted January 14, 2013 Author Share Posted January 14, 2013 Thanks for the reply, is there anything out there that could jump to a column in a line? Quote Link to comment https://forums.phpfreaks.com/topic/273018-php-search-xml-by-linecolumn-no/#findComment-1405602 Share on other sites More sharing options...
Christian F. Posted January 15, 2013 Share Posted January 15, 2013 Vim is be able to do that, with some work from you. Quote Link to comment https://forums.phpfreaks.com/topic/273018-php-search-xml-by-linecolumn-no/#findComment-1405822 Share on other sites More sharing options...
kool_samule Posted January 15, 2013 Author Share Posted January 15, 2013 fantasic. thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/273018-php-search-xml-by-linecolumn-no/#findComment-1405824 Share on other sites More sharing options...
Christian F. Posted January 15, 2013 Share Posted January 15, 2013 You're welcome. Quote Link to comment https://forums.phpfreaks.com/topic/273018-php-search-xml-by-linecolumn-no/#findComment-1405828 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.