XML (OpenInsight 16-Bit Specific)
At 20 MAR 2002 11:12:07AM Richard Channer wrote:
2 quick questions…
1.
When the results of a query via OICGI are correctly returned in XML format, should the browser simply display the results in text form - showing the XML construction only when you 'view source'
-or-
should the browser display the results within a collapsable list including tags?
2.
Is the xmlns=x-schema:schema_file.xml" part of the XML header for information (i.e. the location of the original schema) or is it actually used by the browser to construct the XML?
If the above is for info only - is there any point in calling CREATE_XML_ELEMENT_SCHEMA every time the query is processed, or simply call it once only and store it on the server?
Regards,
Richard Channer
VTS
At 22 MAR 2002 02:03PM WinWin/Revelation Support wrote:
Richard:
2 quick questions…
1.
When the results of a query via OICGI are correctly returned in XML format, should the browser simply display the results in text form - showing the XML construction only when you 'view source'
-or-
should the browser display the results within a collapsable list including tags?
That IE 5 and better will automatically render XML in a collapible list is a product specific feature. IE automatically transforms your document using a default stylesheet when the document has a mimetype of text/xml That stylesheet generates the collapsible tree you see. Most other browers do not do this, so you see the text weith the tags stripped out. Even Ie shows you text with tags stripped if mimetype is not XML
to get oicgi to set the mimetype, place a Content-Type directive as the first line in the output, followed by a blank line,
e.g.
equ crlf$ to char(13):char(10)
result='
result:= 'Content-Type: text/xml':crlf$
result:= crlf$
…
return result
2.
Is the xmlns=x-schema:schema_file.xml" part of the XML header for information (i.e. the location of the original schema) or is it actually used by the browser to construct the XML?
If the above is for info only - is there any point in calling CREATE_XML_ELEMENT_SCHEMA every time the query is processed, or simply call it once only and store it on the server?
The schema is information that the receiving programs can use to interpret or validate the xml data. The browser will ignore the schema. Web services may use it, dependfing on how they are written. Even if the schema is used by the xml consumer, you only need to generate the schema when your dictionary changes.
Hope this helps,
Bob
At 26 MAR 2002 09:25AM Richard Channer wrote:
Bob,
Very helpful - thanks very much.
Richard