VS:XMLSAXBeginDocMemory

From Vectorworks Developer
Jump to: navigation, search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Write XML using SAX, begin of a document in memory. XMLSAXEndDocMemory ends a document.
FUNCTION XMLSAXBeginDocMemory(
XMLHandle  :LONGINT) : INTEGER;
def vs.XMLSAXBeginDocMemory(XMLHandle):
    return INTEGER

Parameters

XMLHandle LONGINT

Example

VectorScript

PROCEDURE XMLSaxTest_Write;
CONST
	kExternalsFolder 		= 2;
VAR
	hXML    : LONGINT;
	result  : INTEGER;
	xmlFile : STRING;
	xmlData	: DYNARRAY [] OF CHAR;

BEGIN
	hXML := InitXML;

	result := XMLSAXBeginDocMemory( hXML);

	result := XMLSAXBeginNode( hXML, 'theRoot' );
		result := XMLSAXBeginNode( hXML, 'data' );
			result := XMLSAXAddNodeAttr( hXML, 'id', '1' );
			result := XMLSAXAddNodeAttr( hXML, 'name', 'none' );
			result := XMLSAXAddNodeValue( hXML, 'value1' );
		result := XMLSAXEndNode( hXML );

		result := XMLSAXBeginNode( hXML, 'data' );
			result := XMLSAXAddNodeValue( hXML, 'value2' );
		result := XMLSAXEndNode( hXML );

	result := XMLSAXEndNode( hXML );

	result := XMLSAXEndDoc( hXML );

	{ Writing to string XML }
	ALLOCATE xmlData[0 .. 255];
	result := XMLSAXEndDocMemory( hXML, xmlData );
	AlrtDialog( xmlData );

	result := ReleaseXML(hXML);

	AlrtDialog( Concat( 'done! result=', result ) );
END;
RUN(XMLSaxTest_Write);

Python


Version

Availability: from Vectorworks 2011

See Also

VS:InitXML | VS:ReleaseXML

VS:XMLSAXEndDocMemory | VS:XMLSAXBeginNode | VS:XMLSAXEndNode | VS:XMLSAXAddNodeAttr | VS:XMLSAXAddNodeValue

[[VS:InitXML]] | [[VS:ReleaseXML]] [[VS:XMLSAXEndDocMemory]] | [[VS:XMLSAXBeginNode]] | [[VS:XMLSAXEndNode]] | [[VS:XMLSAXAddNodeAttr]] | [[VS:XMLSAXAddNodeValue]]
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox