Jump to content

XML DOM wrapper (COM)


eltorro
 Share

Recommended Posts

Hello.

I am trying to read from one xml and add it to other xml file (read whole node from file A and write exeacty same node in file :)

Is there such a function?

I found function to delete selected node but can't figurout how to read off one file and write same thing in other file (to replace deleted node if it exsisted or simply update xml with new one)

PS my xml file have alot of childnodes..

Like:

<Node1>Text1
    <Node2>Text2
        <Node3>Text3
            <Node4>
                <Node5>Text5</Node5>
                <Node6>Text6</Node6>
            </Node4>
            <Node7>Text7</Node7>
            <Node18>Text8
                <Node19>Text9</Node19>
            </Node18>
        </Node3>
        <Node3>Text3A
            <Node4>
                <Node5>Text5</Node5>
                <Node6>Text6</Node6>
            </Node4>
            <Node7>Text7</Node7>
            <Node18>Text8
                <Node19>Text9</Node19>
            </Node18>
        </Node3>
    </Node2>
</Node1>

So is this possible to read Node3 (the one contain "Text3A") and all child nodes with their data and write all this in other xml file.

Link to comment
Share on other sites

I have an xml file and I need to pull the outcall and incalls to arrays, I'm lost.. Any help would be great :)

XML File

<?xml version="1.0"?>
 <phone>
     <hourstart>10</hourstart>
     <hourstop>1</hourstop>
     <id>1510 10 3</id>
     <light>no</light>
     <call>Line_1_459.55 Line_1_2655.06</call>
     <call>Line_1_464.85 Line_1_2667.57</call>
     <call>Line_1_470.11 Line_1_2680.01</call>
     <call>Line_1_475.57 Line_1_2692.9</call>
     <call>Line_1_480.9 Line_1_2705.49</call>
     <call>Line_1_486.2 Line_1_2718.01</call>
     <outcall>Line_1_604.13 Line_1_2523.96</outcall>
     <outcall>Line_1_617.85 Line_1_2522.98</outcall>
     <outcall>Line_1_620.82 Line_1_2538.1</outcall>
     <outcall>Line_1_616.26 Line_1_2550.58</outcall>
     <outcall>Line_1_609.74 Line_1_2562.6</outcall>  
 </phone>
Try:

#Include <user\_XMLDomWrapper.au3>
;#Include <user\_XMLDomMdi.au3>
;===============================================================================
;Phone example  by <Stephen Podhajecki gehossafats at netmdc com>
;===============================================================================
$msg = ""
Opt("MustDeclareVars", 1)
Local $phone = @ScriptDir & "\phone.xml"
Local $oBs = _XMLFileOpen ($phone, "")
;Local $oBs = _XMLFileOpen ($phone,"",0); is using _XMLDomMdi.au3
If @error Then
    MsgBox(0, "Error", "There was an error opening the file.")
    Exit
EndIf
_GetCalls()
Exit
;===============================================================================
;Funcs
;===============================================================================
Func _GetCalls($sType = "outcall") ; fill the gui with the list.
    Local $i_Nodes = _XMLGetNodeCount ("//phone/" & $sType)
    If $i_Nodes > 0 Then
        Local $sRet = _XMLSelectNodes ("//phone/" & $sType)
        Local $x, $y[$i_Nodes], $z
        If IsArray($sRet) Then
            ;            _ArrayDisplay($sRet,"Node Names")
            GUISetState(@SW_LOCK)
            For $x = 1 To $sRet[0]
                $y[$x - 1] = _RetFirst(_XMLGetField ("//phone/" & $sType & "[" & $x & "]"))
                ConsoleWrite($y[$x - 1] & @LF)
            Next
            GUISetState(@SW_UNLOCK)
            _ArrayDisplay($y, "Outcalls")
        EndIf
    EndIf
EndFunc   ;==>_GetCalls

Func _RetFirst($aArray) ; return first item in an array
    If IsArray($aArray) Then
        Return $aArray[1]
    EndIf
EndFunc   ;==>_RetFirst

eltorro

Link to comment
Share on other sites

Hello.

I am trying to read from one xml and add it to other xml file (read whole node from file A and write exeacty same node in file :)

Is there such a function?

