XML

Discuss RoboTask here

XML

Postby petlove » Fri May 18, 2018 8:22 pm

Hello guys,
I am looking for solution of this. Thank you in advance.
I use Save XML to make a XML-file.

From this I want to make the XML

Code: Select all
<voorraad><item><artikel>POST</artikel><aantal>-4</aantal></item><item><artikel>RING N&S</artikel><aantal>0</aantal></item><item><artikel>SC1911-117</artikel><aantal>0</aantal></item><item><artikel>SC1911-330</artikel><aantal>0</aantal></item></voorraad>



But each time there is an error: It is (I'll think) because off the & sign

How to solve this??

In the help file is the following: Automatically converts non-ASCII symbols into the UTF8 format.

When I skip the
Code: Select all
<item><artikel>RING N&S</artikel><aantal>0</aantal></item>

part the XML is made correct

Is there another way to do this?
petlove
 
Posts: 2
Joined: Fri May 18, 2018 8:01 pm

Re: XML

Postby Oleg » Fri May 18, 2018 8:52 pm

Because symbol & (ampersand) is reserved symbol for XML format.
This symbol means that you use some special symbol like in HTML format
Look here about special symbols for HTML & XML format: https://www.ascii.cl/htmlcodes.htm

You have to use such expressions instead of ampersand char:
&amp;
-or-
&#38;

The expression below is correct:
Code: Select all
<item><artikel>RING N&amp;S</artikel><aantal>0</aantal></item>



Also look at my small example
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1360203151
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task46"
Hide=INTEGER|0
ID=INTEGER|1800145511
LogOnAsUser=INTEGER|1
Name=STRING|"XML node with special char"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER

[Actions\Action1]
ActionID=STRING|"A_XML_CREATENODE"
Enabled=INTEGER|-1
Name=STRING|"XML Create Node ""nod"" and save to ""xml"""
Params=FOLDER

[Actions\Action1\Params]
attcount=STRING|"0"
name=STRING|"nod"
txt00000000=STRING|"RING N&S"
txtcount=STRING|"1"
variable=STRING|"xml"

[Actions\Action2]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""{xml}"""
Params=FOLDER

[Actions\Action2\Params]
icon=STRING|"1"
msg0=STRING|"{xml}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
Oleg Yershov
Oleg
Site Admin
 
Posts: 2351
Joined: Thu Jan 01, 1970 1:00 am

Re: XML

Postby petlove » Fri May 18, 2018 9:45 pm

Thank you!
petlove
 
Posts: 2
Joined: Fri May 18, 2018 8:01 pm

Re: XML

Postby Blackjack » Thu Jun 14, 2018 1:39 pm

Great!Thank you!
Blackjack
 
Posts: 1
Joined: Thu Jun 14, 2018 1:37 pm


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 12 guests