04-08-2013 10:23 AM
Hi,
I try to convert an array I received from a http server in a xml file. So I will be able to handle the data with the cvixml-lib. The problem are all special signes like "<" or ">". For example the code for "<" is "<". Do I have to write an own parser for all this 5 spezial characters or is there a nice function can do this for me?
I use CVI 2012.
Thanks a lot!
Solved! Go to Solution.
04-09-2013 09:02 AM
Hi DRiegel,
Unfortunetely, there appears to be no such function in the CVI ADE, that's available for users.
Nelu **bleep**arasan || National Instruments
04-09-2013 09:07 AM
ok, the right question is: "how to convert html in xml"
that's how i did it:
hope it helps!
while ( paSource[iAktuellePosSource] > 0 )
// while no end of string continue with loop
{
if ( paSource[iAktuellePosSource] == '&' )
{ // a new escape seq was found!
switch ( paSource[ iAktuellePosSource + 1 ] )
{
case 'l':
// found < -> replace with <
paDestination[ iAktuellePosDes ] = '<';
iAktuellePosSource += 4;
break;
case 'g':
// found > -> replace with >
paDestination[ iAktuellePosDes ] = '>';
iAktuellePosSource += 4;
break;
case 'a':
if ( paSource[ iAktuellePosSource + 2 ] == 'm' )
{
// found & -> replace with &
paDestination[ iAktuellePosDes ] = '&';
iAktuellePosSource += 5;
}
else
{
// found ' -> replace with '
paDestination[ iAktuellePosDes ] = '\'';
iAktuellePosSource += 6;
}
break;
case 'q':
// found &qout; -> replace with "
paDestination[ iAktuellePosDes ] = '"';
iAktuellePosSource += 6;
break;
}
}
else
{
// normal sign just copy
paDestination[ iAktuellePosDes ] = paSource[ iAktuellePosSource ];
++iAktuellePosSource;
}
++iAktuellePosDes;
}