Jump to content

Search the Community

Showing results for tags 'XML'.

  • 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

  1. I was asking @eltorro serveral times for any support for XML DOM wrapper (COM) - with no success So I took matters into my hands ..... I want to present XMLWrapperEx.au3 - BETA Version Want to join to the project ? Here is some description: ; #INDEX# ======================================================================================================================= ; Title .........: XMLWrapperEx.au3 ; AutoIt Version : 3.3.10.2++ ; Language ......: English ; Description ...: Functions to use for reading and writing XML using msxml. ; Remarks .......: BETA Version ; Author ........: mLipok ; Version .......: "1.1.1.01" ; _XML_MiscProperty_UDFVersion() #CS This UDF is created on the basis of: https://www.autoitscript.com/forum/topic/19848-xml-dom-wrapper-com/ For this reason, I attach also the last known (to me) previous version ($_XMLUDFVER = "1.0.3.98" _XMLDomWrapper_1.0.3.98_CN.au3 ) For the same reason I continue to recognize the achievements of the work of my predecessors (they are still noted in each Function header). . . . . !!!!!!!!! This is BETA VERSION (all could be changed) !!!!!!!!! . . . WORK IN PROGRES INFORMATION: For now 2015-09-01 the descripion (Function Header) can not entirely correctly describe the function. TODO: in many places I used "TODO" as a keyword to find what should be done in future . I want to: PREVENT THIS: The unfortunate nature of both the scripts is that the func return results are strings or arrays instead of objects. .     I want to: USE THIS CONCEPT:     .   All function should use Refernce to the object as first Function parameter     .   All function should return in most cases objects. There should be separate functions to Change Object collection to array     .   All function should use COM Error Handler in local scope.     .   All function should return @error which are defined in #Region XMLWrapperEx.au3 - @ERROR Enums     .    All function should have the same naming convention     .    All variables should have the same naming convention     .    There should not to be any Global Variable - exception is $g__oXMLDOM_Events     .   It should be possible easy to use XML DOM Events     .        https://msdn.microsoft.com/en-us/library/ms764697(v=vs.85).aspx     .   It should be possible easy to Debug     .    Ultimately, you should be able to do anything with your XML without having to use your own Error Handler. #CE More info inside zip archive. This UDF can be downloaded from here: REMARK: This UDF was formerly named: XMLWrapperEx.au3
  2. Hello, once more I have to see, that my knowledge about XML is too poor, even to use this existing XML UDF If it should be a better approach to make use of StringRegEx, or maybe a totally different approach, any suggestions will be mostly appreciated. I downloaded the ZIP XML_1.1.1.13 and tried to get how to use it from the sample AU3 files included in that ZIP file, well, I don't really get it😵 What I want to do: My mobile phone's backup contain all the contacts in an XML file. This is an example of such a file, backupinfo.xml, shortened to show just one fictive entry: <?xml version="1.0" encoding="utf-8" ?> <ContactRecords> <contact> <structuredName> <displayName>Max Mustermann</displayName> <givenName>Max</givenName> <familyName>Mustermann</familyName> <prefixName /> <middleName /> <suffixName /> <phoneticGivenName /> <phoneticMiddleName /> <phoneticFamily /> </structuredName> <organization> <company>Schlosserei Mustermann GmbH</company> <department /> <title /> </organization> <phones> <phone> <number>07652 881 8181</number> <type>home</type> <customLabel /> </phone> <phone> <number>0 800 435 2758</number> <type>work</type> <customLabel /> </phone> <phone> <number>+49 160 4321 222</number> <type>mobile</type> <customLabel /> </phone> </phones> <emails /> <addresses /> <ims /> <WebSites /> <Events /> <note /> <nickName /> <photo /> <netPhone /> <groups> <group> <groupName>Ungrouped</groupName> </group> </groups> </contact> </ContactRecords> Basically I want to search my mobile's contacts for phone numbers to, to see, what contact they belong to. Propably it will make the task much more easy, when standardizing the mobile's contact XML to hold all numbers in "international-notation-without-any-whitespaces" (thats no problem): <?xml version="1.0" encoding="utf-8" ?> <ContactRecords> <contact> <structuredName> <displayName>Max Mustermann</displayName> <givenName>Max</givenName> <familyName>Mustermann</familyName> <prefixName /> <middleName /> <suffixName /> <phoneticGivenName /> <phoneticMiddleName /> <phoneticFamily /> </structuredName> <organization> <company>Schlosserei Mustermann GmbH</company> <department /> <title /> </organization> <phones> <phone> <number>+4976528818181</number> <type>home</type> <customLabel /> </phone> <phone> <number>+498004352758</number> <type>work</type> <customLabel /> </phone> <phone> <number>+491604321222</number> <type>mobile</type> <customLabel /> </phone> </phones> <emails /> <addresses /> <ims /> <WebSites /> <Events /> <note /> <nickName /> <photo /> <netPhone /> <groups> <group> <groupName>Ungrouped</groupName> </group> </groups> </contact> </ContactRecords> What I would like to get from the XML file as a result, e.g. searching the phone number "+491604321222" Present in XML or not (true) if present then return the values for... type (mobile) givenname (Max) familyname (Mustermann) company (Schlosserei Mustermann GmbH) optional: Other node names and their values within that contact, when not "empty" (like in this examle <emails /> or <middlename />) The values from #2 - #6 would be perfect when returned in a 2D Array, Col0 = name, Col1 = value. Regards, Rudi.
  3. Dear all, i am unable to open a xml file to excel in the "xml table format" Please help me out in where i am missing Local $strFileToOpen = _WinAPI_OpenFileDlg('Select xml file', @WorkingDir, 'All Files(*.*)', 1, '', '', BitOR($OFN_PATHMUSTEXIST, $OFN_FILEMUSTEXIST, $OFN_HIDEREADONLY)) Global $xlXmlLoadImportToList = 2 ; Places the contents of the XML data file in an XML table $oExcel = _Excel_Open() $oWorkbook1=$oExcel.Workbooks.OpenXML($strFileToOpen, "", $xlXmlLoadImportToList) If $strFileToOpen <> False Then     Local $oWorkbook1 = _Excel_BookOpen($oExcel, $strFileToOpen) EndIf Error i am getting is: ......\81e_Compare_v1.au3" (46) : ==> The requested action with this object has failed.: $oWorkbook1=$oExcel.Workbooks.OpenXML($strFileToOpen, "", $xlXmlLoadImportToList) $oWorkbook1=$oExcel.Workbooks^ ERROR >Exit code: 1 Time: 7.338
  4. Hello , I've the following problem and hope somebody can push me in the right direction or have a good example on how to do it. The problem is :I want to search / select / change /check a XML setting in a XML file. The example XML file is as following : <Configuration> <Categories> <Category Name="default"> <SubCategories> <SubCategory Name="defaultsettings"> <Settings> <Setting Name="machinename" TypeName="System.String" Value="defaultname" /> <Setting Name="cpuspeed" TypeName="System.String" Value="false" /> <Setting Name="cmptemp" TypeName="System.String" Value="false" /> <Setting Name="cmpspeed_set" TypeName="System.String" Value="" /> <Setting Name="cmptemp_set" TypeName="System.String" Value="" /> </Settings> </SubCategory> </SubCategories> </Category> <Category Name="settings"> <SubCategories> <SubCategory Name="comp1"> <Settings> <Setting Name="machinename" TypeName="System.String" Value="comp1" /> <Setting Name="cpuspeed" TypeName="System.String" Value="true" /> <Setting Name="cmptemp" TypeName="System.String" Value="false" /> <Setting Name="cmpspeed_set" TypeName="System.String" Value="12" /> <Setting Name="cmptemp_set" TypeName="System.String" Value="" /> </Settings> </SubCategory> <SubCategory Name="comp2"> <Settings> <Setting Name="machinename" TypeName="System.String" Value="comp2" /> <Setting Name="cpuspeed" TypeName="System.String" Value="false" /> <Setting Name="cmptemp" TypeName="System.String" Value="true" /> <Setting Name="cmpspeed_set" TypeName="System.String" Value="" /> <Setting Name="cmptemp_set" TypeName="System.String" Value="9" /> </Settings> </SubCategory> </SubCategories> </Category> </Categories> </Configuration> In this XML file I want to : -search if subcategory whit the name "comp3" exists -if exist change of setting "cpuspeed" value to false -if not exist make a new subcategory "comp3" whit the default settings from subcategory "default settings" what i have this far is : Func xml_test1() Dim $return[0] Local $file = @ScriptDir & "\test.xml" FileOpen($file, $FO_READ) _FileReadToArray($file,$return) FileClose($file) msg("",$return[28]) msg("",$return[29]) EndFunc func xml_test2() Local $file = @ScriptDir & "\test.xml" Local $oXML = ObjCreate("Microsoft.XMLDOM") ;~ $oXML.load("D:\___BUILDS___\___SRMT___\test.xml") $oXML.load($file) $oOther= $oXML.SelectSingleNode("//Configuration/Categories/Category/SubCategories/SubCategory/Settings/Setting") ; or //other ConsoleWrite("$oOther.text=[" & $oOther.text & "]" & @CRLF) EndFunc i know it is not enough what I'm trying to do but I'm realy stuk in what to do next. I've searched in the XML.udf but could not find in the examples what to do what i want to do. The things what i found are about <settings>false</settings> writing style of XML and not the way I've the XML. (or I'm reading it wrong) Is there somebody who can help me on mine way or has a good example script? Thanks in advanced
  5. I have been using the XML UDF successfully for sometime. I am now tring to add in error handling for some bad XML files I run into. $oXmlDoc = _XML_CreateDOMDocument(Default) _XML_Load($oXmlDoc,$sFileXML) ;<== ENTER XML FILE PATH HERE If @error Then ; ConsoleWrite(StringFormat("_XML_load error - @error = %s", @error) & @CRLF) ; ConsoleWrite("-" & $sFileXML & @CRLF) Exit -1 EndIf ConsoleWrite("-" & $sFileXML & @CRLF) ;If no specified nodes exist, log error and exit If Not _XML_NodeExists($oXmlDoc, "//Property") Then ; ConsoleWrite("No specified nodes exist" & @CRLF) Exit -1 EndIf ;Get number of Property nodes $oProperties = _XML_SelectNodes($oXmlDoc,"//Property/Data") $iNodeCount = @extended $oParents = $oXmlDoc.SelectSingleNode("//Property[@Name='Parents']/Data") There are no error upto this point. The XML file I am trying to handle has a Data node but when I try to $sParam = StringSplit($oParents.text, ";") I get a fatal error (requested action on object failed). How can I test for the problem before I try to do the string split? I tried using @error, and testing $oParents but no luck. Appreciate any tips.
  6. I was searching the forum too find a way to read XML files. There are many options (also very old options), but my question is which is the best for now and which is the best for my problem? I have a XML file like this: <Data> <Values> <Info>Information value 1</Info> <Info>Information value 2</Info> </Values> <Other>Other information</Other> </Data>What I want to have is a function where you can basically call the function 'getValue' or 'getValues' with the path to the value(s) e.g. getValue('Data\Other')or getValues('Data\Values\Info')What is the best solution for me? Hope someone can help me out. Regards, lrstndm
  7. Skeletor

    XML

    Hi All, This is purely an XML Language question. I need to understand how I can add a value/element in between another XML element. Code below shows the XML file. The info tag has the elements already inserted. <Configuration xmlns="http://schemas.datacontract.org/2004/07/Modules.Reporting.DataContracts.LineItems" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <GenConf> <Info>ID, Site, Name , Site_ID</Info> </GenConf> </Configuration> Now, I want to add a value from a node group into this code. Something like below. But the example below does not work. Any suggestions? <Configuration xmlns="http://schemas.datacontract.org/2004/07/Modules.Reporting.DataContracts.LineItems" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <GenConf> <Info>ID, Site, a/@id, Name , Site_ID</Info> </GenConf> </Configuration> <ProductName> <a id="Windows Server"/> </ProductName>
  8. I am trying to read an XML file that looks like the following. I am particularly interested in the ParameterNames and ParameterValues I was able to read a simplier XML file using $oXML.load("DataForwardSettings.xml") Local $oInfos = $oXML.selectnodes("//Database") ; or //Info or //Data//Info or //Values/Info but have not been able to read <?xml version="1.0"?> <Entities> <Entity RecordType="TrendData"> <Property Name="AlarmLimitsSetNumber" IsReadOnly="False" ValueType="System.Int32">8</Property> <Property Name="AnalysisParamaterSetNumber" IsReadOnly="False" ValueType="System.Int32">8</Property> <Property Name="ParameterNames" IsReadOnly="True" IsList="True" ListType="List<string>" ValueType="Array" ArrayType="System.String" Count="12">System.Collections.Generic.List`1[System.String]<Data>OVERALL|PK-PK WAVEFORM|HFD|CREST FACTOR|SYNC 1-6|1X|2X|3X-4X|FTF|BSF|BPFO|BPFI</Data></Property> <Property Name="ParameterValues" IsReadOnly="True" IsList="True" ListType="List<float>" ValueType="Array" ArrayType="System.Single" Count="12">System.Collections.Generic.List`1[System.Single]<Data>0.04706,0.27951,0.02640,4.85608,0.03494,0.01727,0.02256,0.01993,0.00207,0.00060,0.00178,0.00221</Data></Property> <Property Name="NumberOfParameters" IsReadOnly="False" ValueType="System.Int32">12</Property> <Property Name="ModifiedSinceLastDataDump" IsReadOnly="False" ValueType="System.Boolean">False</Property> <Property Name="Load" IsReadOnly="False" ValueType="System.Single">0</Property> <Property Name="RPM" IsReadOnly="False" ValueType="System.Single">140.962</Property> <Property Name="Value" IsReadOnly="False" ValueType="System.Single">-1.1E-20</Property> <Property Name="SampleID" IsReadOnly="False" ValueType="System.Int32">-626794</Property> <Property Name="Timestamp_as_String" IsReadOnly="True" ValueType="System.String">8/18/2018 2:05:33 PM</Property> <Property Name="Timestamp_as_UInt" IsReadOnly="False" ValueType="System.UInt32">1534619133</Property> <Property Name="Timestamp" IsReadOnly="False" ValueType="System.DateTime">8/18/2018 2:05:33 PM</Property> <Property Name="StorageFlag" IsReadOnly="False" ValueType="Enum" EnumType="Emerson.CSI.DataImport.MHM.TrendDataStorageType" EnumValue="2">RPM_And_Overall</Property> <Property Name="Parents" IsReadOnly="False" IsList="True" ListType="List<string>" ValueType="Array" ArrayType="System.String" Count="5">System.Collections.Generic.List`1[System.String]<Data>Database=phmhmdb4ts;C:\RBMdbsrv\CustData\4ts_online_1807.rbm;-99|Area=4TS;-494|Equipment=4THTS;-712|MeasurementPoint=D39;-780|DataCollectionSet=Normal Collection Dryer Rolls;-783</Data></Property> </Entity> </Entities> I tried switching to the XML UDF but was alittle lost in how to use it. I am particularly interested in the ParameterNames and ParameterValues.
  9. I want to generating a XML file (test.xml) like as follow: <?xml version="1.0" encoding="GBK"?> <!DOCTYPE SCHEMA SYSTEM "HGWSPZJK.dtd"> ;I can not generate this line <SCHEMA CRC="HGWSPZ201808_9131011571786229XM_CRC.XML" SSSQ="201808" CHSNAME="HGWSDKQD" NAME="HGWSPZ"> <TAXPAYER CJRMC="sigmagroup" CJRDM="9131011571786229XM" CJLX="DKZK" RECORDCOUNT="411" SBRQ="2018-08-31" NSRMC="sigmagroup" SWSBH="9131011571786229XM"> <Records> <Record BZ="" JKKADM="2244" JKKAMC="shanghai" SE="5907.82" TFRQ="2018-08-23" FPHM="224420181000752586-L02"/> <Record BZ="" JKKADM="2244" JKKAMC="shanghai" SE="4742.4" TFRQ="2018-08-21" FPHM="224420181000743016-L01"/> <Record BZ="" JKKADM="2244" JKKAMC="shanghai" SE="18720" TFRQ="2018-08-14" FPHM="224420181000719215-L01"/> </Records> </TAXPAYER> </SCHEMA> I use XML.UDF Local $oXMLile=_XML_CreateFile(@ScriptDir&"\test.xml","",True) but there is no function CreateDocumentType It is no effort even I test use Local $doct=$oXMLfile.CreateDocumentType("SCHEMA", null, "HGWSPZJK.dtd", null) $oXmlfile.appendChild($doct) pls help me thanks.
  10. try it for make flyers old games xml + Gdi, i belive many sources had lost AIT-ADRLIST.au3
  11. Hello guys, This XML things are driving me crazy... Please let me know how can I use the _XMLGetAttrib function... I've tried every possible way that I've read on the forum and I cannot succeed reading an attribute. The XML looks like bellow: <?xml version="1.0" encoding="UTF-8"?> <BATCH attr1= "aaa" attr2="bbb" attr3="ccc"> <Node1 attr1="aaa" attr2="bbb" attr3="ccc" attr4="ddd" attr5="" attr6="eee" attr7="fff" attr8="ggg"/> <Node2 attr1="aaa" attr2="" attr3="" attr4="ddd"/> <Node3 attr1="" attr2="" attr3="ccc" attr4="" attr5="" attr6="eee"/> <Panel attr1="aaa" STATUS="BBB" attr3="ccc" attr4="ddd" attr5="" attr6="eee"> <Node5 attr1="aaa" attr2="bbb" attr3="ccc" attr4="ddd" attr5="" attr6="eee" attr7="fff" attr8="ggg"/> ............................................................................................................................................................................. </Panel> </Batch> I need to read the value of STATUS form the Panel node. Could you please help me? Best regards, Cococnb
  12. (GOOGLE TRANSLATOR) Sorry: / Sorry, there is no new difficulty to organize my reading system, I need an XLM file like that, which is the problem with 30 thousand lines, is this, I need to find the value "Difficulty" and "live" and tell the program what's with the "default =" yes "" not <dipvalue>, can anyone have an example of how I wanted to do this? An example is enough to do this. example.au3 #include <Array.au3> #include "XML.au3" _Example() Func _Example() Local $oXML = _XML_CreateDOMDocument(Default) Local $sXML_Content =@ScriptDir & "\file.xml" _XML_Load($oXML, $sXML_Content) ; ~ _XML_LoadXML($oXML, $sXML) Local $iNodeCount = _XML_GetNodesCount($oXML, "/mame/game") ConsoleWrite("Group(s): $iNodeCount = " & $iNodeCount & "; @error = " & @error & "; @extended = " & @extended & @LF) Local $aNames = _XML_GetValue($oXML, "/mame/game/description") Local $aTaxCountries = _XML_GetValue($oXML, "/mame/game/manufacturer") Local $aData[$iNodeCount + 1][4] = [[$iNodeCount, "", ""]] For $n = 1 To $iNodeCount Local $oNode_Selected_SingleOne = _XML_SelectSingleNode($oXML, '/mame/game/dipswitch[' & $n & ']') Local $sAttribute_Value = _XML_GetNodeAttributeValue($oNode_Selected_SingleOne, 'name') Local $oNode_Selected_SingleOne2 = _XML_SelectSingleNode($oXML, '/mame/game/dipswitch/dipvalue[' & $n & ']') Local $sAttribute_Value2 = _XML_GetNodeAttributeValue($oNode_Selected_SingleOne2, 'name') $aData[$n][0] = $aNames[$n] $aData[$n][1] = $aTaxCountries[$n] $aData[$n][2] = $sAttribute_Value $aData[$n][3] = $sAttribute_Value2 Next _ArrayDisplay($aData, "$aData") EndFunc ;==>_Example file.xml <mame build="0.124a BRarcade(Mar 31 2008)" debug="no"> <game name="puckman" sourcefile="pacman.c"> <description>PuckMan (Japan set 1, Probably Bootleg)</description> <dipswitch name="Service Mode"> <dipvalue name="Off" default="yes"/> <dipvalue name="On"/> </dipswitch> <dipswitch name="Cabinet"> <dipvalue name="Upright" default="yes"/> <dipvalue name="Cocktail"/> </dipswitch> <dipswitch name="Coinage"> <dipvalue name="2 Coins/1 Credit"/> <dipvalue name="1 Coin/1 Credit" default="yes"/> <dipvalue name="1 Coin/2 Credits"/> <dipvalue name="Free Play"/> </dipswitch> <dipswitch name="Lives"> <dipvalue name="1"/> <dipvalue name="2"/> <dipvalue name="3" default="yes"/> <dipvalue name="5"/> </dipswitch> <dipswitch name="Bonus Life"> <dipvalue name="10000" default="yes"/> <dipvalue name="15000"/> <dipvalue name="20000"/> <dipvalue name="None"/> </dipswitch> <dipswitch name="Difficulty"> <dipvalue name="Normal" default="yes"/> <dipvalue name="Hard"/> </dipswitch> </game> <game name="puckmana" sourcefile="pacman.c" cloneof="puckman" romof="puckman"> <description>PuckMan (Japan set 2)</description> <dipswitch name="Rack Test (Cheat)"> <dipvalue name="Off" default="yes"/> <dipvalue name="On"/> </dipswitch> <dipswitch name="Service Mode"> <dipvalue name="Off" default="yes"/> <dipvalue name="On"/> </dipswitch> <dipswitch name="Cabinet"> <dipvalue name="Upright" default="yes"/> <dipvalue name="Cocktail"/> </dipswitch> <dipswitch name="Coinage"> <dipvalue name="2 Coins/1 Credit"/> <dipvalue name="1 Coin/1 Credit" default="yes"/> <dipvalue name="1 Coin/2 Credits"/> <dipvalue name="Free Play"/> </dipswitch> <dipswitch name="Lives"> <dipvalue name="1"/> <dipvalue name="2"/> <dipvalue name="3" default="yes"/> <dipvalue name="5"/> </dipswitch> <dipswitch name="Difficulty"> <dipvalue name="Normal" default="yes"/> <dipvalue name="Hard"/> </dipswitch> </game> <game name="puckmanf" sourcefile="pacman.c" cloneof="puckman" romof="puckman"> <dipswitch name="Cabinet"> <dipvalue name="Upright" default="yes"/> <dipvalue name="Cocktail"/> </dipswitch> <dipswitch name="Lives"> <dipvalue name="1"/> <dipvalue name="2"/> <dipvalue name="3" default="yes"/> <dipvalue name="5"/> </dipswitch> <dipswitch name="Difficulty"> <dipvalue name="Normal" default="yes"/> <dipvalue name="Hard"/> </dipswitch> <dipswitch name="Ghost Names"> <dipvalue name="Normal" default="yes"/> <dipvalue name="Alternate"/> </dipswitch> </game> <game name="puckmanh" sourcefile="pacman.c" cloneof="puckman" romof="puckman"> <dipswitch name="Coinage"> <dipvalue name="2 Coins/1 Credit"/> <dipvalue name="1 Coin/1 Credit" default="yes"/> <dipvalue name="1 Coin/2 Credits"/> <dipvalue name="Free Play"/> </dipswitch> <dipswitch name="Lives"> <dipvalue name="1"/> <dipvalue name="2"/> <dipvalue name="3" default="yes"/> <dipvalue name="5"/> </dipswitch> <dipswitch name="Bonus Life"> <dipvalue name="10000" default="yes"/> <dipvalue name="15000"/> <dipvalue name="20000"/> <dipvalue name="None"/> </dipswitch> <dipswitch name="Difficulty"> <dipvalue name="Normal" default="yes"/> <dipvalue name="Hard"/> </dipswitch> </game> <game name="pacman" sourcefile="pacman.c" cloneof="puckman" romof="puckman"> <dipswitch name="Cabinet"> <dipvalue name="Upright" default="yes"/> <dipvalue name="Cocktail"/> </dipswitch> <dipswitch name="Coinage"> <dipvalue name="2 Coins/1 Credit"/> <dipvalue name="1 Coin/1 Credit" default="yes"/> <dipvalue name="1 Coin/2 Credits"/> <dipvalue name="Free Play"/> </dipswitch> <dipswitch name="Lives"> <dipvalue name="1"/> <dipvalue name="2"/> <dipvalue name="3" default="yes"/> <dipvalue name="5"/> </dipswitch> <dipswitch name="Bonus Life"> <dipvalue name="10000" default="yes"/> <dipvalue name="15000"/> <dipvalue name="20000"/> <dipvalue name="None"/> </dipswitch> </game> <game name="pacmanf" sourcefile="pacman.c" cloneof="puckman" romof="puckman"> <dipswitch name="Coinage"> <dipvalue name="2 Coins/1 Credit"/> <dipvalue name="1 Coin/1 Credit" default="yes"/> <dipvalue name="1 Coin/2 Credits"/> <dipvalue name="Free Play"/> </dipswitch> <dipswitch name="Lives"> <dipvalue name="1"/> <dipvalue name="2"/> <dipvalue name="3" default="yes"/> <dipvalue name="5"/> </dipswitch> <dipswitch name="Bonus Life"> <dipvalue name="10000" default="yes"/> <dipvalue name="15000"/> <dipvalue name="20000"/> <dipvalue name="None"/> </dipswitch> <dipswitch name="Difficulty"> <dipvalue name="Normal" default="yes"/> <dipvalue name="Hard"/> </dipswitch> <dipswitch name="Ghost Names"> <dipvalue name="Normal" default="yes"/> <dipvalue name="Alternate"/> </dipswitch> <driver status="good" emulation="good" color="good" sound="good" graphic="good" savestate="supported" palettesize="512"/> </game> </mame>
  13. Can anyone assist with creating/modify/delete XML Nodes/Child Nodes? Have a document for example: <ConfigData> <parameter> <name>Setting One</name> <value>10</value> </parameter> <parameter> <name>IPAddress</name> <value>192.168.1.1</value> </parameter> <parameter> <name>Setting One</name> <value>200</value> </parameter> <parameter> <name>Setting Three</name> <value>300</value> </parameter> </ConfigData> Would like to add another node parameter/name, parameter/value, but unsure how to, when there are multiple instances with the same tagname for example, would like to add the following if the nodes do not already exist: <parameter> <name>UserPreferredLanguage</name> <value>English</value> </parameter> Currently using the following to check and delete/modify existing nodes, was thinking of placing the name and value into a 2d array and then using a true/false in a 3rd column to return if the setting was found and modified or not, so I can decide whether I need to create the nodes or not, but I'm hoping there is a simpler way.\ Any assistance would be much appreciated. PS: Have also written this with the XML Dom Wrapper UDF but still unsure how to proceed with checking nodes and creating them if they're missing, also couldn't find a function to delete a full node + parent using selectNodes, hence the custom __XML_DeleteNode function. Thanks Local $sXMLDocPath = @ScriptDir & "\XMLDoc.xml" Local $oXMLDoc = ObjCreate("MSXML2.DOMDocument") $oXMLDoc.validateOnParse = False $oXMLDoc.load($sXMLDocPath) Local $oXMLNodes = $oXMLDoc.selectNodes("ConfigData/parameter") If IsObj($oXMLNodes) Then For $oXMLNode In $oXMLNodes If $oXMLNode.childNodes.item(0).tagName = "Name" And $oXMLNode.childNodes.item(0).Text = "Setting One" Then If $oXMLNode.childNodes.item(1).tagName = "Value" Then $oXMLNode.childNodes.item(1).Text = 10 EndIf If $oXMLNode.childNodes.item(0).tagName = "Name" And $oXMLNode.childNodes.item(0).Text = "IPAddress" Then __XML_DeleteNode($oXMLNode) EndIf If $oXMLNode.childNodes.item(0).tagName = "Name" And $oXMLNode.childNodes.item(0).Text = "Setting Two" Then If $oXMLNode.childNodes.item(1).tagName = "Value" Then $oXMLNode.childNodes.item(1).Text = 20 EndIf If $oXMLNode.childNodes.item(0).tagName = "Name" And $oXMLNode.childNodes.item(0).Text = "Setting Three" Then If $oXMLNode.childNodes.item(1).tagName = "Value" Then $oXMLNode.childNodes.item(1).Text = 30 EndIf Next EndIf $oXMLDoc.Save ($sXMLDocPath) Func __XML_DeleteNode($_oNode_Enum) If $_oNode_Enum.hasChildNodes Then For $_oNode_Enum_Child In $_oNode_Enum.childNodes If $_oNode_Enum_Child.nodeType = $XML_NODE_TEXT Then If StringStripWS($_oNode_Enum_Child.text, $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES) = "" Then $_oNode_Enum.removeChild($_oNode_Enum_Child) EndIf EndIf Next EndIf $_oNode_Enum.parentNode.removeChild($_oNode_Enum) EndFunc
  14. Hi. I'm trying to write a xml. Here is my code: #include <_XMLDomWrapper.au3> #include <Date.au3> Global $g_sXMLFileName Global $g_sDestPath = @DesktopDir & "\" Global $g_sReturnedBID = "A10829" _makeXML() _AddXML(1, "A10829_Thomas/wav/T001.wav") _AddXML(2, "A10829_Thomas/wav/T002.wav") Exit Func _makeXML() Local $sXMLtime = StringReplace(StringReplace(StringReplace(_NowCalc()," ","_"),":","-"),"/","-") ; in yyyy-mm-dd_hh-mm-ss $g_sXMLFileName = $g_sDestPath & $g_sReturnedBID & "_" & "EB-Ton-Upload" & "_" & $sXMLtime & ".xml" _XMLCreateFile($g_sXMLFileName, "gemagvl", 1,1) _XMLFileOpen($g_sXMLFileName) EndFunc Func _AddXML($iCount, $sDateiname) _XMLCreateRootNodeWAttr("row", "count", $iCount, "") _XMLCreateChildNode("//row", "picklistenname", $g_sReturnedBID & "_EB-Ton-Upload") _XMLCreateChildNode("//row", "picklisteninfo") _XMLCreateChildNode("//row", "bid", $g_sReturnedBID) _XMLCreateChildNode("//row", "audiodateiname", $sDateiname) _XMLCreateChildNode("//row", "titel", StringTrimRight(StringTrimLeft($sDateiname, 7), 4)) _XMLCreateChildNode("//row", "interpret", "EB") _XMLCreateChildNode("//row", "quelle", "Ton") EndFunc It returns: <?xml version="1.0" encoding="UTF-8"?><gemagvl> <row count="1"> <picklistenname>A10829_EB-Ton-Upload</picklistenname> <picklisteninfo/> <bid>A10829</bid> <audiodateiname>A10829_Thomas/wav/T001.wav</audiodateiname> <titel>Thomas/wav/T002</titel> <interpret>EB</interpret> <quelle>Ton</quelle> <picklistenname>A10829_EB-Ton-Upload</picklistenname> <picklisteninfo/> <bid>A10829</bid> <audiodateiname>A10829_Thomas/wav/T002.wav</audiodateiname> <titel>Thomas/wav/T003</titel> <interpret>EB</interpret> <quelle>Ton</quelle> </row> <row count="2"> <picklistenname>A10829_EB-Ton-Upload</picklistenname> <picklisteninfo/> <bid>A10829</bid> <audiodateiname>A10829_Thomas/wav/T002.wav</audiodateiname> <titel>Thomas/wav/T003</titel> <interpret>EB</interpret> <quelle>Ton</quelle> </row> </gemagvl> But it should return: <?xml version="1.0" encoding="UTF-8"?><gemagvl> <row count="1"> <picklistenname>A10829_EB-Ton-Upload</picklistenname> <picklisteninfo/> <bid>A10829</bid> <audiodateiname>A10829_Thomas/wav/T001.wav</audiodateiname> <titel>Thomas/wav/T002</titel> <interpret>EB</interpret> <quelle>Ton</quelle> </row> <row count="2"> <picklistenname>A10829_EB-Ton-Upload</picklistenname> <picklisteninfo/> <bid>A10829</bid> <audiodateiname>A10829_Thomas/wav/T002.wav</audiodateiname> <titel>Thomas/wav/T003</titel> <interpret>EB</interpret> <quelle>Ton</quelle> </row> </gemagvl> The second inserted nodes are double. How will it be going right? Regards, Conrad
  15. I need help to read in a loop the DVD id child and subchild. Thx Example... DVD001 - PAL - EN,FR,DE,ES,IT and filter the right title & descri language. I tried with $oXML.SelectSingleNode but without success <?xml version="1.0" encoding="UTF-8"?> <datafile xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mydvd.xsd"> <dvd name="My dvd title"> <id>DVD001</id> <region>PAL</region> <languages>EN,FR,DE,ES,IT</languages> <locale lang="EN"> <title>title en</title> <descri>descri en</descri> </locale> <locale lang="FR"> <title>title fr</title> <descri>descri fr </descri> </locale> <locale lang="DE"> <title>title de</title> <descri>descri de </descri> </locale> <locale lang="ES"> <title>title es</title> <descri>descri es</descri> </locale> <locale lang="IT"> <title>title it</title> <descri>descri it</descri> </locale> </dvd> <dvd name="My dvd title 2"> <id>DVD002</id> <region>USA</region> <languages>EN</languages> <locale lang="EN"> <title>title en</title> <descri>descri en</descri> </locale> </dvd> </datafile> #include <File.au3> $xml = @ScriptDir&"\test.xml" Local $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.load($xml) $id = $oXML.SelectNodes("//dvd") For $ids In $id ConsoleWrite($ids.text &@CRLF) Next
  16. Version 1.1.1.13

    7,138 downloads

    I was asking @eltorro serveral times for any support for XML DOM wrapper (COM) - with no success So I took matters into my hands ..... I want to present _XMLDomWrapperEx.au3 - BETA Version Want to join to the project ? Here is some description: ; #INDEX# ======================================================================================================================= ; Title .........: _XMLDomWrapperEx.au3 ; AutoIt Version : 3.3.10.2++ ; Language ......: English ; Description ...: Functions to use for reading and writing XML using msxml. ; Remarks .......: BETA Version ; Author ........: mLipok ; Version .......: "1.1.1.01" ; _XML_MiscProperty_UDFVersion() #CS This UDF is created on the basis of: https://www.autoitscript.com/forum/topic/19848-xml-dom-wrapper-com/ For this reason, I attach also the last known (to me) previous version ($_XMLUDFVER = "1.0.3.98" _XMLDomWrapper_1.0.3.98_CN.au3 ) For the same reason I continue to recognize the achievements of the work of my predecessors (they are still noted in each Function header). . . . . !!!!!!!!! This is BETA VERSION (all could be changed) !!!!!!!!! . . . WORK IN PROGRES INFORMATION: For now 2015-09-01 the descripion (Function Header) can not entirely correctly describe the function. TODO: in many places I used "TODO" as a keyword to find what should be done in future . I want to: PREVENT THIS: The unfortunate nature of both the scripts is that the func return results are strings or arrays instead of objects. .     I want to: USE THIS CONCEPT:     .   All function should use Refernce to the object as first Function parameter     .   All function should return in most cases objects. There should be separate functions to Change Object collection to array     .   All function should use COM Error Handler in local scope.     .   All function should return @error which are defined in #Region _XMLDomWrapperEx.au3 - @ERROR Enums     .    All function should have the same naming convention     .    All variables should have the same naming convention     .    There should not to be any Global Variable - exception is $g__oXMLDOM_Events     .   It should be possible easy to use XML DOM Events     .        https://msdn.microsoft.com/en-us/library/ms764697(v=vs.85).aspx     .   It should be possible easy to Debug     .    Ultimately, you should be able to do anything with your XML without having to use your own Error Handler. #CE More info inside zip archive. Here is the support topic:
  17. Hi Guys, Since I'm able to get a Dell equipment warranty status thanks to my API key, I'm using an UDF to extract data from an XML file and get the end date. > Thing is, when using InetGet, the original file is in JSON format and the UDF is not working anymore, even if I download the file with the xml extension. Therefore, and when I manually download the page with Chrome, I have a proper XML file where the UDF is working fine. Here's my code: I even tried to convert the json to xml > https://www.autoitscript.com/forum/topic/185717-js-json-to-xml/ I took a look here https://www.autoitscript.com/forum/topic/104150-json-udf-library-fully-rfc4627-compliant/ but I don't understand anything :/ The XML read UDF is just perfect for my needs but I'm stuck here... Thanks for any help you can provide -31290- 3MTXM12.json 3MTXM12.xml
  18. Alright, this is going to be a rather long explanation so bear with me. What I am trying to to is build a GUI program that, in the end, will look like this: The middle Frame is for displaying a desktop icon and the right frame is for displaying a selected image. The XML file I am using looks like this: <list> <item id="1"> <ico>Path\to\icon1<\ico> <img>Path\to\image1<\img> <exe>Path\to\program1<\exe> <label>UserDefinedLabel1<\label> <\item> <item id="2"> <ico>Path\to\icon2<\ico> <img>Path\to\image2<\img> <exe>Path\to\program2<\exe> <label>UserDefinedLabel2<\label> <\item> <\list> What I want this program to do is when I highlight an item in the listbox (which btw is displaying the <label> value associated with the item) I want the displayed icon and image to change to the ones associated with that entry. Also I would like to include an additional dialog to open when the 'ADD' button is clicked that will add entries to the XML file that looks like this: The main problem I am running into is that I do not know much about XML and how to parse it into dynamic variables that can change based off of selection. Any help is appreciated. 10-29-16 EDIT: For all intents and purposes, I basically want to create something similar to PStart, but with a preview pane with a customizable image for each item in it.
  19. Any internal xml API to parse and edit XML files in AutoIT?
  20. This is a Wrapper for Pugixml, made with C++ by me and uses the version 1.2. Description pugixml is a light-weight C++ XML processing library. It consists of a DOM-like interface with rich traversal/modification capabilities, an extremely fast XML parser which constructs the DOM tree from an XML file/buffer. pugixml enables very fast, convenient and memory-efficient XML document processing. However, since pugixml has a DOM parser, it can't process XML documents that do not fit in memory; also the parser is a non-validating one, so if you need DTD or XML Schema validation, the library is not for you. License The Xml parser(Pugixml) is distributed under the MIT license: This means that you can freely use pugixml in your applications, both open-source and proprietary. Features Load/save XML files to an in-memory document object model (DOM).Add name/value attribtes to nodes.Numerous methods for iterating over the nodes in a document.Built in XPath.Full Unicode support.MsXml Independent.Has about 47 Functions.Works on: Microsoft Windows 2000, XP, Server 2003, Vista, 7, Server 2008. 32 bit ____________________________________________________________________________________________ Not supported any more due the fact that I had a hard drive failure therefore lost the source code of the DLL. ____________________________________________________________________________________________ Download Link AXml.zip Note: I have also included a 64bit DLL but as I don't have a 64bit computer it remains untested.
  21. Today I was working on some Webservices UDF. As a result I get this kind of data: I was searching here: http://www.htmlhelp.com/reference/html40/entities/special.html http://www.html-entities.org/ http://www.w3schools.com/html/html_entities.asp But finally I made this: #include <IE.au3> _Example() Func _Example() Local $sHTML = _ '&lt;root&gt;&#xD;&lt;Data&gt;&#xD;&lt;Type&gt;F&lt;/Type&gt;&#xD;&lt;/Data&gt;&#xD;&lt;/root&gt;' MsgBox(0, 'TEST', _HTML_DecodeEntities($sHTML)) EndFunc ;==>_Example Func _HTML_DecodeEntities(ByRef $sHTML) $sHTML = StringReplace($sHTML,'&#xD;','<hr>') Local $oIE = _IECreate("about:blank", 0, 0, 1, 0) _IEDocWriteHTML($oIE, $sHTML) Local $sResult = _IEBodyReadText($oIE) _IEQuit($oIE) Return $sResult EndFunc ;==>_HTML_DecodeEntities Regards, mLipok
  22. What i am trying to do is compare date of destination and source, and if source file is newer than destination it copies the file to source. Just posting a sample code of what i am trying to achieve #include <Date.au3> ; Include Date constants #include <File.au3> #include <iNet.au3> #include <_XMLDomWrapper.au3> Global $xml1, $xml1monthday, $xml1year, $xml1format, $xml2, $xml2monthday, $xml2year, $xml2format, $xmldate ; Runs the XmlDate() function to determine the age of the Xml file ;===================================================================== XmlDate() Func XmlDate() $Xml1 = RegRead("C:\Temp\m1.xml","XmlDate") ; pulls registry $xml1monthday = StringTrimRight($xml1, 5) ; takes the month $xml1year = StringTrimLeft($xml1, 6) ; takes the year out $xml1format = ($xml1monthday & "/" & $xml1year) ; reorders the date $Xml2 = RegRead("C:\Temp\m2.xml","XmlDate") ; pulls registry $xml2monthday = StringTrimRight($xml2, 5) ; takes the month and $xml2year = StringTrimLeft($xml2, 6) ; takes the year out $xml2format = ($xml2monthday & "/" & $xml2year) ; reorders if $Xml1 = "" And $Xml2 = "" Then FileCopy( "C:\temp\a1.txt", "C:\temp\anokh", 1); Else FileDelete("c:\temp\a1/txt") EndIf EndFunc Any comments will be appreciated Thank you
  23. Update : Version 1.0.0.1 Optimized whole code, added redim step var. Hi, I had to create Excel files for my needs, but I wondered how to do it because xlsx files are not raw editable; so I searched for a way do it. Excel can open multiple files type, and the XML is a good way to do it so here it is. It creates an Excel XML file, with which you will be able to : -Create Rows -Create Cells and set it's color -Set column width -Set global text horizontal align -Set XML author -Set XML creation date -Set XML compagny And of course you can easily add features. Here is an example : #include "Excel_XML.au3" $iRow = _ExcelXML_Row_Add() _ExcelXML_Column_SetWidth(1, 100) _ExcelXML_Cell_Add($iRow, "Row 1, Cell 1") _ExcelXML_Column_SetWidth(2, 200) _ExcelXML_Cell_Add($iRow, "Column width set to 200px") $iRow = _ExcelXML_Row_Add() $iCell = _ExcelXML_Cell_Add($iRow, "Cell color red") _ExcelXML_Cell_SetColor($iCell, 0xFF0000) _ExcelXML_Cell_Add($iRow, "Excel XML UDF") $hFile = FileOpen(@ScriptDir & "\Excel_XML test.xml", 2) FileWrite($hFile, _ExcelXML_Assemble()) FileClose($hFile) _ExcelXML_Destroy() And what you are waiting for : Excel_XML.au3 (Previous : 53 downloads) Enjoy !
  24. I have created an app that allows me to save server names as field values and other information associated with their nodes. (example below) <Servers> <ServerInfo> <Server_Name>MyServerName</Server_Name> <User>user_name</User> <Password>0x8534C1E508D4CF29AC17</Password> </ServerInfo> </Servers I am trying to use "_XMLNodeExists" from "_XMLDOMWrapper.au3" to search for existing server entries by field value. (Sorry if my XML terms are not quite right) I didn't quite follow how to search and I am not sure if this function can perform how I expect it to... My attempt _XMLNodeExists('//Servers/ServerInfo/Server_Name/MyServerName')Any suggestions how I might go about searching my XML file? I had thought of just searching as plain text.
  25. I'm trying to use Sendspace API for download and upload, until now i only have learned to get token, login and get session key. My next step is upload a file. But i have no idea how to do this part. ; try to upload something ; Specify the reguest to upload.getInfo: Local $hRequest = _WinHttpOpenRequest($hConnect, Default, "/rest/?method=upload.getinfo&session_key=" & $SessonKey & "&speed_limit=0") ; Send request Local $handle = _WinHttpSendRequest($hRequest) ; Wait for the response Local $WaitRS = _WinHttpReceiveResponse($hRequest) ; Read Data Local $sData = _WinHttpReadData($hRequest) MsgBox(0, "Upload Data", $sData) _filewrite($sData) ; Get all info needed from $sData $URL = _StringBetween($sData, "<upload url=", "progress") $sURL = $URL[0] $MaxFileSize = _StringBetween($sData, "max_file_size=", "progress") $sMaxFileSize = $MaxFileSize[0] $Upload_Identifier = _StringBetween($sData, "upload_identifier=", "&amp") $sUpload_Identifier = $Upload_Identifier[0] $ExtraInfo = _StringBetween($sData, "extra_info=", "/>") $sExtraInfo = $ExtraInfo[0] ;All well done until here ;Fill in form $XML = '<form method="post" action="' & $sURL & 'enctype="multipart/form-data">' & @CRLF $XML &= '<input type="hidden" name="MAX_FILE_SIZE" value=' & $sMaxFileSize & '>' & @CRLF $XML &= '<input type="hidden" name="UPLOAD_IDENTIFIER" value=' & $sUpload_Identifier & '>' & @CRLF $XML &= '<input type="hidden" name="extra_info" value=' & $sExtraInfo & '>' & @CRLF $XML &= '<input type="file" name=' & "C:\Users\Arlen\Desktop\premisa mrotal.txt" & '>' & @CRLF $XML &= '</form>' MsgBox(0,"", $XML) ; Now how do i send it? Is it correct? _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) sendspace_api_guide.pdf
×
×
  • Create New...