Yii Framework Forum: Simple Xml Generator - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Simple Xml Generator A simple XML generator for Yii Rate Topic: -----

#1 User is offline   marcotroisi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 06-March 12

Posted 06 March 2012 - 01:03 PM

Hi there,

As I needed to create some custom XMLs for a project I am working on, I have created an Yii extension based on a nice class which was developed by Simon Willison.

Using this simple extension, everyone will be easily able to generate an XML.

Attached File  XmlGenerator_1.1.zip (19.54K)
Number of downloads: 35
0

#2 User is offline   Da:Sourcerer 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,222
  • Joined: 30-March 11
  • Location:Berlin, Germany

Posted 06 March 2012 - 01:41 PM

Hm. I think my approach is better ;)
programmer /ˈprəʊgramə/, noun: a device that converts ►coffee into ►code
0

#3 User is offline   marcotroisi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 06-March 12

Posted 06 March 2012 - 04:30 PM

Hi,
Where can I found any description of how your approach does work?
0

#4 User is offline   Da:Sourcerer 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,222
  • Joined: 30-March 11
  • Location:Berlin, Germany

Posted 08 March 2012 - 03:46 AM

Hm, there is none yet. It works roughly like this: A set of data is serialized into XML with help of domxml by the CXslViewRenderer which will then apply some XSL against that. In return: Generic XML of any flavour ;D

The FeedController of the blog demo should give a good example.
programmer /ˈprəʊgramə/, noun: a device that converts ►coffee into ►code
0

#5 User is offline   zanforlin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 06-September 11

Posted 14 March 2013 - 10:55 AM

This works very good.

But when it shows the xml var on screen, it shws first line blank. This cause an XML error, because first xml line must be <?xml version="1.0" encoding="utf-8"?>


What can I do? Seems that yii create this blank line, and not the extension.

Thanks
Leo
0

#6 User is offline   marcotroisi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 06-March 12

Posted 18 March 2013 - 02:48 AM

View Postzanforlin, on 14 March 2013 - 10:55 AM, said:

But when it shows the xml var on screen, it shws first line blank. This cause an XML error, because first xml line must be <?xml version="1.0" encoding="utf-8"?>


What can I do? Seems that yii create this blank line, and not the extension.


Hi Leo,

Would you please download again the .zip folder and just replace the xmlgenerator.php file on your application? It should work fine now, please let me know.

Marco
0

#7 User is offline   zanforlin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 06-September 11

Posted 18 March 2013 - 10:24 AM

Hello Marco. It not works, it generate a clean page.

However, I just try ob_end_clean() and it works :)

Thanks
Léo
0

#8 User is offline   zanforlin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 06-September 11

Posted 18 March 2013 - 11:14 AM

Ops, it works locally, but not on my host... I´ll investigate it.
0

#9 User is offline   wintermute 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 08-January 14

Posted 08 January 2014 - 02:03 PM

View Postzanforlin, on 18 March 2013 - 11:14 AM, said:

Ops, it works locally, but not on my host... I´ll investigate it.


I know it's a quite old thread but I'm stuck on the same problem...

I'm trying to generate a xml rss feed trough Controller but Yii keeps showing the first line blank.

I'm using an filter to remove blank lines from all pages on my RssController (this one) and I also put the ob_end_clean() in my rss layout. It's working fine locally, however, on my host it keeps showing the blank first line :(

Any Ideas?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users