wwXML::CreateDataStructureSchema

Creates a Schema string from the currently active cursor/alias. The schema is generated as separate schema string.

Note that the schema created is for the cursor fragment only and does not include the document root. This makes it possible to create multiple schemas into a single document and link them in from within the document. CursorToXML handles creation of embedded schemas that take advantage of this fact through thte nCreateDataStructure=1 flag.

o.CreateDataStructureSchema(lcName, lcRowName, loRS)

Parameters

lcName
Optional - element name used at the table level. Note this tag sits underneath the document root. (wwBanners in the example).
Default value: The name of the current Alias().

lcRowName
Optional - The element name used for each row of the cursor.
Default value: "row"

loRS
Optional - if passed the DTD is created from an ADO recordset rather than from a VFP cursor.

Example

o=CREATEOBJECT("wwXML")
lcXML = o.createdatastructureschema("customers","customer")
ShowText(lcXML)

<Schema name="Schema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes"> <ElementType name="customers" content="eltOnly" model="closed" order="many"> <element type="customer" /> </ElementType> <ElementType name="customer" content="eltOnly" model="closed" order="many"> <element type="custno"/> <element type="company"/> <element type="careof"/> <element type="address"/> <element type="shipaddr"/> <element type="email"/> <element type="phone"/> <element type="billrate"/> <element type="btype"/> <element type="pk"/> </ElementType> <ElementType name="custno" content="textOnly" model="closed" dt:type="string"> <AttributeType name="type"/> <attribute type="type" default="string"/> <AttributeType name="size"/> <attribute type="size" default="8"/> </ElementType> <ElementType name="company" content="textOnly" model="closed" dt:type="string"> <AttributeType name="type"/> <attribute type="type" default="string"/> <AttributeType name="size"/> <attribute type="size" default="30"/> </ElementType> <ElementType name="careof" content="textOnly" model="closed" dt:type="string"> <AttributeType name="type"/> <attribute type="type" default="string"/> <AttributeType name="size"/> <attribute type="size" default="30"/> </ElementType> <ElementType name="address" content="textOnly" model="closed" dt:type="string"> <AttributeType name="type"/> <attribute type="type" default="string"/> <AttributeType name="size"/> <attribute type="size" default="2147483647"/> </ElementType> <ElementType name="shipaddr" content="textOnly" model="closed" dt:type="string"> <AttributeType name="type"/> <attribute type="type" default="string"/> <AttributeType name="size"/> <attribute type="size" default="2147483647"/> </ElementType> <ElementType name="email" content="textOnly" model="closed" dt:type="string"> <AttributeType name="type"/> <attribute type="type" default="string"/> <AttributeType name="size"/> <attribute type="size" default="2147483647"/> </ElementType> <ElementType name="phone" content="textOnly" model="closed" dt:type="string"> <AttributeType name="type"/> <attribute type="type" default="string"/> <AttributeType name="size"/> <attribute type="size" default="2147483647"/> </ElementType> <ElementType name="billrate" content="textOnly" model="closed" dt:type="float"> <AttributeType name="type"/> <attribute type="type" default="float"/> <AttributeType name="size"/> <attribute type="size" default="7"/> <AttributeType name="precision"/> <attribute type="precision" default="2"/> </ElementType> <ElementType name="btype" content="textOnly" model="closed" dt:type="string"> <AttributeType name="type"/> <attribute type="type" default="string"/> <AttributeType name="size"/> <attribute type="size" default="15"/> </ElementType> <ElementType name="pk" content="textOnly" model="closed" dt:type="i4"> <AttributeType name="type"/> <attribute type="type" default="i4"/> <AttributeType name="size"/> <attribute type="size" default="4"/> </ElementType> </Schema>

See also:

Class wwXML (High Level Methods) | wwxml::nCreateDataStructure | wwxml::CreateDataStructureDTD

© West Wind Technologies, 1996-2019 • Updated: 09/10/01
Comment or report problem with topic