I found function to delete selected node but can't figurout how to read off one file and write same thing in other file (to replace deleted node if it exsisted or simply update xml with new one)

PS my xml file have alot of childnodes..

Like:

<Node1>Text1
     <Node2>Text2
         <Node3>Text3
             <Node4>
                 <Node5>Text5</Node5>
                 <Node6>Text6</Node6>
             </Node4>
             <Node7>Text7</Node7>
             <Node18>Text8
                 <Node19>Text9</Node19>
             </Node18>
         </Node3>
         <Node3>Text3A
             <Node4>
                 <Node5>Text5</Node5>
                 <Node6>Text6</Node6>
             </Node4>
             <Node7>Text7</Node7>
             <Node18>Text8
                 <Node19>Text9</Node19>
             </Node18>
         </Node3>
     </Node2>
 </Node1>

So is this possible to read Node3 (the one contain "Text3A") and all child nodes with their data and write all this in other xml file.

Yes it is. You'll need to use _XMLMdiDOM.au3 to open both files.
Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

After a _XMLFileOpen is there no need for an _XMLFileClose ???

According to msdn http://msdn2.microsoft.com/en-us/library/aa468547.aspx

Once you are finished with the document, you need to release your object reference to it. The MSXML parsers does not expose an explicit Close method. The best you can do is explicitly set the reference to Nothing.

eltorro

Link to comment
Share on other sites

  • 2 weeks later...

Very cool functions! :D

I am just learning to use XML. I'm not a programmer, just looking for better config files, basicly INI files on steroids, and I think XML is my ticket. Some MSDN and Wiki reading (especialy on XPath notation) has helped a lot in trying to understand your functions. And trying to understand your functions has been a very good tutorial.

My fist sticky point is with indentation/formatting of the resulting file. When I run the following script:

; XML Testing
#include <_XMLDomWrapper.au3>

; Init variables
Global $XmlFile = @ScriptDir & "\XML_Test_" & @YEAR & @MON & @MDAY & "_" & @HOUR & @MIN & @SEC & ".xml"
Global $avLetters[3] = ["a", "b", "c"]
Global $avNumbers[3] = ["1", "2", "3"]

; Create XML file with root node = ROOT
_XmlCreateFile ($XmlFile, "ROOT")

; Open XML file
$oXmlFile = _XmlFileOpen ($XmlFile)

; For all letters
For $L = 0 To UBound($avLetters) - 1
    ; Add the letter under root
    _XMLCreateRootNodeWAttr ("Letter", "char", $avLetters[$L])

    ; Create nodes for all numbers
    For $N = 0 To UBound($avNumbers) - 1
        _XMLCreateChildNode ("ROOT/Letter[@char = '" & $avLetters[$L] & "']", "x" & $avNumbers[$N])
    Next
Next

I get the following output file:

<?xml version="1.0"?>
<ROOT><Letter char="a"><x1/><x2/><x3/></Letter>



<Letter char="b"><x1/><x2/><x3/></Letter>



<Letter char="c"><x1/><x2/><x3/></Letter>



</ROOT>

Is my code wrong? The functions to create nodes call a function named _AddFormat(), but I don't fully understand what it does yet. Maybe that's related? :P

What I was hoping for was:

<?xml version="1.0"?>
<ROOT>
    <Letter char="a">
        <1/>
        <2/>
        <3/>
    </Letter>
    <Letter char="b">
        <1/>
        <2/>
        <3/>
    </Letter>
    <Letter char="c">
        <1/>
        <2/>
        <3/>
    </Letter>
</ROOT>

Note the "x" in front of the numbers in the actual script is only there because it doesn't seem to let me start a node name with just a number. Is that per some XML definition, or should I be able to generate this?

:whistle:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Very cool functions! :D

I am just learning to use XML. I'm not a programmer, just looking for better config files, basicly INI files on steroids, and I think XML is my ticket. Some MSDN and Wiki reading (especialy on XPath notation) has helped a lot in trying to understand your functions. And trying to understand your functions has been a very good tutorial.

My fist sticky point is with indentation/formatting of the resulting file. When I run the following script:

; XML Testing
#include <_XMLDomWrapper.au3>

