[TYPO3-dev] parsing xml

Daniel Pötzinger operation-lan at gmx.de
Mon Mar 17 22:38:26 CET 2008


Steffen Kamper schrieb:
> "Dmitry Dulepov [typo3]" <dmitry at typo3.org> schrieb im Newsbeitrag 
> news:mailman.1.1205786715.29875.typo3-dev at lists.netfielders.de...
>> Hi!
>>
>> Steffen Kamper wrote:
>>> i'm searching for xml parsing methods. i only found special functions for 
>>> flexforms or "one-dimensional"-xml. There are some routines using own 
>>> parsing routines. xml2tree has a huge performance time.
>>>
>>> What do you use for xml-parsing?
>> t3lib_div::xml2array()?
>>
>> -- 
> 
> Hi Dmitry,
> 
> this doesn't work with xml-arrays, then i only get the first element.
> (e.g. rss feed)
> 
> Then i have xsd-format like
> <?xml version="1.0" encoding="UTF-8"?>
> <root xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:od="urn:schemas-microsoft-com:officedata">
> <xsd:schema>
> <xsd:element name="dataroot">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="Companys" minOccurs="0" maxOccurs="unbounded"/>
> </xsd:sequence>
> <xsd:attribute name="generated" type="xsd:dateTime"/>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="Companys">
> <xsd:annotation>
> <xsd:appinfo/>
> </xsd:annotation>
> <xsd:complexType>
> <xsd:sequence>
> ...
> but this is harder, maybe only work with DomDocument
> 
> vg  Steffen 
> 
> 
Maybe xml2tree helps you there but the returned array is special.

Otherwise the best way might be to write your own parsing function to 
deal with the format you have using the php xml functions (like 
xml2array does it).








More information about the TYPO3-dev mailing list