Jump to content

Recommended Posts

Posted

Hi AutoIT Forum.

I have some problems with the XML DOM Wrapper.

This is my XML for example:

<i>
    <name>INAME1
     <iserver>iserver</iserver>
     <username>username</username>
     <password>password</password>
     <sserver>sserver</sserver>
    </name>
    <name>INAME2
     <iserver>iserver</iserver>
     <username>username</username>
     <password>password</password>
     <sserver>sserver</sserver>
    </name>
    <name>INAME3
     <iserver>iserver</iserver>
     <username>username</username>
     <password>password</password>
     <sserver>sserver</sserver>
    </name>
   </i>

I want to get the path of <name>INAME2. How can i do that?

I want to write and read at this path....

Posted

Why use XML DOM Wrapper? I think this could be done with _StringBetween function (isn't it possible?)

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Posted

Why use XML DOM Wrapper? I think this could be done with _StringBetween function (isn't it possible?)

I don't only want to read from the xml file, also i want to write in it.

I think i have solved the problem nearly with /name[1]...

So i can geht the Index out of an array.

Posted

My solution:

; ---------------
$oprofilelesenname = oprofilelesen()
   $file = _XMLFileOpen($sPath)
   $oplna = _ArraySearch($oprofilelesenname, $the_Profile)
   If $oplna = -1 Then
  _XMLCreateChildNode("/o_profiles", "name", $the_Profile)
   EndIf
   _XMLSaveDoc($sPath)
   $oprofilelesenname = oprofilelesen()
   $file = _XMLFileOpen($sPath)
   $oplnaIndex = _ArraySearch($oprofilelesenname, $the_Profile)
   $oprofiles_name = "/o_profiles/name[" & $oplnaIndex & "]"
;------------------

Func oprofilelesen()
   $sPath = @MyDocumentsDir & "OPlug-In TestEingabemaske Profileprofiles.xml"
   $file = _XMLFileOpen($sPath)
   $oprofilelesenname = _XMLGetValue("/o_profiles/name")
 
   _XMLSaveDoc($sPath)
   Return ($oprofilelesenname)
EndFunc

It works very well ;)

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
×
×
  • Create New...