; Init variables
Global $XmlFile = @ScriptDir & "\XML_Test_" & @YEAR & @MON & @MDAY & "_" & @HOUR & @MIN & @SEC & ".xml"
Global $avLetters[3] = ["a", "b", "c"]
Global $avNumbers[3] = ["1", "2", "3"]

; Create XML file with root node = ROOT
_XmlCreateFile ($XmlFile, "ROOT")

; Open XML file
$oXmlFile = _XmlFileOpen ($XmlFile)

; For all letters
For $L = 0 To UBound($avLetters) - 1
    ; Add the letter under root
    _XMLCreateRootNodeWAttr ("Letter", "char", $avLetters[$L])

    ; Create nodes for all numbers
    For $N = 0 To UBound($avNumbers) - 1
        _XMLCreateChildNode ("ROOT/Letter[@char = '" & $avLetters[$L] & "']", "x" & $avNumbers[$N])
    Next
Next

I get the following output file:

<?xml version="1.0"?>
 <ROOT><Letter char="a"><x1/><x2/><x3/></Letter>
 
 
 
 <Letter char="b"><x1/><x2/><x3/></Letter>
 
 
 
 <Letter char="c"><x1/><x2/><x3/></Letter>
 
 
 
 </ROOT>

Is my code wrong? The functions to create nodes call a function named _AddFormat(), but I don't fully understand what it does yet. Maybe that's related? :P

What I was hoping for was:

<?xml version="1.0"?>
 <ROOT>
     <Letter char="a">
         <1/>
         <2/>
         <3/>
     </Letter>
     <Letter char="b">
         <1/>
         <2/>
         <3/>
     </Letter>
     <Letter char="c">
         <1/>
         <2/>
         <3/>
     </Letter>
 </ROOT>

Note the "x" in front of the numbers in the actual script is only there because it doesn't seem to let me start a node name with just a number. Is that per some XML definition, or should I be able to generate this?

:whistle:

Hi, and Thank you for your interest.

MSXML does not save with indenting. The _AddFormat function was sent to me by someone to include in it. It does not work as well as one would expect. I will be looking other methods in the near future. One possible method involves using a XSL style sheet and transforming the document. Another is to parse the document and add the tabs and line feeds.

I have used htmltidy for as long as I can remember to format web pages and it works just as well on xml.

I have not had time to really work on this for quite a while now (or any other projects either). But hopefully soon.

Look for an update to the formatting function by the middle of next week.

Regards,

eltorro

Edit: Spelling.

Edited by eltorro
Link to comment
Share on other sites

How can I rename a Node:

I need to change the name "Section1" to "Section3"

From

<Root>
    <Section1>
        <key1>One</key1>
        <key2>Two</key2>
    </Section1>
    <Section2>
        <key1>One</key1>
        <key2>Two</key2>
    </Section2>
</Root>

Thanks in advance and nice UDF

Link to comment
Share on other sites

How can I rename a Node:

I need to change the name "Section1" to "Section3"

I'm a newbie with this, but I don't think "rename" is a valid interface to the MSXML DOM objects. See MSDN descriptions. You probably have to read out the contents of that node, delete it from the DOM, then recreate it with the new node name and insert the contents back into it.

Of course, once you script that whole process as a function, the best name for it would be _XmlNodeRename(), and you should post it here for eltorro to include in his UDF!

:whistle:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Updated first post.

Added new functions, _XMLTransform () and _XMLReplaceChild().

I never liked the way the "pretty print" _AddFormat worked. So it has been changed.

Its output is now like this:

<?xml version="1.0"?>
     <ROOT>
     <Letter char="d">
     <x1>
     <y0/>
     <y1/>
     <y2/>
     </x1>
     <x2>
     <y0/>
     <y1/>
     <y2/>
     </x2>
     </Letter>
     </ROOT>

Use the function _XMLTransform($xmlObject) to stylize it like below:

<?xml version="1.0" encoding="UTF-16"?>
     <ROOT>
         <Letter char="d">
             <x1>
                 <y0></y0>
                 <y1></y1>
                 <y2></y2>
             </x1>
             <x2>
                 <y0></y0>
                 <y1></y1>
                 <y2></y2>
             </x2>
         </Letter>
       </ROOT>

_XMLTransform() takes 3 args the second and third are optional. The first is a Dom object returned by _XMLFileOpen(), the second (optional) is a stylesheet(file) or valid xsl, the third (optional) is the output file.

