Forgot password? | Forgot username? | Register

Special Characters not encoded in XML output...

Special Characters not encoded in XML output...

In pulling the XML data from the texxmlserver, I noticed that special characters in the data are not being encoded.

For example, if the value of the MulTitle field is "Cats & Dogs" the ampersand is not being encoded so the xml is valid (i.e. it should be "Cats & Dogs").

Unfortunately, this is causing our parser to blow up (using .Net).

Is there a setting, hopefully, for KE that will encode the special characters in the xml output?

Thanks (for this and all the other help recently),

Alan

Edited by: - 01-Jan-70 09:00:00

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Special Characters not encoded in XML output...

Hello Alan,

I have tested texxmlserver and it seems to be marking up special characters correctly. I created a multimedia record with a title of "Cats & Dogs" and then connected to texxmlserver and got it to dump the value in MulTitle. I go the following output:


telnet localhost emuwebartdemo
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /?texql=select+MulTitle+from+emultimedia+where+irn+=+455
HTTP/1.0 200 OK
Content-Type: text/xml




Cats & Dogs


Connection to localhost closed by foreign host.

As you can see the ampsersand is escaped (&) correctly. Could you please perform the same test on your server (replacing the irn with the correct value and the service name with your service name) and post back the output?

Thanks

bern.

Bernard Marshall
KE Software
Melbourne, Australia

Bernard Marshall (Axiell Melbourne)
useravatar
Offline
43 Posts
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Special Characters not encoded in XML output...

Oops,

Seems like all my XML has been gobbled up! I have attached the output as an attachment.

Regards

bern.

Attachment: xml.txt

Bernard Marshall
KE Software
Melbourne, Australia

Bernard Marshall (Axiell Melbourne)
useravatar
Offline
43 Posts
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Special Characters not encoded in XML output...

Thanks for checking it out, bern.

So, using the following:

http://lin-emu.winterthur.org:30094/?te … 969.345%27

For results, see attachment.

As you can see, I get an ampersand. We have thousands of records that come out not encoded. I haven't looked for occurrences of the Less Than and Greater Than symbols, but I do know that Double Quotes are also not being encoded. Now there is a possible exception with the apostrophe. It is being encoded. However, I suspect, though I'm sure you can tell me, that the apostrophe is being encoded at the database level rather than as a result of it being XML output.

I've also attached a record showing the un-encoded Double Quotes.

Attachment: results.txt
Attachment: doublequotes.txt

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Special Characters not encoded in XML output...

Alan,

It seems we can't access lin-emu.winterthur.org. Is this behind a firewall? Any chance it could be opened up to us?

Regards,
John

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Special Characters not encoded in XML output...

Hello Alan,

Could you please let me know what version of TexAPI you have installed on your machine. You can determine this by logging into the EMu server as user "emu", then looking in the "../texpress" directory. A file called texapi will exist. If you run "ls -l" you will see something like:

lrwxrwxrwx 1 emu emuadmin 7 Apr 10 20:55 8.1 -> 8.1.016/
drwxr-xr-x 6 emu emuadmin 4096 Mar 13 20:26 8.1.015/
drwxr-xr-x 6 emu emuadmin 4096 Apr 10 20:54 8.1.016/
lrwxrwxrwx 1 emu emuadmin 7 Apr 10 20:59 texapi -> 3.1.012/

The "texapi" version appears after the "->" marker.

Thanks

bern.
Bernard Marshall
KE Software
Melbourne, Australia

Bernard Marshall (Axiell Melbourne)
useravatar
Offline
43 Posts
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Special Characters not encoded in XML output...

Hello Alan,

I assume you are capturing the output without using a browser as the browser will translate the & into an ampersand character. Can you confirm that you used "telnet" to access texxmlserver?

Regards

bern.
Bernard Marshall
KE Software
Melbourne, Australia

Bernard Marshall (Axiell Melbourne)
useravatar
Offline
43 Posts
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Special Characters not encoded in XML output...

