[xml] Why xmlReadFile cannot get all content of my xml?



Hi Guys,

I used xmlReadFile operation to parser a xml file responded from microsoft analsys sevices, the file contains both DTD(format defination) & data content. But I find xmlReadFile can not successfully identify the DTD content within the XML file.

Your idea is very appreciated!

Thanks :)

PS: XML file & my code.
1. The XML file:
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
ÂÂÂ <SOAP-ENV:Body>
ÂÂÂ ÂÂÂ <m:DiscoverResponse xmlns:m="urn:schemas-microsoft-com:xml-analysis">
ÂÂÂ ÂÂÂ ÂÂÂ <m:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <root xmlns="urn:schemas-microsoft-com:xml-analysis:rowset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:EX="urn:schemas-microsoft-com:xml-analysis:exception">
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:schema xmlns="urn:schemas-microsoft-com:xml-analysis:rowset" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:xml-sql" elementFormDefault="qualified">
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:element name="root">
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:complexType>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:sequence>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:element name="row" type="row" minOccurs="0" maxOccurs="unbounded"/>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ </xsd:sequence>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ </xsd:complexType>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ </xsd:element>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:simpleType name="uuid">
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:restriction base="xsd:string">
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"/>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ </xsd:restriction>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ </xsd:simpleType>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:complexType name="row">
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:sequence>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:element name="DataSourceName" type="xsd:string" sql:field="DataSourceName" minOccurs="0"/>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:element name="DataSourceDescription" type="xsd:string" sql:field="DataSourceDescription" minOccurs="0"/>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:element name="URL" type="xsd:string" sql:field="URL" minOccurs="0"/>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:element name="DataSourceInfo" type="xsd:string" sql:field="DataSourceInfo" minOccurs="0"/>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:element name="ProviderName" type="xsd:string" sql:field="ProviderName" minOccurs="0"/>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:element name="ProviderType" type="xsd:string" sql:field="ProviderType" minOccurs="0" maxOccurs="unbounded"/>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <xsd:element name="AuthenticationMode" type="xsd:string" sql:field="AuthenticationMode" minOccurs="0"/>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ </xsd:sequence>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ </xsd:complexType>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ </xsd:schema>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <row>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <DataSourceName>Local Analysis Server</DataSourceName>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <DataSourceDescription>Microsoft Analysis Server 2000 on local machine</DataSourceDescription>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <URL>http://localhost/xmla/msxisapi.dll</URL>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <DataSourceInfo>Local Analysis Server</DataSourceInfo>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <ProviderName>Microsoft XML for Analysis</ProviderName>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <ProviderType>TDP</ProviderType>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <ProviderType>MDP</ProviderType>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <ProviderType>DMP</ProviderType>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ <AuthenticationMode>Unauthenticated</AuthenticationMode>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ </row>
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ </root>
ÂÂÂ ÂÂÂ ÂÂÂ </m:return>
ÂÂÂ ÂÂÂ </m:DiscoverResponse>
ÂÂÂ </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
2. my code:
doc = xmlReadFile("out.xml", NULL, 0);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]