To use _XMLReplaceChild() pass the first 2 args, the namespace is necessary if your xml is using a namespace.

;_XMLReplace($fullPathtoOldNode,$JustNewNodeName,$OptionalNS)oÝ÷ ÚÇméhÁ«­¢+Ø(ìa50QÍÑ¥¹(¥¹±Õ±ÐíÕÍȽ}a51½µ]ÉÁÁȹÔÌÐì(ì%¹¥ÐÙÉ¥±Ì(í±½°ÀÌØíaµ±¥±ôMÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈía51}QÍÑ|ÅÕ½ÐìµÀìeHµÀì5=8µÀì5dµÀìÅÕ½Ðí|ÅÕ½ÐìµÀì!=UHµÀì5%8µÀìMµÀìÅÕ½Ðì¹áµ°ÅÕ½Ðì)±½°ÀÌØíaµ±¥±ôMÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈía51}QÍÑ|ÅÕ½ÐìµÀìeHµÀì5=8µÀì5dµÀìÅÕ½Ðì¹áµ°ÅÕ½Ðì)±½°ÀÌØíÙ1ÑÑÉÍlÍtôlÅÕ½ÐíÅÕ½Ðì°ÅÕ½ÐíÅÕ½Ðì°ÅÕ½ÐíÅÕ½Ðít)±½°ÀÌØíÙ9ÕµÉÍlÍtôlÅÕ½ÐìÄÅÕ½Ðì°ÅÕ½ÐìÈÅÕ½Ðì°ÅÕ½ÐìÌÅÕ½Ðít(ì
ÉÑa50¥±Ý¥Ñ ɽ½Ð¹½ôI==P)}aµ±
ÉÑ¥± ÀÌØíaµ±¥±°ÅÕ½ÐíI==PÅÕ½Ðì°Ä¤(ì=Á¸a50¥±)±½°ÀÌØí½aµ±¥±ô}aµ±¥±=Á¸ ÀÌØíaµ±¥±¤)%9½Ð¡%Í=¨ ÀÌØí½aµ±¥±¤¤Q¡¸á¥Ð)1½°ÀÌØí±Ù°ôÌ(ì½È±°±ÑÑÉÌ)%ÀÌØí±Ù°ÐìôÄQ¡¸(½ÈÀÌØí0ôÀQ¼U  ½Õ¹ ÀÌØíÙ1ÑÑÉ̤´Ä(ìÑ¡±ÑÑÈÕ¹Èɽ½Ð(}a51
ÉÑI½½Ñ9½]ÑÑÈ ÅÕ½Ðí1ÑÑÈÅÕ½Ðì°ÅÕ½Ðí¡ÈÅÕ½Ðì°ÀÌØíÙ1ÑÑÉÍlÀÌØí1t¤(}Õ]ɥѡ}a51ÉÉ½È ¤¤(%ÀÌØí±Ù°ÐìôÈQ¡¸(ì
Éѹ½Ì½È±°¹ÕµÉÌ(½ÈÀÌØí8ôÀQ¼U  ½Õ¹ ÀÌØíÙ9ÕµÉ̤´Ä(}a51
ÉÑ
¡¥±9½ ÅÕ½ÐíI==1ÑÑÉm¡ÈôÌäìÅÕ½ÐìµÀìÀÌØíÙ1ÑÑÉÍlÀÌØí1tµÀìÅÕ½ÐìÌäítÅÕ½Ðì°ÅÕ½ÐíàÅÕ½ÐìµÀìÀÌØíÙ9ÕµÉÍlÀÌØí9t¤(}Õ]ɥѡ}a51ÉÉ½È ¤¤(%ÀÌØí±Ù°ÐìôÌQ¡¸(½ÈÀÌØí@ôÀQ¼È(}a51
ÉÑ
¡¥±9½ ÅÕ½ÐíI==1ÑÑÉm¡ÈôÌäìÅÕ½ÐìµÀìÀÌØíÙ1ÑÑÉÍlÀÌØí1tµÀìÅÕ½ÐìÌäít½àÅÕ½ÐìµÀìÀÌØíÙ9ÕµÉÍlÀÌØí9t°ÅÕ½ÐíäÅÕ½ÐìµÀìÀÌØí@¤(}Õ]ɥѡ}a51ÉÉ½È ¤¤(%ÀÌØí±Ù°ÐìôÐQ¡¸(½ÈÀÌØíHôÔQ¼Ü(}a51
ÉÑ
¡¥±9½ ÅÕ½Ðì¼½1ÑÑÉm¡ÈôÌäìÅÕ½ÐìµÀìÀÌØíÙ1ÑÑÉÍlÀÌØí1tµÀìÅÕ½ÐìÌäít½àÅÕ½ÐìµÀìÀÌØíÙ9ÕµÉÍlÀÌØí9tµÀìÅÕ½Ðì½äÅÕ½ÐìµÀìÀÌØí@°ÅÕ½ÐíèÅÕ½ÐìµÀìÀÌØíH¤(}Õ]ɥѡ}a51ÉÉ½È ¤¤((9áÐ(¹%(9áÐ(¹%(9áÐ(¹%(9áÐ)¹%(íÉÁ±ÌäíäÄÌäìÝ¥Ñ ÅÕ½ÐíÄÈÅÕ½ÐìÝ¡ÉÌäíàÄÌäì¥Ì¡¥±½1ÑÑÈÝ¡¥ ¡ÌÑ¡ÑÑÉ¥ÕÑÌäí¡ÈÌäìÑ¡ÐÅÕ±ÌÌäíÌäì)}a51IÁ±
¡¥± ÅÕ½Ðì¼½1ÑÑÉm¡ÈôÌäíÌäít½àĽäÈÅÕ½Ðì°ÅÕ½ÐíÄÈÅÕ½Ðì¤(íÕ±ÐÍÑå±Í¡Ð½Ì¥¹¹Ñ¥¹¸QÍбͼÍÙ¥¹Ñ¼¹Ý¥±¸)}a51Qɹͽɴ ÀÌØí½aµ±¥±°ÅÕ½ÐìÅÕ½Ðì±MÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈía51QÍÐĹᵰÅÕ½Ðì¤)}Õ]ɥѡ}a51ÉÉ½È ¤¤(íøìM¡½ÜÉÍÕ±ÑÌ¥¸M¥Q(íøÀÌØíµôÌäìÅÕ½ÐíèÀäÈíAɽɴ¥±ÌÀäÈíM¥¹Ñ¥±±QáХѽÈÀäÈíM¥Q¹áÅÕ½ÐìµÍٹɹÐÌäìµÀìÌäìÅÕ½ÐìÌäìµÀìMÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈía51QÍÐĹᵰÅÕ½ÐìµÀìÌäìÅÕ½ÐìÌäì(íøIÕ¸ ÀÌØíµ±MÉ¥ÁѥȱM]}!%¤(ÀÌØí½aµ±¥±¹ÍÙ ÀÌØíaµ±¥±¤(ÀÌØí½aµ±¥±ôÀ)á¥Ð(

:shocked:

If there are any other functions that seem necessary, post a request and or example so that it might be implemented.

Edited by eltorro
Link to comment
Share on other sites

If there are any other functions that seem necessary, post a request and or example so that it might be implemented.

Yes I was trying to translate the autoit ini file manipulation funtion to xml so you can substitute it when you need more than 64 kb of data (because I read that ini file has 64 KB of limit)

the idea is simple but I'm very confused with xml and only have three function translated that work until now ( xIniWrite, xIniRead).

so if you have some time to take a look of the file attached and can help me to finish the other function I will appreciated that.

The idea is to translate the Ini File function to xml to use the same name and the same parameters so the user can do an easy transition:

IniDelete -> xIniDelete

IniRead -> xIniRead

IniReadSection -> xIniReadSection

IniReadSectionNames -> xIniReadSectionNames

IniRenameSection -> xIniRenameSection

IniWrite -> xIniWrite

IniWriteSection -> xIniWriteSection

and at last a couple of function for data conversion (IniToXml and XmlToIni) that convert an ini file like:

[Section1]
key1=Value1
key2=Value2
[Section2]
key1=Value3
key2=Value4

to a xml file like this

<?xml version="1.0"?>
<IniXML>
    <Section1>
        <key1>Value1</key1>
        <key2>Value2</key2>
    </Section1>
    <Section2>
        <key1>Value3</key1>
        <key2>Value4</key2>
    </Section2>
</IniXML>

Sorry if I Abuse of your offer but I Think that these UDF will be very useful for many autoit users.

please download the attached file below to see what I have done until now.

thanks in advance

xIni_UDF.au3

Link to comment
Share on other sites

Shouldn't be too hard to do.

I'll take a look. :shocked:

Regards

Link to comment
Share on other sites

  • 2 weeks later...

I cant get the _XMLGetAttrib to work... even the example throws an error...

#include <_XMLDomWrapper.au3>
#include <Array.au3>
Local $sFile = @ScriptFullPath & ".xml"
_XMLCreateFile ($sFile, "Work", True, True)
_XMLFileOpen ($sFile)
$attribs = _ArrayCreate("x")
$value = _ArrayCreate("test")
_XMLCreateRootNodeWAttr("Day",$attribs,$value)
$a = _XMLGetAttrib("Work/Day","x")
MsgBox(0,0,$a)

Using newest stable and beta...

Debug getting me this

Get Attrib length= 1

RET>>test

Text>>test

And the Message in the end contain the right string...

But the error pops up just before the textbox

err.description is:

err.windescription: Variable must be of type 'Object'.

err.number is: 000000A9

err.lastdllerror is: 0

err.scriptline is: 430

err.source is:

err.helpfile is:

err.helpcontext is:

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Link to comment
Share on other sites

I cant get the _XMLGetAttrib to work... even the example throws an error...

err.description is:

err.windescription: Variable must be of type 'Object'.

err.number is: 000000A9

err.lastdllerror is: 0

err.scriptline is: 430

err.source is:

err.helpfile is:

err.helpcontext is:

You can comment out line 430. It has no bearing what the function does. I have already made the change in the download.

Thank You,

eltorro.

Link to comment
Share on other sites

I was hoping someone could take a look at this XML file, and tell me why I can't use the XML UDF functions on it.

This XML file is what is generated from the Longhorn "Windows System Image Manager", when you create an unattend answer file to install Longhorn or Vista.

I've tried everything I can think of, but I'm hoping some one has the answer.

Unattend_LH.xml

Edited by Jazkal
Link to comment
Share on other sites

I was hoping someone could take a look at this XML file, and tell me why I can't use the XML UDF functions on it.

This XML file is what is generated from the Longhorn "Windows System Image Manager", when you create an unattend answer file to install Longhorn or Vista.

I've tried everything I can think of, but I'm hoping some one has the answer.

I've been messing with this for the past 3 hrs. The problem is with xpath and the unprefixed urn

xmlns="urn:schemas-microsoft-com:unattend"

Finally found the solution : Delcare a prefix when the file is opened then use the prefix as normal.

#Include <user/_XMLDomWrapper.au3>

Local $sXmlFile =@ScriptDir&"\unattend_LH.xml"
;; Namespaces from the xml file.
;; Magic fix.  Note the :un added to the first name space.
Local $my_ns = 'xmlns:un="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"'

Local $oOXml = _XMLFileOpen($sXmlFile,$my_ns)
Dim $aAttrName[1],$aAttrValue[1]
Local $path = "/un:unattend/un:servicing/un:package/un:assemblyIdentity"
 _XMLGetAllAttrib($path,$aAttrName,$aAttrValue)
_ArrayDisplay($aAttrName,$path)
_ArrayDisplay($aAttrValue,$path)

eltorro

Edit: typo

Edited by eltorro
Link to comment
Share on other sites

Hmmm bow I cant get XMLCreateChildNodeWAttr to work

#include <_XMLDomWrapper.au3>
#include <Array.au3>

Local $sFile = @ScriptFullPath & ".xml"
If @error = 0 Then
    _XMLCreateFile ($sFile, "Work", True)
    _XMLFileOpen ($sFile)
    _XMLCreateRootChild("Day")
    $attribs = _ArrayCreate("Start")
    $values = _ArrayCreate("1200")
    _XMLCreateChildNode("Work/Day", "Enheder")
    _XMLCreateChildNodeWAttr("Work/Day/Enheder", "Enhed", $attribs, $values)
EndIf

The last entry is not written as far as I can see

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...