Re: Pear with Viewpoint (MTX) XML

From: Date: Sat, 03 Jan 2004 16:40:08 +0000
Subject: Re: Pear with Viewpoint (MTX) XML
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-9929@lists.php.net to get a copy of this message
<admin@cage8.com> wrote : > Dear Sir, > I hope this won't take up too much of your time, but I would really > appreciate an answer to a problem I am having, if possible :o) > I am using the Pear XML_Tree to build an XML file, designed to duplicate > Viewpoints MTX files, which are also written in XML. We work extensively > with 2000+ line MTX files, and the ability to write these dynamically > using PHP would be a massive timesaver. To learn Pear, I took a simple > MTX file, as shown here: > > http://www.cage8.info/test1.mtx > > The above file produces the cube shown on the right at this address : > http://www.cage8.info/test.php > I used Pear to produce this XML: > > http://www.cage8.info/test1.php (view source). > > It currently produces the blank space on the left at > http://www.cage8.info/test.php > > The only visible difference in the two (apart from the .mtx file > displaying as an XML file in the browser, and the .php needing a source > view) is the use of end tags. I have encountered this problem before > with Viewpoint XML, the end tag is not only not required in many places, > but using it will actually cause problems. > So, my question is this : is there anyway, using Pear, to create a line > like this: > > <ViewLocation x="0" y="0" z="4" /> > > rather than this: > > <ViewLocation x="0" y="0" z="4"></ViewLocation> > > Any help you can give me in this matter would be very much appreciated - > I am new to Pear, so apologise in advance if this is a silly question! There is a XML_Beautifier package or XML_Serializer might be better suited than XML_Tree for your needs. If you work from a php array and want to convert it to XML, Config package can do that too. Bertrand Mansion Mamasam

« previous php.pear.general (#9929) next »