Jump to content

Recommended Posts

Posted

Hello,

this UDF is GREAT. :-)

One question from my side.

How  can i create a Child Node under a Child node?

<Orders>
    <Order>
        <OrderNr>10304 (Bestellnr. des Shops)</OrderNr>
        
        <ShippingAddress>
                <Company/>
        </ShippingAddress>
        
    </Order>
</Orders>

BR

horphi

Posted

Solved

_XMLCreateChildNode("//Orders/Order", "TotalGrossAmount", "17.48", "")
        _XMLCreateChildNode("//Orders/Order", "ShippingAddress", "", "")
        _XMLCreateChildNode("//Orders/Order/ShippingAddress", "Company", "", "")

:-)

  • 1 month later...
Posted

Links are not working anymore...

Google Code was closed two days ago, and not possible to use (?)

"Beginning today, we have disabled new project creation on Google Code. We will be shutting down the service about 10 months from now on January 25th, 2016. Below, we provide links to migration tools designed to help you move your projects off of Google Code. We will also make ourselves available over the next three months to those projects that need help migrating from Google Code to other hosts.

  • March 12, 2015 - New project creation disabled.
  • August 24, 2015 - The site goes read-only. You can still checkout/view project source, issues, and wikis.
  • January 25, 2016 - The project hosting service is closed. You will be able to download a tarball of project source, issues, and wikis. These tarballs will be available throughout the rest of 2016.

"

Please move the code to a diffent place, I find it useful in my project.

Posted

@DagSa

Start reading on Page 38

and end here:

 

 

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 5 weeks later...
Posted

Hello

I have a file xml (test.xml)

<?xml version="1.0" encoding="UTF-8" ?> 
<CHUNGTU>
<ND_CHUNGTU_NH>
<NGAN_HANG>ABC</NGAN_HANG>
<MA_PHIEU>000001</MA_PHIEU>
</ND_CHUNGTU_NH>
<SIGNATURE xmlns="http://www.w3.org/2000/09/xmldsig#" Id="signatureProperties">
<KEY_INFO>
<KEY_VALUE>1234567890_key_value</KEY_VALUE>
<X509Data>
<X509SubjectName>0200836088_sub1</X509SubjectName> 
<X509Certificate>0123456789_cer1</X509Certificate> 
</X509Data>
</KEY_INFO>
</SIGNATURE>
<SIGNATURE xmlns="http://www.w3.org/2000/09/xmldsig#" Id="signatureProperties">
<KEY_INFO>
<KEY_VALUE>1234567890_key_value</KEY_VALUE>
<X509Data>
<X509SubjectName>0200836088_sub2</X509SubjectName> 
<X509Certificate>9876543210_cer2</X509Certificate> 
</X509Data>
</KEY_INFO>
</SIGNATURE>
</CHUNGTU>

i want read content the fisrt childnode <X509SubjectName> or any childnode <X509SubjectName> in test.xml

and then write to file txt. i can do that

This my code.

#Include <_XMLDomWrapper.au3>
#include <Array.au3>;
#Include <String.au3>

$sXmlFile = "test.xml"
$oOXml = _XMLFileOpen ($sXmlFile)
If @error Then
   MsgBox(0,"Error",_MSXML_Error())
Else
   MsgBox(0,"Success","File open and ready.")
EndIf

$sub1 = "//CHUNGTU/Signature[1]/X509Data/X509SubjectName"
$txt = _XMLGetValue($cert1)

FileWrite("subname1.txt",$txt)
Exit

 

Posted

 

