Thank you.
PIM.EXE is a sample for reading a XML file and editing is also possible, but it is not a process for more options ?
I suppose it is not the idea of creation a PIM.exe that also reads the xml and can put it into a dbf.
That option is what I'm looking at now. I need to download more that once a XML file from my webshop, containing the colors and Hex values used in product pages.
sample file :
<?xml version="1.0"?>
<options version="1">
<item>
<id>1</id>
<sortOrder>127</sortOrder>
<widget>true</widget>
<googleTag/>
<beslistTag/>
<channableTag/>
<name>
<dutch>Kleur</dutch>
</name>
<values>
<item>
<id>2459</id>
<sortOrder>0</sortOrder>
<colorHex>A12839</colorHex>
<name>
<dutch>aardbei</dutch>
</name>
</item>
<item>
<id>2</id>
<sortOrder>0</sortOrder>
<colorHex/>
<name>
<dutch>antraciet</dutch>
</name>
</item>
<item>
<id>2522</id>
<sortOrder>0</sortOrder>
<colorHex/>
<name>
<dutch>antraciet/zwart</dutch>
</name>
</item>
<item>
<id>2675</id>
<sortOrder>0</sortOrder>
<colorHex/>
<name>
<dutch>ANTRACIETGRIJS</dutch>
</name>
</item>
<item>
<id>2564</id>
<sortOrder>0</sortOrder>
<colorHex/>
<name>
<dutch>ZWARTø</dutch>
</name>
</item>
</values>
</item>
</options>
This function is going the right way in converting to xbrowse data that can be saved later.
- Code: Select all Expand view
function Xmlreader()
local aMail:={},nTel:= 1
local hFile := FOpen( "c:\programmas\fotoselect\kleuren.xml" )
Local oXmlDoc := TXmlDocument():New( hFile )
Local oXmlIter := TXmlIterator():New( oXmlDoc:oRoot ), oTagActual
while .T.
oTagActual = oXmlIter:Next()
If oTagActual != nil
if oTagActual:cName = "item"
aadd(aMail,oTagActual:cData)
endif
if oTagActual:cName = "dutch"
aadd(aMail,oTagActual:cData)
endif
if oTagActual:cName = "colorHex"
aadd(aMail,oTagActual:cData)
endif
// HEval( oTagActual:aAttributes, { | cKey, cValue | MsgInfo( cKey, cValue ) } )
Else
Exit
Endif
if nTel > 5
exit
endif
End
xbrowse(aMail)
FClose( hFile )
return nil
Data that I become =
A
Kleur
A12839
aardbei
antraciet
antraciet/zwart
ANTRACIETGRIJS
ANTRACIETGRIJS/AZUURBLAUW
ANTRACIETGRIJS/ZWART
00A0DF
aqua
Army Groen/Zwart
06638f
Assure
Azure
AZUURBLAUW
AZUURBLAUW/ANTRACIETGRIJS
AZUURBLAUW/ZWART
A0BAD3
babyblauw
ECC9E9
babyrose
// end data sample -------------------------------------------------------------------------------------------------------------------
In fact i finaly would like this in a database:
ID ColorHex Name
2459 A12839 aardbei
2 antraciet
....
83 06638f Assure
Is a XML file build always the same way ?