Page 1 of 1

XML Question

Posted: Fri Aug 15, 2014 11:41 am
by gerry.odea
I am using this to pull in an XML feed:

<$imports='
recdelim >><GSP
field SN varchar(10) />>\RSN\P\=\x22=[^\x22]+ ""
field EN varchar(10) />>\REN\P\=\x22=[^\x22]+ ""
field Counted varchar(20) />><M>\P=!</M>+ ""
field Pell varchar(20) />>\Rq\P\=\x22=[^\x22]+ ""
'>
<$imports2='
recdelim >><R\x20N
field ShowURL varchar(40) />><U>\P=!</U>+ ""
field Title varchar(80) />><T>\P=!</T>+ ""
field Abstract varchar(100) />><S>\P=!</S>+ ""
'></a>

If this is what comes back, and the " is automatically changed with a ' how do I detect it? Currently it comes back blank because it is looking for the " after the q= not a ', but normally it is q="spelling correction", however if the user sends a request with double quotes then it changes it to q='"spelling suggestion"'

<Spelling><Suggestion q='"sharon schnell hobbs"'>&quot;sharon <b><i>schnell</i></b> hobbs&quot;</Suggestion></Spelling>

Any help or suggestions would be greatly appreciated. Thanks Gerry

XML Question

Posted: Fri Aug 15, 2014 11:59 am
by mark
Perhaps import 2 fields Pell1 and Pell2 with expressions for either single or double quote. Then set Pell to the one that's not empty.

Or use the XML mode of timport if the data follows the <dataset><record><field1><field2></record><record>...</record></dataset> structure.

Or use the XML API in vortex to be fully flexible.
http://www.thunderstone.com/site/vortexman/xml_api.html

XML Question

Posted: Fri Aug 15, 2014 12:36 pm
by gerry.odea
How would I write it for Pell2?

field Pell varchar(20) />>\Rq\P\=\x22=[^\x22]+ ""

I know I would change the \x22=[^\x22] but what is the code for just ' ?

Is there a list some where?

XML Question

Posted: Fri Aug 15, 2014 1:30 pm
by mark
Change x22 to x27

Standard ASCII. Lists abound on the net.