Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create cursors from an xsd file, no xml yet
Message
From
09/01/2008 09:00:21
 
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01276819
Message ID:
01280507
Views:
28
Update, ok, stupid me. I totally missed the XMLAdapter.UTF8Encoded property...


Hi Sergey,

I noticed something. I changed the line:

< ?xml version = "1.0" encoding="Windows-1252" standalone="yes"? >

to:

< ?xml version = "1.0" encoding="UTF-8" standalone="yes"? >

yet when the xml is generated later, it is:

< ?xml version = "1.0" encoding="Windows-1252" standalone="yes"? >


Do you know if there is a property in the xmladapter that is changing it back to Windows-1252?


Thanks,



>Hi Tracy,
>
>Sure
>CLEAR
>CLOSE TABLES ALL
>
>TEXT TO cDummyXML NOSHOW TEXTMERGE
><?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
><xsd:schema id="VFPDataSet" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>				xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
>	<xsd:element name="VFPDataSet" msdata:IsDataSet="true">
>		<xsd:complexType>
>			<xsd:choice maxOccurs="unbounded">
>				<xsd:element name="someTable" minOccurs="0" maxOccurs="unbounded">
>					<xsd:complexType>
>						<xsd:sequence>
>							<xsd:element name="somefield">
>								<xsd:simpleType>
>									<xsd:restriction base="xsd:string">
>										<xsd:maxLength value="10"/>
>									</xsd:restriction>
>								</xsd:simpleType>
>							</xsd:element>
>						</xsd:sequence>
>					</xsd:complexType>
>				</xsd:element>
>			</xsd:choice>
>			<xsd:anyAttribute namespace="http://www.w3.org/XML/1998/namespace"
>						processContents="lax"/>
>		</xsd:complexType>
>	</xsd:element>
></xsd:schema>
>ENDTEXT
>
>*** Wrap schema into Recordset tags ***
>cDummyXML = STUFF(cDummyXML, AT("?>", cDummyXML)+2, 0, "<VFPDataSet>") + "</VFPDataSet>"
>***
>
>LOCAL oXA as XMLAdapter, oXT as XMLTable
>
>oXA=CREATEOBJECT("XMLAdapter")
>oXA.LoadXML(cDummyXML)
>
>FOR EACH oXT IN oXA.Tables
>	oXT.ToCursor()
>	SELECT (oXT.Alias)
>	?"Alias=",ALIAS()
>	AFIELDS(aflds)
>	DISPLAY MEMORY LIKE aflds
>NEXT
>
>>Beautiful, thanks Sergey! :o)
>>
>>Another question you may know the answer to: is there anyway to use a schema in memory instead of on disk with the xmladapter? I'd like to keep from storing the xsd on disk. I have it in a prg and use
>>
>>TEXT TO cschema ...
>>ENDTEXT
>>
>>STRTOFILE(cschema)...
>>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform