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.

Open in new window

  //if (node instanceof Element && node.getNodeName().equalsIgnoreCase("name")) {//did not work in java
   if (node instanceof Element && node.getNodeName().equalsIgnoreCase("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
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Please read the following article about the CDATA:

In simple words CDATA is just text part of an XML where you don't want to bother to escape every single mark up character (such as <,>,&)
CDATA has syntax <![CDATA[ some text ]]> and it differs from XML comments <!-- --> in that its content could be extracted by the parser (but all the content of the comments are ignored).
XHTML is an XML, so all the XML rules and requirements applies to XHTML as well.

A Javascript (embedded in XHTML) which code contains a markup character could be one of the following:
1. Just text node inside of the <script> element. Then all the "&" have to be replaced with &amp; (same with "<" and ">" )
2. Enclosed in XML comments <!-- --> . But it will be dropped if you want to parse or do an XSLT processing of the document
3. Be enclosed in a CDATA section. You won't need to escape the mark up characters individually and the content won't be dropped on parsing.
gudii9Author Commented:
3. Be enclosed in a CDATA section. You won't need to escape the mark up characters individually and the content won't be dropped on parsing.

is JSP(java server pages similar to CDATA where we write html inside java using different things like scriptlets like


If there is XML why we need XHTML again. please advise
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.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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.)
F IgorDeveloperCommented:
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

<SCRIPT type="text/javascript">

if ( var1 == 1 && var2 ==2 ) var3=0;


Open in new window

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;


Open in new window

Generally, in XML / XHTML you need to follow the XML syntax rules  to avoid parsing errors.
gudii9Author Commented:
SOAP UI  wev service requests cannot take XML but only takes xHTML as request? please advise
F IgorDeveloperCommented:
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:
gudii9Author Commented:
SOAP XML rules and format given by the target web service (defined in a WSDL document )

where it is given in below wsdl?

please advise
F IgorDeveloperCommented:
The WSDL parsing and convertion to request is a complex parsing task.
Soap UP generate the request based on WSDL parsing, you can see the results when you add a WSDL project and show the "Interface viewer" where you can see the structured WSDL content , ant then get the generated requests.

Generally, a WSDL defines:

Bindings (<wsdl:binding> elements) with available service names , with available actions/operations (<wsdl::operation>)

Ports (<wsdl:portType>) to define input/output messages (<wsdl:input>,<wsdl:output>)  for each operations <wsdl:operation>

Messages (<wsdl:message>) with each parameter used <wsdl:part>

So, the request generation is a combination of data from a selected binding/operation, then finding the output message from the related port/operation, and then generating the request parameters from the selected message

You could try an online WSDL analyzer if you are interested in parsing WSDL definitions

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.