GrungeRocker Posted June 22, 2009 Posted June 22, 2009 The XML-File looks like this: <DreamSys><Tiff2PDF><Section name="1"><Tiff file="C:\Programme\ELOoffice\Postbox\Administrator\U_19143202_0000001.TIF"/><Tiff file="C:\Programme\ELOoffice\Postbox\Administrator\U_19143202_0000002.TIF"/></Section></Tiff2PDF></DreamSys> Could anyone please help me? I tried it in a hundred of different ways, but I just don't get it to work. [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]
weaponx Posted June 22, 2009 Posted June 22, 2009 The XML-File looks like this: <DreamSys><Tiff2PDF><Section name="1"><Tiff file="C:\Programme\ELOoffice\Postbox\Administrator\U_19143202_0000001.TIF"/><Tiff file="C:\Programme\ELOoffice\Postbox\Administrator\U_19143202_0000002.TIF"/></Section></Tiff2PDF></DreamSys> Could anyone please help me? I tried it in a hundred of different ways, but I just don't get it to work. This format is correct, it's just not indented properly.
WeMartiansAreFriendly Posted June 22, 2009 Posted June 22, 2009 Will this ever get added to AutoIt? (UDFs) Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
weaponx Posted June 22, 2009 Posted June 22, 2009 Will this ever get added to AutoIt? (UDFs)I hope so. Pretty much every answer exists in this topic concerning XML, the same general questions keep getting asked over and over.
motionman95 Posted June 23, 2009 Posted June 23, 2009 Hello! I'm using your AWESOME UDF to read an RSS feed. But I have a question: Is there a way to parse CDATA? By default, that cause quotation marks and other punctuation to disappear, replaced by their decimal (I think) equivalent. Is there a possible fix for this? Thanks in advance!
motionman95 Posted June 23, 2009 Posted June 23, 2009 (edited) Sure...here. Edited June 23, 2009 by motionman95
weaponx Posted June 23, 2009 Posted June 23, 2009 No hope, weaponx?Umm well i'm pretty sure they are just html entities but I can't find a COM object / dll that can natively convert them to plain text. PHP and VB have functions that can decode these.
ptrex Posted July 3, 2009 Posted July 3, 2009 @motionman95I am not sure what you are looking for but if you need to get rid off the TAGS in HTML.You need to use the .innerText or .innerHTML property of the DOM object model.See examples here : InnerHTMLInnerTextRegardsptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
NDTC Posted July 9, 2009 Posted July 9, 2009 Hi all,Someone can help me?I nead to update an XML file (the Windows Vista response file: Unattended.xml), but many test is unsucessful.The xml code:expandcollapse popup<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="windowsPE"> <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <DiskConfiguration> <Disk> <CreatePartitions> <CreatePartition wcm:action="add"> <Order>1</Order> <Size>20000</Size> <Type>Primary</Type> </CreatePartition> </CreatePartitions> <ModifyPartitions> <ModifyPartition wcm:action="add"> <Active>true</Active> <Extend>false</Extend> <Format>NTFS</Format> <Label>OS_Install</Label> <Letter>C</Letter> <Order>1</Order> <PartitionID>1</PartitionID> </ModifyPartition> </ModifyPartitions> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> </Disk> <WillShowUI>onerror</WillShowUI> </DiskConfiguration> <UserData> <ProductKey> <Key>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</Key> <WillShowUI>onerror</WillShowUI> </ProductKey> <AcceptEula>true</AcceptEula> </UserData> <ImageInstall> <OSImage> <InstallTo> <DiskID>0</DiskID> <PartitionID>1</PartitionID> </InstallTo> <WillShowUI>onerror</WillShowUI> </OSImage> </ImageInstall> <UpgradeData> <Upgrade>true</Upgrade> </UpgradeData> </component> <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SetupUILanguage> <UILanguage>en-us</UILanguage> </SetupUILanguage> <InputLocale>0409:00000409</InputLocale> <SystemLocale>en-us</SystemLocale> <UILanguage>en-us</UILanguage> <UserLocale>en-US</UserLocale> </component> </settings> <settings pass="oobeSystem"> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <OEMInformation> <Manufacturer><company name></Manufacturer> <Model><computer model></Model> <SupportHours><support hours></SupportHours> <SupportPhone><phone number></SupportPhone> </OEMInformation> </component> </settings> <cpi:offlineImage cpi:source="wim:c:/download/aik/install.wim#Windows Vista ULTIMATE" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> </unattend>I need to update the last "settings" section by adding this line "<ComputerName>MyComputer</ComputerName>" like this:<settings pass="oobeSystem"> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ComputerName>MyComputer</ComputerName> <OEMInformation> <Manufacturer><company name></Manufacturer> <Model><computer model></Model> <SupportHours><support hours></SupportHours> <SupportPhone><phone number></SupportPhone> </OEMInformation> </component> </settings>Thank you for your help,Regards.
kjcdude Posted July 18, 2009 Posted July 18, 2009 Since i can't write a line to a file in autoit easily i'm trying to work xml to be able to find a setting and change it. ----Start---- <?xml version="1.0" encoding="UTF-8"?> <FILE> <INFO Number="155367823"/> <PROFILESET> <PROFILE Label="Medal of Honor: Allied Assault"> <APPLICATION Label="mohaa.exe"/> <APPLICATION Label="moh_breakthrough.exe"/> <APPLICATION Label="moh_breakthrough_demo.exe"/> <APPLICATION Label="moh_spearhead.exe"/> <APPLICATION Label="moh_spearhead_demo.exe"/> <APPLICATION Label="mohaademo.exe"/> <PROPERTY Label="conformant_texture_clamp" Value="0x00000002" Default="0x00000002" Itemtype="predefined"/> <PROPERTY Label="ogl_extension" Value="0x000011A8" Default="0x000011A8" Itemtype="predefined"/> <PROPERTY Label="multichip_rendering_mode" Value="0x00000002" Default="0x00000002" Itemtype="predefined"/> </PROFILE> <PROFILE Label="Medal of Honor: Pacific Assault"> <APPLICATION Label="mohpa.exe"/> <APPLICATION Label="mohpc.exe"/> <PROPERTY Label="multichip_rendering_mode" Value="0x02402201" Default="0x02402201" Itemtype="predefined"/> <PROPERTY Label="dyn_tiling_mode" Value="0x00000002" Default="0x00000002" Itemtype="predefined"/> </PROFILE> ---break--- <PROFILE Label="Base Profile"> <PROPERTY Label="vsync_default" Value="0x08416747" Default="0x60925292"/> </PROFILE> ---break--- <PROFILE Label="UAZ Racing 4x4"> <APPLICATION Label="4x4game.exe.exe"/> <PROPERTY Label="multichip_rendering_mode" Value="0x02402005" Default="0x02402005" Itemtype="predefined"/> </PROFILE> <PROFILE Label="X-Motor Racing"> <APPLICATION Label="xmotorracing.exe"/> <PROPERTY Label="multichip_rendering_mode" Value="0x02400005" Default="0x02400005" Itemtype="predefined"/> </PROFILE> </PROFILESET> </FILE> ---end--- The part that i need to edit is the Value to the Property Label="vsync_default" I've tried to read the property label, but have gotten no where near where i need to be. Thanks
Asvarox Posted August 9, 2009 Posted August 9, 2009 (edited) Can't get it to work correctly. I put this into Include folder and downloaded the example file (with gui controls). It saves the xml file just fine, but it can't read it. _XMLGetValue always returns -1 . I created simple script to test it. Obviously it didn't work: #include <_XMLDomWrapper.au3> $ret = _XMLFileOpen("settings.xml") if $ret =0 then Exit MsgBox(0, "test", _XMLGetValue("root/test/wellness")) and xml: <?xml version="1.0"?> <root> <test> <wellness>100</wellness> </test> </root> Edited August 9, 2009 by Asvarox
notta Posted August 11, 2009 Posted August 11, 2009 Look at the header for _xmlgetvalue. It returns an array. #include <_XMLDomWrapper.au3> #include <array.au3> Dim $new $ret = _XMLFileOpen("test.xml") if $ret =0 then Exit $new = _XMLGetValue("/root/test/wellness") if IsArray($new) Then MsgBox(0,"","Is array") Else MsgBox(0,"","Not an array") EndIf _ArrayDisplay($new)
Asvarox Posted August 11, 2009 Posted August 11, 2009 Thanks for help, it worked! Now I see how awesome this thing is >_<
VAG Posted August 12, 2009 Posted August 12, 2009 (edited) I have this code which is based on your suggested method to generate XML posting with tree layout format. It works great so far on all my projects. However, recently one of my new project requires up to 6000+ no of postings. A performance issue is discovered which lead to scienificant slow down of runtime scripts. After I trace back, the root cause was due to the increment of processing time required by XML writing in each posting. I have used a few _XMLDomWrapper methods in my libray. The timing issue mainly occur when I call _XMLCreateChildWAttr and _XMLCreateRootNodeWAttr. Part of the code:expandcollapse popupFunc _TestLog_Message($s_title, $s_remarks, $s_picture) $ROOT = "tree/" ; Record posting time $result = _Date_Time_GetLocalTime() $s_tCur = _Date_Time_SystemTimeToDateTimeStr($result) ; Define <item> Attribute Names $ATTRIBS_Name = _ArrayCreate("id", "text", "im0", "im1", "im2", "child") ; Define <userdata> attributes and values $s_userdata_name = _ArrayCreate("type", "datetime", "remarks", "picture") $s_userdata_value = _ArrayCreate("message", $s_tCur ,$s_remarks, $s_picture) ; Icon image attributes for <item> posting $s_im0 = "ms0.gif" ;icon for text $s_im1 = "ms1.gif" ;icon for open node $s_im2 = "ms2.gif" ;icon for close node ; Generate id for new posting $s_xid = Number(_XMLGetAttrib("//udf", "xid")) ;read <id> count from <udf id> attribute $s_xid = StringFormat("%05s",$s_xid+1) ; Generate unique "id" attribute from last posting entry ; Processing tree path layout $s_xnode = _XMLGetAttrib("//udf", "xpath") ;Read back xnode from temp <udf xpath> attribute $s_xpath = $s_xnode & $s_xid $SPLITPATH = StringSplit($s_xpath, "/") ;[0]: numbe of elements, [1]: element[1] ; Reset element zero to zero for blank path (null counted as 1?) If $SPLITPATH[1] = "" Then $SPLITPATH[0] = 0 ;indicate no element [0]=0 EndIf ; Generate XPATH formatting for nodes For $X = 1 to $SPLITPATH[0] $SPLITPATH[$X] = StringFormat ( "item[@id='%s']", $SPLITPATH[$X] ) ;format xpath syntax for each node, @text = <item id> Next ; Not valid if path is blank If Not $SPLITPATH[0] = 0 Then ;-------------------------- ; <item> attribute and child element ;-------------------------- ; Generate folders to accomodate items path For $X = 1 to UBound($SPLITPATH) - 1 $XPATH = $ROOT & _ArrayToString($SPLITPATH, "/", 1, $X) ;_ArrayToString = combine path items level by level ; Check if path exists If NOT IsArray(_XMLGetPath ($XPATH)) Then ;_XMLGetPath = return path item into array from node in xpath If $X > 1 Then ; CHILD item $ATTRIBS_Value = _ArrayCreate($s_xid, $s_title, $s_im0, $s_im1, $s_im2, "0") _XMLCreateChildWAttr($ROOT & _ArrayToString($SPLITPATH, "/", 1, $X - 1), "item", $ATTRIBS_Name, $ATTRIBS_Value) ; node is "tree/" + xpath Else ; ROOT item $ATTRIBS_Value = _ArrayCreate($s_xid, $s_title, $s_im0, $s_im1, $s_im2, "0") _XMLCreateRootNodeWAttr("item", $ATTRIBS_Name, $ATTRIBS_Value) ;Root node is "tree/item" EndIf EndIf Next ;-------------------------- ; <userdata> element ;-------------------------- For $X = 0 to UBound($s_userdata_name) - 1 _XMLCreateChildWAttr($XPATH, "userdata", "name", $s_userdata_name[$X], $s_userdata_value[$X]) Next EndIf ; Save UDF variable back to <udf> tag _XMLSetAttrib("//udf", "xid", $s_xid) ; save <id> count back to <udf id> attribute EndFuncExample to call:#include "_CTL_TestLog.au3" $TempXML = @ScriptDir & "\example.xml" _TestLog_Initiate($TempXML) _TestLog_Folder_Open("Test Folder", "", "") For $c=1 To 3000 $begin = TimerInit() _TestLog_Message("Test is a test message", "", "") $dif = TimerDiff($begin) ToolTip("Posting Count " & $c & ", Duration: " & $dif, 400, 400, "Test Log Performance Testing", 1) Sleep(3000) Next _TestLog_Folder_Close()Is there anything wrong with the way I implement the code? Thanks in advance. I have attached the generated XML, I only generated 1 level tree structure. But the increase in delay on every posting can be seen in the data. You can also see the delay when you run my Example.au3<?xml version="1.0"?> <tree id="0"><!--CTL AutoIT Test Log - Version 1.03--> <udf xpath="" xid="03001"/> <item id="00001" text="Test Folder" im0="ms0.gif" im1="ms1.gif" im2="ms2.gif" child="1" flag="0"> <userdata name="type">folder</userdata> <userdata name="datetime">08/12/2009 15:14:47</userdata> <userdata name="remarks"/> <userdata name="picture"/> <item id="00002" text="Test is a test message" im0="ms0.gif" im1="ms1.gif" im2="ms2.gif" child="0"> <userdata name="type">message</userdata> <userdata name="datetime">08/12/2009 15:14:47</userdata> <userdata name="remarks"/> <userdata name="picture"/> </item> <item id="00003" text="Test is a test message" im0="ms0.gif" im1="ms1.gif" im2="ms2.gif" child="0"> <userdata name="type">message</userdata> <userdata name="datetime">08/12/2009 15:14:50</userdata> <userdata name="remarks"/> <userdata name="picture"/> </item> <item id="00004" text="Test is a test message" im0="ms0.gif" im1="ms1.gif" im2="ms2.gif" child="0"> <userdata name="type">message</userdata> <userdata name="datetime">08/12/2009 15:14:53</userdata> <userdata name="remarks"/> <userdata name="picture"/> </item> </item> </tree> Edited August 17, 2009 by VAG
tegl Posted August 15, 2009 Posted August 15, 2009 #include <_XMLDomWrapper.au3> $sFile=@ScriptDir&"\dd.xml" writexml() readxml() Func writexml() _XMLCreateFile($sFile, "config", True) _XMLFileOpen($sFile) _XMLCreateRootChild("option") _XMLCreateChildWAttr("config/option","update","auto","false") _XMLCreateChildWAttr("config/option","recordlastplaypos","auto","true") _XMLCreateChildNode("config/option","boxopen") _XMLCreateAttrib("config/option/boxopen","bystorm","false") _XMLCreateAttrib("config/option/boxopen","bylive","false") EndFunc Func readxml() _XMLFileOpen($sFile) MsgBox(0,"",_XMLGetAttrib("config/option/update","auto")) MsgBox(0,"",_XMLGetAttrib("config/option/recordlastplaypos","auto")) MsgBox(0,"",_XMLGetAttrib("config/option/boxopen","bylive")) EndFunc the _XMLGetAttrib() cann't get the right result,please fix it
BrettF Posted August 15, 2009 Posted August 15, 2009 Contents of the XML would maybe help... Actually, it is needed. Post it. As far as I can work out, the functions are more than fine. Its probably (more likely) your code... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
VAG Posted August 17, 2009 Posted August 17, 2009 Contents of the XML would maybe help... Actually, it is needed. Post it. As far as I can work out, the functions are more than fine. Its probably (more likely) your code...I have updated my post with the generated XML. The delays can seen more obviously in the attached file. It can also be seen by running Example.au3 in my attached scripts.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now