contexts icon indicating copy to clipboard operation
contexts copied to clipboard

Tag xxx invalid and validateOnParse

Open taofather opened this issue 8 years ago • 1 comments

Hello

I am using an Sanpi\Behatch\Context\XmlContext:theResponseShouldBeInXml step.

The libxml_get_last_error called at Sanpi\Behatch\Xml\Dom:__construct is throwing an error: "tag rateplan invalid".

Everything works ok if I change:

$this->dom->validateOnParse = true;

The xml is:

<?xml version="1.0" encoding="utf-8"?>
<OTA_HotelRoomListRS xmlns="http://www.opentravel.org/OTA/2003/05" Version="2.0">
    <Success/>
    <HotelRoomLists>
        <HotelRoomList HotelCode="8785">
            <RoomStays>
                <RoomStay>
                    <RoomTypes>
                        <RoomType IsRoom="1" RoomID="28638">
                            <RoomDescription Name="desc"/>
                        </RoomType>
                    </RoomTypes>
                    <RatePlans>
                        <RatePlan RatePlanID="1" RatePlanName=""/>
                    </RatePlans>
                </RoomStay>
            </RoomStays>
        </HotelRoomList>
    </HotelRoomLists>
</OTA_HotelRoomListRS>

If I remove the RatePlan node, the error is thrown for other leafs and nodes.

Is it any tradeoff in changing validateOnParse flag to true?

php -v is PHP 7.0.11-2+deb.sury.org~trusty+1 (cli) ( NTS )

Thanks for reading

taofather avatar Feb 27 '17 09:02 taofather

Hello @taofather, I have same problem, have you managed to solve it?

mineroot avatar Nov 12 '20 20:11 mineroot