我正在尝试解析从模板中生成的XML (在Objective-C中)文件,如下所示。
我尝试使用标准的XML解析器解析它,但似乎没有加载。
解析这个PHP XML生成文件的最佳方法是什么?也许是第三方图书馆?
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:pbu="http://www.something.com/something.xsd" xmlns="http://www.something.com/something.xsd" elementFormDefault="qualified" targetNamespace="http://www.something.com/something.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="app">
<xs:complexType>
<xs:sequence>
<xs:element name="bannerImg" type="xs:anyURI" minOccurs="1" maxOccurs="1" />
<xs:element name="category" minOccurs="1" maxOccurs="25">
<xs:complexType>
<xs:sequence>
<xs:element name="image" minOccurs="1" maxOccurs="40">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="thumbUrl" type="xs:anyURI" minOccurs="1" maxOccurs="1" />
<xs:element name="sampleUrl" type="xs:anyURI" minOccurs="0" maxOccurs="1" />
<xs:element name="imageUrl" type="xs:anyURI" minOccurs="1" maxOccurs="1" />
<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="infoUrl" type="xs:anyURI" minOccurs="0" maxOccurs="1" />
<xs:element name="license" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="licenseUrl" type="xs:anyURI" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="icon" type="xs:anyURI" use="required" />
<xs:attribute name="unlock_product_id" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="unlock_product_id" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
</xs:schema>
答案 0 :(得分:0)
Sandro Meier