Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I construct this xml?
Message
De
17/10/2011 10:55:50
 
 
À
17/10/2011 10:42:42
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01526615
Message ID:
01526623
Vues:
53
I didn't study the xml you showed, but it looked really simple. I recommend that you open the xml in the explorer, it's often helpful. I also recommend googling for XML VALIDATOR if you wonder whether the xml is valid or not.

>Thanks for the tip Tore!
>
>Having never used the xmladapter yet, I am not sure yet whether it will let me construct this, even with new functionality in vfp9. In the few examples I've seen, when there is nesting, the data for a higher level table appears at the top, and then the nested table data appears. But in this example, I think that code-a,code-b,sold-by, and billing-flag are at the baseinfo level, yet they don't appear 'at the top', they appear between order customers and order details. Having little experience with it, I'm not sure whether that is allowable/valid xml, and even if allowable, 'conventional'. But from what I've seen so far of the xmladapter, I don't see that it could generate xml that looks like this. So I think that in this case you might be right. But, I'm not sure of the experience of the person who gave me the file, so I first want to establish that this is indeed correct xml.
>
>
>
>http://foxcentral.net/microsoft/whatsnewinvfp9_chapter10.htm
>
>>I have found that it's often easier to hard code the XML using Scan/Endscan and Text/Endtext.
>>
>>>I was given the following xml sample and told that we need to provide our partner with an xml file that is setup in the same way. Up until now I only have limited experience with cursortoxml(). It looks to me like I would have to use the xmladapter to get this to work?
>>>It looks to me like this is 'nested' xml', but I have very limited experience with xml files/syntax.
>>>Also, the file makes sense to me, mostly, but I don't get why code-a,code-b,sold-by, and billing-flag are positioned in the file where they are?
>>>
>>>Can someone confirm that this is a valid / properly laid out xml file, and give me some pointers on how to go about preparing it from vfp9?
>>>
>>>thanks
>>>
>>>
>>>
>>>
>>><?xml version="1.0"?>
>>><BaseData>
>>>	<BaseInfo>
>>>		<OrderCustomers>
>>>                  <OrderCustomer>
>>>				<IsPrimaryOrderer>true</IsPrimaryOrderer>
>>>				<IsPrimaryPayor>true</IsPrimaryPayor>
>>>                                <Customer>
>>>				<Name1>SomeCompany</Name1>
>>>				 </Customer>
>>>			</OrderCustomer>
>>>		</OrderCustomers>
>>>		<code-a>Y</code-a>
>>>		<code-b>N</code-b>
>>>		<sold-by>repcba</sold-by>
>>>		<billing-flag>N</billing-flag>
>>>		<OrderDetails>
>>>			<Sides>1</Sides>
>>>			<Count>4</Count>
>>>			<Weight>0.00</Weight>
>>>			<Type>Tab</Type>
>>>			<Schedule>
>>>				<invoice-text>test1</invoice-text>
>>>				<LocInfo>
>>>					<book>print1</book>
>>>					<edition>3</edition>
>>>					<rundates>
>>>						<date>10202011</date>
>>>					</rundates>
>>>				</LocInfo>
>>>				<Location>Daily 04</Location>
>>>				<distribution-code>
>>>					<dist-code>10304</dist-code>
>>>					<Delivery-Method Type="Method1">
>>>						<Selected>true</Selected>
>>>                                                <Override-Counts>
>>>                                                   <t-count>700</t-count>
>>>                                                </Override-Counts>
>>>					</Delivery-Method>
>>>				</distribution-code>
>>>				<distribution-code>
>>>					<distribution-code-name>10305</distribution-code-name>
>>>					<Delivery-Method Type="Subscriber">
>>>						<Selected>true</Selected>
>>>                                                 <Override-Counts>
>>>                                                   <t-count>750</t-count>
>>>                                                </Override-Counts>
>>>					</Delivery-Method>
>>>				</distribution-code>
>>>				<distribution-code>
>>>					<distribution-code-name>10306-1</distribution-code-name>
>>>					<Delivery-Method Type="type1">
>>>						<Selected>true</Selected>
>>>                                                 <Override-Counts>
>>>                                                   <t-count>800</t-count>
>>>                                                </Override-Counts>
>>>					</Delivery-Method>
>>>				</distribution-code>
>>>				<distribution-code>
>>>					<distribution-code-name>10306-2</distribution-code-name>
>>>					<Delivery-Method Type="Method1">
>>>						<Selected>true</Selected>
>>>                                                <Override-Counts>
>>>                                                   <t-count>900</t-count>
>>>                                                </Override-Counts>
>>>					</Delivery-Method>
>>>				</distribution-code>
>>>			</Schedule>
>>>		</OrderDetails>
>>>	</BaseInfo>
>>></BaseData>
>>>
>>>
>>>
>>>
>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform