The attribute 'type' on this element is not defined in the DTD/Schema. Line: 32 <test type="object" class="test">I'm sure this is very simple but I don't have a clue. Here is some code that will generate the error:
************* BEGIN SAMPLE PRG ******************** CLEAR * Set this to include the location of wwutils.prg,wwhttp.prg,wwxml.vcx SET PATH TO d:\acprojects\canfitu;d:\classes\wwxml SET PROCEDURE TO wwutils.prg SET PROCEDURE TO wwhttp.prg additive SET CLASSLIB TO wwxml.vcx LOCAL oTest,oTest2 oTest = CREATEOBJECT("test") oTest2 = CREATEOBJECT("test") oTest.nCol1Width = 500 cxml = oTest.Serialize() ?"Before Deserialize:",oTest2.nCol1Width oTest2.Deserialize(cxml) ?"After Deserialize:",oTest2.nCol1Width ?"*Should be = 500" ?"ERROR MESSAGE:" ?oTest2.cError DEFINE CLASS test as Session cConfigPath = "" cError = "" cFont = "Arial" nFontSize = 24 nFontColor = 0 nRowHeight = 20 nNoteFontSize = 10 cNoteFont = "Arial" nCol1Width = 10 nCol2Width = 10 nCol3Width = 30 ********************************************************* * PROCEDURE: Serialize * PURPOSE: Uses wwXML to convert this class to XML for easy storage * RETURNS: Nothing ******************************************** PROCEDURE Serialize() as String LOCAL oXML as wwXML oXML = CREATEOBJECT("wwXML") * oXML.lRecurseObjects = .T. * Exclude any properties that are inherited from session oXML.cPropertyExclusionList = oXML.cPropertyExclusionList + ",datasession,datasessionid" oXML.nCreateDataStructure = 2 RETURN oXML.ObjectToXML(this,'abcdefg') ENDPROC ********************************************************* * PROCEDURE: DeSerialize * PURPOSE: Uses wwXML to convert this class from XML back to an object for easy storage * RETURNS: Nothing ******************************************** PROCEDURE DeSerialize(cXML as String ) as Boolean * Check parameter IF VARTYPE(cXML) # "C" OR EMPTY(cXML) RETURN .F. ENDIF LOCAL oXML as wwXML oXML = CREATEOBJECT("wwXML") * oXML.lRecurseObjects = .T. * Exclude any properties that are inherited from session oXML.cPropertyExclusionList = oXML.cPropertyExclusionList + ",datasession,datasessionid" IF ISNULL(oXML.XMLtoObject(cXML)) this.cError = oXML.cerrormsg RETURN .F. ELSE RETURN .T. ENDIF ENDPROC ENDDEFINE