@tungpheng You are using old UDF version (I'm refering to this function _MSXML_Error()  in your snippet ).

Start reading on Page 38

and end reading here:

 

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Hi tungpheng - welcome to the forum.

With -

$txt = _XMLGetValue($cert1)

what is - $cert1

Should that perhaps be - $sub1

as in -

$txt = _XMLGetValue($sub1)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

  Reveal hidden contents

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

  • 2 months later...
Posted (edited)

I'm attempting to use the Dell API to get warranty information about assets, and parse the returned XML file using AutoIt. I cannot for the life of me seem to get this to work right. I can get it to open the XML file and tell me there's one child node (GetAssetWarrantyResult), but cannot seem to get it to read any of the values in its children even though I am specifying the namespace xmlns:a="http://schemas.datacontract.org/2004/07/Dell.AWR.Domain.Asset". Can anyone help me? Here's the XML file contents I'd like it to look at, and I am specifically concerned with the "StartDate" and "EndDate" items in the warranty sections.

 

<GetAssetWarrantyResponse xmlns="http://tempuri.org/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<GetAssetWarrantyResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:a="http://schemas.datacontract.org/2004/07/Dell.AWR.Domain.Asset">
<a:Faults/>
<a:Response>
<a:DellAsset>
<a:AssetParts i:nil="true"/>
<a:CountryLookupCode>11</a:CountryLookupCode>
<a:CustomerNumber>123456789</a:CustomerNumber>
<a:IsDuplicate>false</a:IsDuplicate>
<a:ItemClassCode>J2002</a:ItemClassCode>
<a:LocalChannel>65</a:LocalChannel>
<a:MachineDescription>DELL PWS TOWER 5810,AVALONFCTO</a:MachineDescription>
<a:OrderNumber>852696778</a:OrderNumber>
<a:ParentServiceTag i:nil="true"/>
<a:ServiceTag>SERVICETAG</a:ServiceTag>
<a:ShipDate>2015-07-13T00:00:00</a:ShipDate>
<a:Warranties>
<a:Warranty>
<a:EndDate>2018-07-13T23:59:59</a:EndDate>
<a:EntitlementType>INITIAL</a:EntitlementType>
<a:ItemNumber>997-7188</a:ItemNumber>
<a:ServiceLevelCode>ND</a:ServiceLevelCode>
<a:ServiceLevelDescription>Next Business Day Support</a:ServiceLevelDescription>
<a:ServiceLevelGroup>5</a:ServiceLevelGroup>
<a:ServiceProvider>UNY</a:ServiceProvider>
<a:StartDate>2015-07-13T00:00:00</a:StartDate>
</a:Warranty>
<a:Warranty>
<a:EndDate>2018-07-13T23:59:59</a:EndDate>
<a:EntitlementType>INITIAL</a:EntitlementType>
<a:ItemNumber>984-1772</a:ItemNumber>
<a:ServiceLevelCode>KK</a:ServiceLevelCode>
<a:ServiceLevelDescription>Keep Your Hard Drive Service</a:ServiceLevelDescription>
<a:ServiceLevelGroup>11</a:ServiceLevelGroup>
<a:ServiceProvider>DELL</a:ServiceProvider>
<a:StartDate>2015-07-13T00:00:00</a:StartDate>
</a:Warranty>
<a:Warranty>
<a:EndDate>2018-07-13T23:59:59</a:EndDate>
<a:EntitlementType>INITIAL</a:EntitlementType>
<a:ItemNumber>997-7208</a:ItemNumber>
<a:ServiceLevelCode>TS</a:ServiceLevelCode>
<a:ServiceLevelDescription>Client Gold Support / ProSupport</a:ServiceLevelDescription>
<a:ServiceLevelGroup>8</a:ServiceLevelGroup>
<a:ServiceProvider>DELL</a:ServiceProvider>
<a:StartDate>2015-07-13T00:00:00</a:StartDate>
</a:Warranty>
</a:Warranties>
</a:DellAsset>
</a:Response>
</GetAssetWarrantyResult>
</GetAssetWarrantyResponse>

 

Edited by chaoticyeshua
  • 6 months later...
Posted

Hi,

did some test with the new XML.au3 1.1.1.12.

I have a big XML file with lots of movies and tvseries entries stored in it.

Tried to take all titles of the episodes for example.

$EpisodenArray = _XML_GetValue($oXmlDoc, "/videodb/tvshow/episodedetails/season")

_XML_GetValue is doing fine, got a big list of titles, but the first one from the XML file is missing.

Can't find an bug in the XML file, the Syntax for the first Episode is fine, like all others.

Tried an older Version of #include <XMLWrapperEx.au3> and _XMLGetValue the same here. The first entry is missing all others in the result.

Any ideas?

  • 2 weeks later...
Posted

oh.... I was busy, still I'm (for this is my "absense" in the forum)

I'll try to look at this today.

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Ok PM to me.
 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 3 months later...
Posted
  On 4/27/2008 at 3:52 AM, Avee said:

Here's a part of the xml.

 

My goal is to fill arrays with all the timestamps, distances, elevations and heart rates. Regardless what activity, lap or track they are in. I could first get all activities, laps and tracks and then walk through all of them, but is there an easier way to just "disregard" those nodes in between?

 

 

<?xml version="1.0" encoding="UTF-8" standalone="no" ?> 
- <TrainingCenterDatabase xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 http://www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd">
- <Activities>
 - <Activity Sport="Biking">
   <Id>2007-09-03T19:03:43Z</Id> 
  - <Lap StartTime="2007-09-03T19:03:43Z">
    <TotalTimeSeconds>5309.7300000</TotalTimeSeconds> 
    <DistanceMeters>18821.4882813</DistanceMeters> 
    <MaximumSpeed>15.5050001</MaximumSpeed> 
    <Calories>1450</Calories> 
   - <AverageHeartRateBpm xsi:type="HeartRateInBeatsPerMinute_t">
     <Value>155</Value> 
     </AverageHeartRateBpm>
   - <MaximumHeartRateBpm xsi:type="HeartRateInBeatsPerMinute_t">
     <Value>190</Value> 
     </MaximumHeartRateBpm>
     <Intensity>Active</Intensity> 
     <TriggerMethod>Manual</TriggerMethod> 
   - <Track>
    - <Trackpoint>
      <Time>2007-09-03T19:03:43Z</Time> 
    - <Position>
       <LatitudeDegrees>39.0886344</LatitudeDegrees> 
       <LongitudeDegrees>-84.4688488</LongitudeDegrees> 
      </Position>
      <AltitudeMeters>185.6717529</AltitudeMeters> 
      <DistanceMeters>0.0000000</DistanceMeters> 
    - <HeartRateBpm xsi:type="HeartRateInBeatsPerMinute_t">
       <Value>182</Value> 
      </HeartRateBpm>
      <SensorState>Absent</SensorState> 
     </Trackpoint>
   - <Trackpoint>
      <Time>2007-09-03T19:03:44Z</Time> 
    - <Position>
       <LatitudeDegrees>39.0886227</LatitudeDegrees> 
       <LongitudeDegrees>-84.4687664</LongitudeDegrees> 
      </Position>
      <AltitudeMeters>185.1911621</AltitudeMeters> 
      <DistanceMeters>7.4052925</DistanceMeters> 
    - <HeartRateBpm xsi:type="HeartRateInBeatsPerMinute_t">
       <Value>182</Value> 
      </HeartRateBpm>
      <SensorState>Absent</SensorState> 
     </Trackpoint>
Expand  

I think that your xml file is realy like this:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?> 
<TrainingCenterDatabase xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 http://www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd">
	<Activities>
		<Activity Sport="Biking">
			<Id>2007-09-03T19:03:43Z</Id> 
			<Lap StartTime="2007-09-03T19:03:43Z">
				<TotalTimeSeconds>5309.7300000</TotalTimeSeconds> 
				<DistanceMeters>18821.4882813</DistanceMeters> 
				<MaximumSpeed>15.5050001</MaximumSpeed> 
				<Calories>1450</Calories> 
				<AverageHeartRateBpm xsi:type="HeartRateInBeatsPerMinute_t">
					<Value>155</Value> 
				</AverageHeartRateBpm>
				<MaximumHeartRateBpm xsi:type="HeartRateInBeatsPerMinute_t">
					<Value>190</Value> 
				</MaximumHeartRateBpm>
				<Intensity>Active</Intensity> 
				<TriggerMethod>Manual</TriggerMethod> 
				<Track>
					<Trackpoint>
						<Time>2007-09-03T19:03:43Z</Time> 
						<Position>
							<LatitudeDegrees>39.0886344</LatitudeDegrees> 
							<LongitudeDegrees>-84.4688488</LongitudeDegrees> 
						</Position>
						<AltitudeMeters>185.6717529</AltitudeMeters> 
						<DistanceMeters>0.0000000</DistanceMeters> 
						<HeartRateBpm xsi:type="HeartRateInBeatsPerMinute_t">
							<Value>182</Value> 
						</HeartRateBpm>
						<SensorState>Absent</SensorState> 
					</Trackpoint>
					<Trackpoint>
						<Time>2007-09-03T19:03:44Z</Time> 
						<Position>
							<LatitudeDegrees>39.0886227</LatitudeDegrees> 
							<LongitudeDegrees>-84.4687664</LongitudeDegrees> 
						</Position>
						<AltitudeMeters>185.1911621</AltitudeMeters> 
						<DistanceMeters>7.4052925</DistanceMeters> 
						<HeartRateBpm xsi:type="HeartRateInBeatsPerMinute_t">
							<Value>182</Value> 
						</HeartRateBpm>
						<SensorState>Absent</SensorState> 
					</Trackpoint>
				</Track>	
			</Lap>		
		</Activity>			
	</Activities>				
</TrainingCenterDatabase>

 

  • 8 months later...
Posted

hi,

can one help me to use my files, becose i dont understand how to use this UDF?

my File
 

<XMLBIBLE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="zef2005.xsd" version="3.0.0.9.1" status="v" type="x-bible" biblename="Translation one">
  <INFORMATION>
    <format></format>
    <date></date>
    <creator></creator>
    <source></source>
    <language></language>
    <publisher></publisher>
    <rights>no rights</rights>
  </INFORMATION>
  <BIBLEBOOK bname="1.Book" bnumber="1" bsname="1.Book">
    <CHAPTER cnumber="1">
      <VERS vnumber="1">This ist first verse</VERS>
      <VERS vnumber="2">this ist second</VERS>
      <VERS vnumber="3">And so one.</VERS>
      <VERS vnumber="4">plaplapla</VERS>
    </CHAPTER>
    <CHAPTER cnumber="2">
      <VERS vnumber="1">And so on and so on</VERS>
      <VERS vnumber="2">...</VERS>
    </CHAPTER>
    <CHAPTER cnumber="3">
      <VERS vnumber="1">and many more</VERS>
      <VERS vnumber="2">...</VERS>
      <VERS vnumber="5">and and and</VERS>
    </CHAPTER>
  </BIBLEBOOK>
  <BIBLEBOOK bname="2.Book" bnumber="2" bsname="2.Book">
    <CHAPTER cnumber="1">
      <VERS vnumber="1">And again verse 1</VERS>
      <VERS vnumber="2">Verse 2</VERS>
      <VERS vnumber="3">...</VERS>
      ...
      <VERS vnumber="22">...</VERS>
    </CHAPTER>
    <CHAPTER cnumber="2">
      <VERS vnumber="1">...</VERS>
      <VERS vnumber="2">...</VERS>
      ...
    </CHAPTER>
  </BIBLEBOOK>
  <BIBLEBOOK bname="Uneverse" bnumber="3" bsname="Uneverse">
    <CHAPTER cnumber="1">
      <VERS vnumber="1">and so one and so on</VERS>
    </CHAPTER>
  </BIBLEBOOK>
  ...
</XMLBIBLE>

How can i use it in Array? I need a bookname then chapternumber and versenuber.

can you give me an example how can i use it in a gui, how can i search for a text in verses and Show me in witch books, chapter and verses the results is?

 

Thank you!

  • 2 weeks later...
Posted (edited)

Hey guys !

I'm using actively _XML.au3 for professional purpose, and I ran into a ... I don't know if it's a problem or a feature.

Anyway : this node (in an existing file)

<szFooterLine0 Type="202">TEXT</szFooterLine0>

become this

<szFooterLine0[@Type=202]>TEXT</szFooterLine0>

after some manipulation on the file (but not this node).

For obvious reason, it's a problem :)

Any hint ?

Edited by GhostLine
Posted
  On 1/11/2018 at 1:22 PM, GhostLine said:

Hey guys !

I'm using actively _XML.au3 ...... Any hint ?

Expand  

Try with XML.au3

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 11 months later...
Posted

Hi,  

The XML wrapper is great and allowed me to simply manipulate the file.

One slight confusion for me was that  _XML_SaveToFile  fails if the file exists, rather than overwriting the file.  Maybe you could add a function parameter to allow overwrite?

Thanks for the library

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
  • Recently Browsing   0 members

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