Jump to content

Search the Community

Showing results for tags 'xml xmldom'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hi all, Once again I am stuck using XMLDOM. Let me explain you what I try to achieve : I have an XML file that I want to split in multiple smaller file based on certain criterias. Below My xml file (also attached) <KeyFileAssoc version="0.3"> <Config> <AppsRoot>..\..\Apps</AppsRoot> <Language file="KeyFileAssoc_fr.xml">fr</Language> <UpdateAutoCheck>on</UpdateAutoCheck> <SysTrayFastSwitch>on</SysTrayFastSwitch> <ShowAssocToolTip>on</ShowAssocToolTip> <UseLbkProxySettings>on</UseLbkProxySettings> </Config> <AppsAssoc> <TypeDescription.en>URL : LiberKey Installation Protocol (lbkinst)</TypeDescription.en> <TypeDescription.fr>URL : Protocole d&apos;installation LiberKey (lbkinst)</TypeDescription.fr> <TypeIcon index="0">%LBKROOT%\LiberKeyTools\LKAppsVCheck\LKAppsVCheck.exe</TypeIcon> <Shell default="open"> <Action name="open"> <ExePath>%LBKROOT%\LiberKeyTools\LKAppsVCheck\LKAppsVCheck.exe</ExePath> <CmdArgs>%1</CmdArgs> <Description.en>Install on my LiberKey</Description.en> <Description.fr>Installer sur ma LiberKey</Description.fr> <AppName>LiberKeyOnlineSetup</AppName> </Action> </Shell> </FileType> <FileType ext="mp3"> <TypeDescription.en>MPEG Audio Stream file, Layer III (MP3)</TypeDescription.en> <TypeDescription.fr>Fichier MPEG Audio Stream, Layer III (MP3)</TypeDescription.fr> <Shell> <Action name="ouvrir_avec_mp3tag__liberkey"> <Description.en>Ouvrir avec Mp3tag (LiberKey)</Description.en> <Description.fr>Ouvrir avec Mp3tag (LiberKey)</Description.fr> <ExePath>%APPS%\Mp3tag\Mp3tagLKL.exe</ExePath> <AppName>Mp3tag</AppName> <CmdArgs>&quot;%1&quot;</CmdArgs> </Action> <Action name="vuplayer"> <Description.en>Open with AIMP (LiberKey)</Description.en> <Description.fr>Ouvrir avec AIMP (LiberKey)</Description.fr> <ExePath>%APPS%\AIMP\AIMPLKL.exe</ExePath> <AppName>AIMP</AppName> <CmdArgs>&quot;%1&quot;</CmdArgs> </Action> <Action name="editer_avec_audacity__liberkey"> <Description.en>Edit with Audacity (LiberKey)</Description.en> <Description.fr>Editer avec Audacity (LiberKey)</Description.fr> <ExePath>%APPS%\Audacity\AudacityLKL.exe</ExePath> <AppName>Audacity </AppName> <CmdArgs>&quot;%1&quot;</CmdArgs> </Action> </Shell> </FileType> <FileType ext="wav"> <TypeDescription.en>Audio file (WAV)</TypeDescription.en> <TypeDescription.fr>Fichier Audio (WAV)</TypeDescription.fr> <Shell> <Action name="vuplayer"> <Description.fr>Ouvrir avec AIMP (LiberKey)</Description.fr> <ExePath>%APPS%\AIMP\AIMPLKL.exe</ExePath> <AppName>AIMP</AppName> <CmdArgs>&quot;%1&quot;</CmdArgs> </Action> <Action name="editer_avec_audacity__liberkey"> <Description.en>Edit with Audacity (LiberKey)</Description.en> <Description.fr>Editer avec Audacity (LiberKey)</Description.fr> <ExePath>%APPS%\Audacity\AudacityLKL.exe</ExePath> <AppName>Audacity </AppName> <CmdArgs>&quot;%1&quot;</CmdArgs> </Action> </Shell> </FileType> </AppsAssoc> <AppsAssocErrors/> </KeyFileAssoc> I want, based on this xml file to create 3 xml file containning information in relation to the AppName Value. So far I try to read my file and display what I need to write in different file after. My actual code #include <File.au3> #Include <array.au3> #include "_XMLDomWrapper.au3" if $CmdLine[0] < 1 Then msgbox(0,'','usage : ' & @CRLF & @TAB & @ScriptName & ' KfaXMLFile.xml') EndIf if FileExists($CmdLine[1]) Then Explode_KFA($CmdLine[1]) Else msgbox (0,'','usage : ' & @CRLF & @TAB & @ScriptName & ' KfaXMLFile.xml' & @CRLF & _ @TAB & ' KfaXMLFile.xml must be a valid KFA XML file') EndIf Exit Func Explode_KFA($KFAFile) _XMLFileOpen($KFAFile) $strXpathBase = '//KeyFileAssoc/AppsAssoc/FileType[@ext]' $aGetValue = _XMLGetValue($strXpathBase & '/Shell/Action/AppName') $aUniq=_ArrayUnique($aGetValue, 1,1,1) _ArrayDisplay($aUniq, ' Initial ') For $i=1 to $aUniq[0] ; Get list of XMLTAG $aXmlTag=_ArrayUnique( _XMLSelectNodes($strXpathBase & '/Shell/Action[AppName[starts-with(text(),"'& $aUniq[$i] & '")]]/*'), 1,1,1) _ArrayDisplay($aXmlTag,'Field : ' & $aUniq[$i]) $aXmlNodes=_XMLSelectNodes($strXpathBase & '/Shell/Action[AppName[starts-with(text(),"'& $aUniq[$i] & '")]]') _ArrayDisplay($aXmlNodes,'Nodes') For $iCurrentNode = 1 to $aXmlNodes[0] For $iNode = 1 to $aXmlTag[0] $aValueExe = _XMLGetValue($strXpathBase & '/Shell/Action['&$iCurrentNode&'][AppName[starts-with(text(),"'& $aUniq[$i] & '")]]/' & $aXmlTag[$iNode]) _ArrayDisplay($aValueExe,$aXmlTag[$iNode] & ' : ' & $aUniq[$i]) Next Next Next EndFunc There I am stuck ! I don't know how to get for AppName = AIMP the different values, knowing that 1 entry is missing. For <Action name="vuplayer">, there is no <Description.en>. Can anyone give me some directions/hints to look into. I am kind lost there. Based on what I want to achieve, may be there is something more simple. If so feel free. Regards. Gilles SplitXMLfile.au3 KeyFileAssoc.xml
×
×
  • Create New...