encoded characters in command line?
Added by Anonymous over 16 years ago
Legacy ID: #4956968 Legacy Poster: Lucas Veeger (luckyvee)
Hi, I try to harvest a database using OAI-PMH and Saxon 9 form the command line. Everythings works fine except that the resumptionToken sometimes has the '{'- character enclosed. In this case Saxon (version 9) returns an error and the processing halt. When I encode this '{'-character with '%7B', Saxon no longer returns an error, but the harvesting halts anyway. This is because for some reason Saxon strips the charactes '%7' from the URI, which changes the resumptionToken. Is this by design? Is there a solution or workaround. Thanks, Lucas I am using Saxon from the command line this way: java -jar c:\temp\saxon\saxon9.jar -t "http://www.musip.nl/oaicolls/wwwopac.exe?verb=ListRecords&resumptionToken=j7Koft93Mm%7ByTy0KmsYq" c:\temp\mplus_dc_split.xsl
Replies (3)
Please register to reply
RE: encoded characters in command line? - Added by Anonymous over 16 years ago
Legacy ID: #4957219 Legacy Poster: Michael Kay (mhkay)
You haven't said what command line processor you are using, but if % is treated specially then my guess would be that it is the Windows one. I'm afraid I'm no expert on the rules for handling special characters in tehe Windows command line. %x normally means substitute the value of a command line parameter, and I don't know if there is any way of escaping it. I'm surprised that "{" doesn't work, I wasn't aware that Windows treated this character specially. Either way, you seem to have a problem with the Windows command line and not with Saxon.
RE: encoded characters in command line? - Added by Anonymous over 16 years ago
Legacy ID: #4957230 Legacy Poster: Michael Kay (mhkay)
Here are some suggestions on escaping a percent-sign in the Windows command line. I've no idea where the actual spec is to be found. http://www.eightypercent.net/Archive/2004/12/05.html
RE: encoded characters in command line? - Added by Anonymous over 16 years ago
Legacy ID: #4957528 Legacy Poster: Lucas Veeger (luckyvee)
Thanks for your info. I admit I have missed the obvious. I should have realised that the windows command processor treats strings like %7 or %6 as input variables. Simply escaping '{' to '%7B' won't do, because the command processor probably sees this as an empty variable. I also remembered a workaround: replace '{' with '%%7B' . That's all. Unfortunately this is easier said than done within a xsl-stylesheet, but with some substring-before and substring-after commands I managed to do so. Lucas
Please register to reply