Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Tag xxx invalid and validateOnParse #197

Open
taofather opened this issue Feb 27, 2017 · 1 comment
Open

Tag xxx invalid and validateOnParse #197

taofather opened this issue Feb 27, 2017 · 1 comment

Comments

@taofather
Copy link

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

@mineroot
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants