Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when parsing file #14

Open
arcnetstart opened this issue Jan 29, 2022 · 0 comments
Open

Exception when parsing file #14

arcnetstart opened this issue Jan 29, 2022 · 0 comments

Comments

@arcnetstart
Copy link

arcnetstart commented Jan 29, 2022

"XMLReader::read(): Element 'phone': This element is not expected. Expected is one of ( platform, version, agency, email, currencies )."
Exception!
URL: https://3234444.com/export/yandex_yml4_.xml

Problem cause is XMLSchema in yml.xsd file provided with ymlparser. There is no phone node. While Shop class have it.

Solution is to use corrected schema file.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="yml_catalog">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="shop">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="name" type="xs:string" />
                        <xs:element name="company" type="xs:string" />
                        <xs:element name="url" type="xs:string" />
                        <xs:element name="platform" type="xs:string" minOccurs="0" />
                        <xs:element name="version" type="xs:string" minOccurs="0" />
                        <xs:element name="agency" type="xs:string" minOccurs="0" />
                        <xs:element name="email" type="xs:string" minOccurs="0" />
                        <xs:element name="currencies">
                            <xs:complexType>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant