Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error in XSD file
Message
From
10/01/2008 07:57:51
 
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01280761
Message ID:
01280832
Views:
27
No problem, that's why we are here!

>Thank you very much, Boban. I will check the help for the CURSORTOXML().
>
>>You didn't mention that you are going to try to use XML to Cursor.
>>XML file and XML Schema are both valid but I don't think you can import XML to Cursor because Visual FoxPro use specific format of XML file for function XMLTOCURSOR().
>>You can see how XML file must be defined with CURSORTOXML() in order to work with XMLTOCURSOR().
>>
>>>I made changes according to your suggestion. But I still get the same error. Could the problem be in the way I use XMLTOCURSOR()? Here my code:
>>>
>>>
>>>XMLTOCURSOR( "PagerPref.xml", "PAGERPREF", 512 )
>>>
>>>
>>>Thank you very much for your help.
>>>
>>>>Your XML file is not valid according to XML Schema file you specified.
>>>>PagerConfig element is not declared in XML Schema and Page element has minOccurs and maxOccurs attributes which are not allowed.
>>>>This is correct XML Schema file, use it with your XML file.
>>>>
>>>>
>>>><?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
>>>><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
>>>>
>>>>    <xsd:element name="PagerConfig">
>>>>      <xsd:complexType>
>>>>        <xsd:sequence>
>>>>            <xsd:element name="Page" minOccurs="0" maxOccurs="unbounded">
>>>>              <xsd:complexType>
>>>>                <xsd:sequence>
>>>>                    <xsd:element name="SendPage" type="xsd:string" />
>>>>                    <xsd:element name="PageNumber" type="xsd:string" />
>>>>                    <xsd:element name="DayFrom" type="xsd:string" />
>>>>                    <xsd:element name="DayTo" type="xsd:string" />
>>>>                    <xsd:element name="TimeFrom" type="xsd:string" />
>>>>                    <xsd:element name="TimeTo" type="xsd:string" />
>>>>                    <xsd:element name="SmtpIp" type="xsd:string" />
>>>>                    <xsd:element name="SenderName" type="xsd:string" />
>>>>                    <xsd:element name="SenderEmail" type="xsd:string" />
>>>>                </xsd:sequence>
>>>>              </xsd:complexType>
>>>>            </xsd:element>
>>>>        </xsd:sequence>
>>>>      </xsd:complexType>
>>>>    </xsd:element>
>>>></xsd:schema>
>>>>
>>>>
>>>>
>>>>
>>>>>This is the entire XML (do you see anything wrong here?):
>>>>>
>>>>>
>>>>><?xml version="1.0" standalone="yes" ?>
>>>>><PagerConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>	xsi:noNamespaceSchemaLocation="PagerPref.xsd" >
>>>>>   <Page>
>>>>>        <SendPage>N</SendPage>
>>>>>        <PageNumber>508@company.net</PageNumber>
>>>>>        <DayFrom>2</DayFrom>
>>>>>        <DayTo>2</DayTo>
>>>>>        <TimeFrom>15:00</TimeFrom>
>>>>>        <TimeTo>07:00</TimeTo>
>>>>>        <SmtpIp>10.0.0.48</SmtpIp>
>>>>>        <SenderName>Some Name</SenderName>
>>>>>        <SenderEmail>name@yahoo.com</SenderEmail>
>>>>>   </Page>
>>>>>   <Page>
>>>>>        <SendPage>Y</SendPage>
>>>>>        <PageNumber>508@company.net</PageNumber>
>>>>>	<DayFrom>1</DayFrom>
>>>>>	<DayTo>7</DayTo>	
>>>>>        <TimeFrom>15:00</TimeFrom>
>>>>>        <TimeTo>07:00</TimeTo>
>>>>>        <SmtpIp>smtp.earthlink.net</SmtpIp>
>>>>>        <SenderName>Some Name</SenderName>
>>>>>        <SenderEmail>name@yahoo.com</SenderEmail>
>>>>>   </Page>
>>>>></PagerConfig>
>>>>>
>>>>>
>>>>>Thank you.
>>>>>
>>>>>>Maybe something wrong in the way you are using it not with the file itself?
>>>>>>
>>>>>>>I am getting an error message "Unable to infer XML schema" when working with the followings xsd file:
>>>>>>>
>>>>>>>
>>>>>>><?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
>>>>>>><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
>>>>>>>	<xsd:element name="Page" minOccurs="0" maxOccurs="unbounded">
>>>>>>>		<xsd:complexType>
>>>>>>>			<xsd:sequence>
>>>>>>>				<xsd:element name="SendPage" type="xsd:string" />
>>>>>>>				<xsd:element name="PageNumber" type="xsd:string" />
>>>>>>>				<xsd:element name="DayFrom" type="xsd:string" />
>>>>>>>				<xsd:element name="DayTo" type="xsd:string" />
>>>>>>>				<xsd:element name="TimeFrom" type="xsd:string" />
>>>>>>>				<xsd:element name="TimeTo" type="xsd:string" />
>>>>>>>				<xsd:element name="SmtpIp" type="xsd:string" />
>>>>>>>				<xsd:element name="SenderName" type="xsd:string" />
>>>>>>>				<xsd:element name="SenderEmail" type="xsd:string" />
>>>>>>>			</xsd:sequence>
>>>>>>>		</xsd:complexType>
>>>>>>>	</xsd:element>
>>>>>>></xsd:schema>
>>>>>>>
>>>>>>>
>>>>>>>What can be wrong with the above file?
>>>>>>>
>>>>>>>Thank you
Previous
Reply
Map
View

Click here to load this message in the networking platform