gudii9
asked on
CDATA XML and XHTML
Hi,
I was reading as below
//if (node instanceof Element && node.getNodeName().equalsI gnoreCase( "name")) {//did not work in java
if (node instanceof Element && node.getNodeName().equalsI gnoreCase( "name")) {//worked in java
what is CDATa. when we use CDATA section. How CDATA related to XML or XHTML. How XML and XHTML are similar or different. when to use which one. How to write CDATA for given XML. Does SOPA UI needed request within CDATA all the time to get web service response?
Please advise
I was reading as below
if you write a JavaScript code inside a XHTML web page (without using the CDATA section) you have to escape those characters.
//if (node instanceof Element && node.getNodeName().equalsI
if (node instanceof Element && node.getNodeName().equalsI
what is CDATa. when we use CDATA section. How CDATA related to XML or XHTML. How XML and XHTML are similar or different. when to use which one. How to write CDATA for given XML. Does SOPA UI needed request within CDATA all the time to get web service response?
Please advise
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm not familiar with JSP, but I believe they (as well as the classic ASP) are not XML, so there are different rules of escaping things.
XML is a common formatting (or syntax) standard with a great number of different implementations, each of them has its own set of tag names and its own purpose. XHTML is one of them. The purpose of XHTML is be rendered by a web browser and be able to be read by an XML parser (regular HTML can not be read by an XML parser, because in general, it's not well-formed (special characters are not escaped, some tags might be not closed, etc.)
XML is a generic strict markup language. XHTML uses a strict syntax from XML, but using HTML tags
The following code is only valid in HTML : SCRIPT content with special chars (& > < ) are valid
To make this code "XHTML valid" you need to use CDATA delimiters to allow free code into the content tag (content is not parsed as XML/XHTML):
Generally, in XML / XHTML you need to follow the XML syntax rules to avoid parsing errors.
http://www.w3schools.com/xml/xml_syntax.asp
The following code is only valid in HTML : SCRIPT content with special chars (& > < ) are valid
<SCRIPT type="text/javascript">
if ( var1 == 1 && var2 ==2 ) var3=0;
</SCRIPT>
To make this code "XHTML valid" you need to use CDATA delimiters to allow free code into the content tag (content is not parsed as XML/XHTML):
<SCRIPT type="text/javascript"><![CDATA[
if ( var1 == 1 && var2 ==2 ) var3=0;
]]></SCRIPT>
Generally, in XML / XHTML you need to follow the XML syntax rules to avoid parsing errors.
http://www.w3schools.com/xml/xml_syntax.asp
ASKER
SOAP UI wev service requests cannot take XML but only takes xHTML as request? please advise
SOAPUI request are written in XML format using the SOAP XML rules and format given by the target web service (defined in a WSDL document )
You can try using soap ui with public web services and see the format in auto-generated requests:
Eg: http://www.w3schools.com/webservices/tempconvert.asmx?WSDL
You can try using soap ui with public web services and see the format in auto-generated requests:
Eg: http://www.w3schools.com/webservices/tempconvert.asmx?WSDL
ASKER
SOAP XML rules and format given by the target web service (defined in a WSDL document )
where it is given in below wsdl?
http://www.w3schools.com/webservices/tempconvert.asmx?WSDL
please advise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
is JSP(java server pages similar to CDATA where we write html inside java using different things like scriptlets like
<!=
<%
etc
If there is XML why we need XHTML again. please advise