Tickaroo / tikxml

Modern XML Parser for Android
Apache License 2.0
423 stars 44 forks source link

How to use NameSpace #135

Closed intel3 closed 4 years ago

intel3 commented 4 years ago

Hi,

Am new to this library and has spend hours trying to figure out how namespace works.

My xml response looks like

<Resposne xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <isGateEnabled xsi:nil="true"/>
</Response>

Here is my POJO

@Xml(writeNamespaces={"xsi=http://www.w3.org/2001/XMLSchema-instance"})
public class Response {
    @PropertyElement(name="xsi:nil")
    boolean isGateEnabled;
}

What is the correct way to map this?

I am using

    api 'com.tickaroo.tikxml:annotation:0.8.13'
    api 'com.tickaroo.tikxml:core:0.8.13'
    api 'com.tickaroo.tikxml:retrofit-converter:0.8.13'
    annotationProcessor 'com.tickaroo.tikxml:processor:0.8.13'

thanks

sockeqwe commented 4 years ago

See docs: https://github.com/Tickaroo/tikxml/blob/master/docs/AnnotatingModelClasses.md#namespaces