XML Question

Post Reply
gerry.odea
Posts: 98
Joined: Fri Sep 19, 2008 9:33 am

XML Question

Post 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
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

XML Question

Post 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
gerry.odea
Posts: 98
Joined: Fri Sep 19, 2008 9:33 am

XML Question

Post 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?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

XML Question

Post by mark »

Change x22 to x27

Standard ASCII. Lists abound on the net.
Post Reply