on ‎2016 Mar 30 8:39 PM
Hi,
I was trying to replicate some examples I found on the "XML Services" guide. In particular, I'm having troubles to make the parser download an external DTD definition. According to the manual "There are no restrictions on the use of URIs as href attributes or document text, and XML Services resolves external reference URIs that specify http URIs."
But when I execute this query:
insert into text_docs values (xmlvalidate('<!DOCTYPE emp_name PUBLIC "prueba" "http://xx.xx.xx.xx/dtd_emp.dtd"><emp_name>John Doe</emp_name>',option 'dtdvalidate=yes'))
I get this exception:
XMLVALIDATE(): XML parser fatal error <<An exception occurred!
Type:NetAccessorException, Message:Could not create the socket for URL '{0}'.
Error={1}>> at line 1, offset 71.
Using google I found people who got the same error, but I haven't found any solution.
Any help would be appreciated
Thanks
Leandro
Request clarification before answering.
Well. http://xx.xx.xx.xx is not a valid URL. It looks more like an example template. Are you using an actual IP address?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can get the following to work:
insert into text_docs values (xmlvalidate('<!DOCTYPE emp_name PUBLIC "http://xx.xx.xx.xx/dtd_emp.dtd"><emp_name>John Doe</emp_name>'
,option 'dtdvalidate=yes xmlerror=null'))
can further use any option for xmlerror=[null|message|exception]
Hi! Now I tried on a different server which is running ASE 16.0 Sp02 (lastest), and I get a different error:
XMLVALIDATE(): XML parser fatal error <<An exception occurred!
Type:MalformedURLException, Message:Unsupported URL protocol:
'http://xx.xx.xx.xx/>> at line 1, offset 4.
SQLCODE=14702
Server=SYBASE, Severity Level=16, State=0, Transaction State=1, Line=1
Line 1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hmmm.. I can get the following to work:
insert into text_docs values (xmlvalidate('<!DOCTYPE emp_name PUBLIC "http://xx.xx.xx.xx/dtd_emp.dtd"><emp_name>John Doe</emp_name>'
,option 'dtdvalidate=yes xmlerror=null'))
can further use any option for xmlerror=[null|message|exception]
Kevin,
So all you did was take out the word "prueba" e.g. "test" in Spanish? See below.
Thank you.
Jean-Pierre
insert into text_docs values (xmlvalidate('<!DOCTYPE emp_name PUBLIC "prueba" "http://xx.xx.xx.xx/dtd_emp.dtd"><emp_name>John Doe</emp_name>',option 'dtdvalidate=yes'))
insert into text_docs values (xmlvalidate('<!DOCTYPE emp_name PUBLIC "http://xx.xx.xx.xx/dtd_emp.dtd"><emp_name>John Doe</emp_name>'
,option 'dtdvalidate=yes xmlerror=null'))
Thanks Jean-Pierre & Kevin!
Adding xmlerror=null as an option doesn't solve the issue, it's just a workaround to make xmlvalidate return null in case of an error.
Jean-Pierre, "prueba" is needed because if you don't add a name to the DOCTYPE declaration, xmlvalidate raises an exception: "Expected quoted string"
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.