News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

XML Parser/Edit library

Started by ragdog, February 05, 2017, 09:46:05 PM

Previous topic - Next topic

ragdog

QuoteNow I put to work these examples of Mini-MXML ( wich library I can't compile  :biggrin:)

Why can´t you compile it?

HSE

Some undefined references ¿?.  But the main problen is I don't know almost nothing about "c". Perhaps the command is wrong.
Equations in Assembly: SmplMath

HSE

@ fearthless:
  Is there some documentation of LTLI TreeView Library v1.0.0.0?

@RagDog:
Have you succeded with mxmlLoadFile?

Thanks
Equations in Assembly: SmplMath

fearless

It was just an internal library created for convenience which wrapped some common code to help speed up use and re-use. Only whats in the .inc file and the example of the mxmltree example documentation wise i'm afraid.

Although i do have two .api.txt files in the zip ive attached (edit files to see contents and instructions for adding to RadASM for autocomplete of functions) they contain parameters used in the functions, which will help hopefully in figuring out what to pass as a parameter for specific functions.

HSE

Equations in Assembly: SmplMath

ragdog


QuotePosted by: HSE

@RagDog:
Have you succeded with mxmlLoadFile?


Here is my static lib i have compile it with a older msvcrt from xp sdk

http://masm32.com/board/index.php?action=dlattach;topic=5993.0;attach=6232

invoke crt_fopen ,chr$ ("test.xml"), chr$ ("r");
.if eax!=0
mov FilePointer,eax
invoke mxmlLoadFile,NULL,FilePointer,MXML_NO_CALLBACK
.endif


You can use without crt_fopen ,use CreateFile/ReadFile or Mapping File.

Regards,

HSE

 Thanks Ragdog! I will try again :t
Equations in Assembly: SmplMath

HSE

#37
Finally I solve how to load an xml file "not well formed" (without ?xml element) :
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
    include \masm32\include\masm32rt.inc
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
include \masm32\include\mxml_f.inc
includelib \masm32\lib\mxml10.lib
includelib \masm32\lib\uuid.lib

comment * -----------------------------------------------------
                     Build this console app with
        ----------------------------------------------------- *
    .data
      xml   dd 0
      fp    dd 0
      node  dd 0     
    .code

start:
   
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    call main
    inkey
    exit

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

main proc

   mov xml, rvc(mxmlNewXML,"1.0")

   cls
   mov fp, rvc(crt_fopen, "rule3.xml", "r");
   fnc mxmlLoadFile(xml, fp, MXML_TEXT_CALLBACK);
   fnc crt_fclose(fp);
   print "Arbol creado",13,10

    ; /* Find the first element */
    mov node, rvc (mxmlFindElement(xml, xml, NULL, NULL, NULL, MXML_DESCEND));
   
   mov fp, rvc(crt_fopen, "filename2.xml", "w");
   fnc mxmlSaveFile(node, fp, MXML_NO_CALLBACK);
   fnc crt_fclose(fp);
   print "Arbol not_well_formed guardado",13,10

   fnc mxmlDelete(xml);

   ret

main endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

end start


Only at the end, I read the manual!

Now I have to see how to save a "not well formed" xml file  :biggrin:    Ready above  :biggrin: :biggrin:

Note: There is a new version 2.11 of the library, but the default compilation build a .dll
Equations in Assembly: SmplMath