Posted By John Doolan on 18-07-2008 3:33 PM
Alan,

It seems we can't access lin-emu.winterthur.org. Is this behind a firewall? Any chance it could be opened up to us?

Regards,
John




Hi John,
Direct access is firewalled off, but I have an web testbed you can use that wraps it.

This query will show you a result with the offending ampersand:

http://forums.winterthur.org/testbed.ph … 969.345%27


This query will show you a result that has the apostrophe being returned in its encoded state. From that it is reasonable to say that the offending ampersand above is not being un-encoded by the browser (because the apostrophe would have been also).

http://forums.winterthur.org/testbed.ph … 302.011%27

If you decide to play around with the testbed, stick to the Query KE button. The "Query and Transform" button applies a very specific XSL that will most likely return nothing for most queries.

Thanks for you looking into it John.

Alan

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Special Characters not encoded in XML output...

Posted By John Doolan on 18-07-2008 3:33 PM
Alan,

It seems we can't access lin-emu.winterthur.org. Is this behind a firewall? Any chance it could be opened up to us?

Regards,
John

Sorry... I thought the forum would detect and format the links.

Here is a reposting:


Hi John,
Direct access is firewalled off, but I have an web testbed you can use that wraps it.

This query will show you a result with the offending ampersand:

http://forums.winterthur.org/testbed.ph … 969.345%27


This query will show you a result that has the apostrophe being returned in its encoded state. From that it is reasonable to say that the offending ampersand above is not being un-encoded by the browser (because the apostrophe would have been also).

http://forums.winterthur.org/testbed.ph … 302.011%27

If you decide to play around with the testbed, stick to the Query KE button. The "Query and Transform" button applies a very specific XSL that will most likely return nothing for most queries.

Thanks for you looking into it John.

Alan

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Special Characters not encoded in XML output...

Posted By Bernard Marshall on 18-07-2008 6:57 PM
Hello Alan,

Could you please let me know what version of TexAPI you have installed on your machine. [... stuff deleted ...]

lrwxrwxrwx 1 emu emuadmin 7 Apr 10 20:59 texapi -> 3.1.012/

The "texapi" version appears after the "->" marker.

Thanks

bern.


Well, mine looks pretty similar to yours:

lrwxrwxrwx 1 emu emuadmin 14 Jul 2 15:25 texapi -> texapi-3.1.012/

Thanks! Let me know how else I might help you help me :-)

Alan

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Special Characters not encoded in XML output...

Posted By Bernard Marshall on 18-07-2008 6:59 PM
Hello Alan,

I assume you are capturing the output without using a browser as the browser will translate the & into an ampersand character. Can you confirm that you used "telnet" to access texxmlserver?

Regards

bern.

I didn't use telnet. I used PHP which wrote the results to a file.
Specifically, it uses CURL to get the file.

If the browser/Php/whatever were decoding the ampersand then it would also decode the apostrophe (I would assume). But queries are returning the apostrophe in its encoded state. For examples see the two links I have included above in a response to John.

For sake of completeness, I will run the same two queries via telnet.

Thanks!

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Special Characters not encoded in XML output...

Posted By Bernard Marshall on 18-07-2008 6:59 PM
Hello Alan,

I assume you are capturing the output without using a browser as the browser will translate the & into an ampersand character. Can you confirm that you used "telnet" to access texxmlserver?

Regards

bern.

Here's the telnet session. Looks like SSH might be causing a problem with accepting the GET. Off-hand, I don't know if I need to wrap the GET with something that authenticates first.

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SSH-1.99-OpenSSH_3.9p1
GET /?texql=select+MulTitle+from+emultimedia+where+irn+=+1646
Protocol mismatch.
Connection closed by foreign host.

Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests and 0 other users also viewing this topic

Board Info

Board Stats
 
Total Topics:
604
Total Polls:
0
Total Posts:
1363
User Info
 
Total Users:
882
Newest User:
Allan Reyes (Axiell Toronto)
Members Online:
2
Guests Online:
137