Closed GrahamDodgson closed 10 years ago
Can you verify that it reaches the view?
https://github.com/milesj/utility/blob/master/View/Sitemap/xml/index.ctp
Yes Miles it reaches the view (I placed echo’s in there to determine where the space happens and it happens in the controller before the view). The view information is displayed and if I take it (without the space) and place it in a document it works. Just can’t see why its producing the space….any ideas on where to try debugging the issue would be appreciated!
Graham
From: Miles Johnson [mailto:notifications@github.com] Sent: 10 December 2013 18:12 To: milesj/utility Cc: Graham Dodgson Subject: Re: [utility] Sitemap - error on line 1 at column 6: XML declaration allowed only at the start of the document (#19)
Can you verify that it reaches the view?
https://github.com/milesj/utility/blob/master/View/Sitemap/xml/index.ctp
— Reply to this email directly or view it on GitHubhttps://github.com/milesj/utility/issues/19#issuecomment-30252646.
Do one of the controllers being imported have a space at the end of the file?
Miles, I’ve been through every controller and made sure than no spaces exist after the final ‘}’ – I am however still getting the same error?
From: Miles Johnson [mailto:notifications@github.com] Sent: 11 December 2013 18:06 To: milesj/utility Cc: Graham Dodgson Subject: Re: [utility] Sitemap - error on line 1 at column 6: XML declaration allowed only at the start of the document (#19)
Do one of the controllers being imported have a space at the end of the file?
— Reply to this email directly or view it on GitHubhttps://github.com/milesj/utility/issues/19#issuecomment-30344928.
I'm not really sure as it works correctly for me. Do you close your PHP files with ?>
or do you leave the tag off? It might be in another file besides the controller.
Miles, I’ve been leaving the tag off as bake does but will go thru and end the php files with ?> I’ll also check all the model files as well. Thanks for this.
Graham
From: Miles Johnson [mailto:notifications@github.com] Sent: 12 December 2013 18:16 To: milesj/utility Cc: Graham Dodgson Subject: Re: [utility] Sitemap - error on line 1 at column 6: XML declaration allowed only at the start of the document (#19)
I'm not really sure as it works correctly for me. Do you close your PHP files with ?> or do you leave the tag off? It might be in another file besides the controller.
— Reply to this email directly or view it on GitHubhttps://github.com/milesj/utility/issues/19#issuecomment-30447139.
Ever figure this out?
Not yet chap – gone thru and made sure we had ?> at the end of each PHP file – just looks like its placing a space at the front??? More debugging to come ;)
From: Miles Johnson [mailto:notifications@github.com] Sent: 06 January 2014 07:55 To: milesj/utility Cc: Graham Dodgson Subject: Re: [utility] Sitemap - error on line 1 at column 6: XML declaration allowed only at the start of the document (#19)
Ever figure this out?
— Reply to this email directly or view it on GitHubhttps://github.com/milesj/utility/issues/19#issuecomment-31632457.
Miles, Yes – found the problem – it was an erroneous space at the front of app controller – all working now! Thanks very much for the help and the Utility!
Graham
From: Miles Johnson [mailto:notifications@github.com] Sent: 06 January 2014 07:55 To: milesj/utility Cc: Graham Dodgson Subject: Re: [utility] Sitemap - error on line 1 at column 6: XML declaration allowed only at the start of the document (#19)
Ever figure this out?
— Reply to this email directly or view it on GitHubhttps://github.com/milesj/utility/issues/19#issuecomment-31632457.
Congrats on finding the space! I'm sure that was extremely tedious.
an easier method to removing that troublesome whitespace: no extra code to bloat your theme either:
Seems to generate a space at the start of the XML
<?xml version="1.0" encoding="UTF-8"?>http://localhost:8080/bidup/auctions hourly 0.5 http://localhost:8080/bidup/auctions/view/1 2013-11-29T11:24:00+00:00 weekly 0.9 http://localhost:8080/bidup/auctions/view/2 2013-
Identified that it happens on the first pass thru :
in the site map controller - but I cannot see why? we do have an admins controller which does not have the generate site map code - this seems to be where its being genreated?