[r321]: / trunk / Library / POUs / FB_XmlControl / svnobj  Maximize  Restore  History

Download this file

5 lines (5 with data), 8.4 kB

Gx_l¥ !0…jüoäW9ïg™	Õ‡‡âSystem.StringL{6f9dac99-8de1-4efc-8465-68ac443b7d08}SpecialFuncL{0db3d7bb-cde0-4416-9a7b-ce49a0124323}NoneImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocument	L{f3878285-8e4f-490b-bb1b-9acbb7eb04db}
TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}Id
longTagTextInterfaceL{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}(*²Organizes parsing and composing of XML data. Data can be treated as STRING or char array.˜Filebuffersize is default 4096 bytes and can be set via Gvl_Param_XmlControlUsage example:1. Initiate    VAR8        XML : FB_XMLControl;x        Buffer: STRING(GVL_Param_XmlControl.udiMaxFileSize);        //orŽ        Buffer: ARRAY [0..GVL_Param_XmlControl.udiMaxFileSize] OF BYTE;    END_VARH        XML.pBuffer: = ADR (buffer);R        XML.LenBuffer: = SIZEOF (buffer); \    Add your own preferred fileheader like so:!^    XML: <?xml version="1.0" encoding="UTF-8"?>"   #–        XML.WriteDocumentHeader( '<?xml version="1.0" encoding="UTF-8"?>');$F2. Compose a tag with a parameters:%<XML: <MyTag ParaName = "11" />&H    XML.newTag(sTagName: = 'MyTag');'l    XML.newPara(sName: = 'ParaName', sPara: = sValue);(&    XML.CloseTag();)"3. Add tag value:*:XML: <MyTag> MyText </ MyTag>+B    XML.newTag(sName := 'MyTag');,P    XML.newTagData(sTagData :='MyText');-P4. Jump to the beginning of the XML data.(XML.toStartBuffer();/"5. Add a comment:0.XML: <!-- MyComment -->1X    XML.newComment(sTagName: = 'MyComment');2v6. Returns the next tag from the current position in buffer3XML.NextTag();4D7. Output the parameter of the tag5BXML.NextPara(sPara: = LastValue);6`Feedback: sPara returns the value found (string)7*)8:{attribute 'hide_all_locals'}98FUNCTION_BLOCK FB_XmlControl:VAR;:    Buffer : FB_StreamBuffer;<<    TagList : FB_StreamBuffer;=0    sTags : T_MaxString;>D    TagListSeek : FB_StreamBuffer;?.    sTagsSeek : STRING;@4    Tag : FB_StreamBuffer;A.    sTag : T_MaxString;B&    xTagOpen: BOOL;C(    iSelect : UDINT;D2    iSelectStart : UDINT;E.    iSelectEnd : UDINT;F:    iSelectStartPara : UDINT;G6    iSelectEndPara : UDINT;H8    iSelectTagClose : UDINT;I<    iSelectStartValue : UDINT;J8    iSelectEndValue : UDINT;K4    udiSearchPos : UDINT; LEND_VARMVAR CONSTANTN@    TAG_OPEN : STRING(1) := '<';OB    TAG_CLOSE : STRING(1) := '>';PL    END_TAG_CLOSE : STRING(4) := '/>';Q:    SPACE : STRING(1) := ' ';R<    EQUALS : STRING(1) := '=';S:    QUOTE : STRING(1) := '"';TD    BACK_SLASH : STRING(1) := '\';UJ    FORWARD_SLASH : STRING(1) := '/';VP    OPEN_COMMENT : STRING(5) := '<!-- ';WP    CLOSE_COMMENT : STRING(4) := ' -->';X8    TAB : STRING(2) := '$T';Y:	CR_LF : STRING(4) := '$R$N';Z  [X	//$OD : ASCII code for carriage return (CR)\&	//$$ : to add a $R]:	//$' : to add ' (apostrophe)^.	//$L or $l : line feed_,	//$N or $n : new line`.	//$P or $p : next pagea2	//$R or $r : end of lineb"UniqueIdGeneratorc112dPOULeveleL{8e575c5b-1d37-49c6-941b-5c0ec7874787}fStandardg ChildObjectGuidsh8System.Collections.ArrayListi,AddAttributeSubsequentjboolÐÐ-ÐÐ	E
ÐÐ
­ÚÐ-ÐÐ	E
cÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­	ÚÐ-ÐÐ
­
ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­
ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ- ÐÐ
­ÚÐ-!ÐÐ
­nÚÐ-"ÐÐ
­ÚÐ-#ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-$ÐÐ
­ÚÐ-%ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-&ÐÐ
­ÚÐ-'ÐÐ
­ÚÐ-(ÐÐ
­ ÚÐ-ÐÐ
­!ÚÐ-ÐÐ
­"ÚÐ-)ÐÐ
­#ÚÐ-*ÐÐ
­$ÚÐ-ÐÐ
­%ÚÐ-+ÐÐ
­&ÚÐ-,ÐÐ
­'ÚÐ-(ÐÐ
­(ÚÐ-ÐÐ
­)ÚÐ-ÐÐ
­*ÚÐ--ÐÐ
­+ÚÐ-.ÐÐ
­,ÚÐ-ÐÐ
­-ÚÐ-ÐÐ
­.ÚÐ-/ÐÐ
­/ÚÐ-0ÐÐ
­0ÚÐ-ÐÐ
­1ÚÐ-1ÐÐ
­2ÚÐ-ÐÐ
­3ÚÐ-2ÐÐ
­4ÚÐ-3ÐÐ
­5ÚÐ-ÐÐ
­6ÚÐ-ÐÐ
­7ÚÐ-4ÐÐ
­8ÚÐ-5ÐÐ
­9ÚÐ-6ÐÐ
­:ÚÐ-ÐÐ
­;ÚÐ-7ÐÐ
­pÚÐ-8ÐÐ
­=ÚÐ-9ÐÐ
­>ÚÐ-:ÐÐ
­?ÚÐ-;ÐÐ
­@ÚÐ-<ÐÐ
­AÚÐ-=ÐÐ
­BÚÐ->ÐÐ
­CÚÐ-?ÐÐ
­DÚÐ-@ÐÐ
­EÚÐ-AÐÐ
­FÚÐ-BÐÐ
­GÚÐ-CÐÐ
­HÚÐ-DÐÐ
­IÚÐ-EÐÐ
­JÚÐ-FÐÐ
­KÚÐ-GÐÐ
­LÚÐ-HÐÐ
­MÚÐ-IÐÐ
­NÚÐ-JÐÐ
­OÚÐ-KÐÐ
­PÚÐ-LÐÐ
­QÚÐ-MÐÐ
­RÚÐ-NÐÐ
­SÚÐ-OÐÐ
­TÚÐ-PÐÐ
­UÚÐ-QÐÐ
­VÚÐ-RÐÐ
­WÚÐ-SÐÐ
­XÚÐ-TÐÐ
­YÚÐ-UÐÐ
­ZÚÐ-VÐÐ
­[ÚÐ-WÐÐ
­fÚÐ-XÐÐ
­kÚÐ-YÐÐ
­lÚÐ-ZÐÐ
­]ÚÐ-[ÐÐ
­^ÚÐ-\ÐÐ
­_ÚÐ-]ÐÐ
­`ÚÐ-^ÐÐ
­aÚÐ-_ÐÐ
­bÚÐ-`ÐÐ
­cÚÐ-aÐÐ
­ÚÐ-LÐb-cÐde-fghÐij­