Bug? LIBRARY XML2MAP

TILogistic

Expert
Licensed User
Longtime User
For @Erel there is a difference in XML to MAP conversion in B4J and B4A.

B4I I have not used it.

see post
 

TILogistic

Expert
Licensed User
Longtime User
XML2MAP:
Convert XML to Map
B4J:
mRoot.Get("soap:Envelope").As(Map).Get("soap:Body")
B4A
mRoot.Get("Envelope").As(Map).Get("Body")
XML:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <GetStageListResponse
            xmlns="http://tempuri.org/">
            <GetStageListResult>
                <xs:schema id="NewDataSet"
                    xmlns=""
                    xmlns:xs="http://www.w3.org/2001/XMLSchema"
                    xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
                    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
                        <xs:complexType>
                            <xs:choice minOccurs="0" maxOccurs="unbounded">
                                <xs:element name="Table">
                                    <xs:complexType>
                                        <xs:sequence>
                                            <xs:element name="Serial" type="xs:short" minOccurs="0" />
                                            <xs:element name="Stage" type="xs:string" minOccurs="0" />
                                        </xs:sequence>
                                    </xs:complexType>
                                </xs:element>
                            </xs:choice>
                        </xs:complexType>
                    </xs:element>
                </xs:schema>
                <diffgr:diffgram
                    xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
                    xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
                    <NewDataSet
                        xmlns="">
                        <Table diffgr:id="Table1" msdata:rowOrder="0">
                            <Serial>10</Serial>
                            <Stage>Cutting In</Stage>
                        </Table>
                        <Table diffgr:id="Table2" msdata:rowOrder="1">
                            <Serial>20</Serial>
                            <Stage>Cutting Out</Stage>
                        </Table>
                        <Table diffgr:id="Table3" msdata:rowOrder="2">
                            <Serial>30</Serial>
                            <Stage>Marking Out</Stage>
                        </Table>
                        <Table diffgr:id="Table4" msdata:rowOrder="3">
                            <Serial>35</Serial>
                            <Stage>Spray In</Stage>
                        </Table>
                        <Table diffgr:id="Table5" msdata:rowOrder="4">
                            <Serial>40</Serial>
                            <Stage>Spray Out</Stage>
                        </Table>
                        <Table diffgr:id="Table6" msdata:rowOrder="5">
                            <Serial>45</Serial>
                            <Stage>Slitting In</Stage>
                        </Table>
                        <Table diffgr:id="Table7" msdata:rowOrder="6">
                            <Serial>50</Serial>
                            <Stage>Slitting Out</Stage>
                        </Table>
                    </NewDataSet>
                </diffgr:diffgram>
            </GetStageListResult>
        </GetStageListResponse>
    </soap:Body>
</soap:Envelope>
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4i does not handle namespaces (like B4a).
Note that attributes do keep the namespaces in B4i.

Best to update to v1.01 and remove them:
- v1.01 - New StripNamespaces property. When set to true the namespaces from keys and attributes are stripped. It is recommend to set it true. The behavior regarding namespaces, between B4A, B4J and B4i is different when namespaces are kept.

 
Top