Explore topic-wise InterviewSolutions in Current Affairs.

This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.

1.

How You Define E4x?

Answer»

E4X stands for ECMAScript(European Computer MANUFACTURES Association) for XML(Extensible Markup Language). We can called as E4X is an programing language extension USED to adds the ECMAScript(like: ActionScript,DMDScript,E4X, JavaScript,JScript) to XML.

  1. Real life meaning of E4X is "JavaScript for XML".
  2. E4X is an official JavaScript standard used to add direct support for XML.
  3. Using E4X we can easily make scripting for XML with JavaScript.
  4. Using E4X we can declare an XML OBJECT variable as same as declare Date and Array variable.

Example:

VAR p = new XML()
var q = new Date()
var R = new Array()

E4X stands for ECMAScript(European Computer Manufactures Association) for XML(Extensible Markup Language). We can called as E4X is an programing language extension used to adds the ECMAScript(like: ActionScript,DMDScript,E4X, JavaScript,JScript) to XML.

Example:

var p = new XML()
var q = new Date()
var r = new Array()

2.

How We Say Javascript As Same As Ecmascript?

Answer»

Because of some reasons we can say that JavaScript is same as ECMAScript.

  1. ECMAScript is CALLED as an OFFICIAL name for JavaScript.
  2. ECMAScript is exactly same as JavaScript.
  3. JavaScript is STANDARDIZE by ECMA (The European Computer Manufacturers Association) ORGANIZATION.

Because of some reasons we can say that JavaScript is same as ECMAScript.

3.

What You Understand About Ecma?

Answer»

ECMA(The European Computer Manufacturers Association)international was founded in 1961.

ECMA is an organization made to standardization of information and Communication Technology(ICT) and Consumer Electronics(CE).

We use ECMA standard with

  1. JAVASCRIPT
  2. C# Language
  3. International CHARACTER Sets
  4. Optical Disks
  5. Magnetic TAPES
  6. Data Compression
  7. Data Communication etc.
  8. ECMA-262(JavaScript1.3)was standardize in Dec1999.
  9. ECMA-357 (E4X) was standardized in June2004.

We use E4X to make JavaScript supported with XML.

ECMA(The European Computer Manufacturers Association)international was founded in 1961.

ECMA is an organization made to standardization of information and Communication Technology(ICT) and Consumer Electronics(CE).

We use ECMA standard with

We use E4X to make JavaScript supported with XML.

4.

Using E4x How Can We Define Xml Document As A Javascript Object?

Answer»

I have given you example to show XML document as JavaScript object.Example:I have you SIMPLE XML document.

<MESSAGE&GT;
<date>2009-26-01</date>
<to>Abhi</to>
<from>Sud</from>
<heading>Don't forget</heading>
Happy Birthday!</message>

We can store this XML document in a string CALLES as message into an XML object variable vusing JavaScript.var V = new XML(message) or Assign the XML text to the XML object variable directly.var v = new XML()v=<message>
<date>2009-26-01</date>
<to>Abhi</to>
<from>Sud</from>
<heading>Don't forget</heading>
Happy Birthday!</message>
We can use JavaScript like that,document.write(v.from)

Output:Sud

I have given you example to show XML document as JavaScript object.Example:I have you simple XML document.

<message>
<date>2009-26-01</date>
<to>Abhi</to>
<from>Sud</from>
<heading>Don't forget</heading>
Happy Birthday!</message>

We can store this XML document in a string calles as message into an XML object variable vusing JavaScript.var v = new XML(message) or Assign the XML text to the XML object variable directly.var v = new XML()v=<message>
<date>2009-26-01</date>
<to>Abhi</to>
<from>Sud</from>
<heading>Don't forget</heading>
Happy Birthday!</message>
We can use JavaScript like that,document.write(v.from)

Output:Sud

5.

Using E4x How Can We Make Xml Easier To Use?

Answer»

E4X makes easier to use JAVASCRIPT to parse and manipulate XML.This is also use to enable XML library or component to act with XML.On different browsers libraries and components perform with different syntax and work differently. I have given you EXAMPLE where I show how to load an existance XML document("message.xml")into XML parser and to show NOTE from message.

Example: WITHOUT use of E4X.

var xmlDoc//This code is made only for Internet Explorer.
if (window.ActiveXObject)
{
xmlDoc = NEW ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("message.xml")displaymessage();
}// This code is made for Mozilla, Firefox etc.else (document.implementation

E4X makes easier to use JavaScript to parse and manipulate XML.This is also use to enable XML library or component to act with XML.On different browsers libraries and components perform with different syntax and work differently. I have given you example where I show how to load an existance XML document("message.xml")into XML parser and to show note from message.

Example: Without use of E4X.

var xmlDoc//This code is made only for Internet Explorer.
if (window.ActiveXObject)
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("message.xml")displaymessage();
}// This code is made for Mozilla, Firefox etc.else (document.implementation

6.

Tell About Browser Compatibility With E4x?

Answer»

E4X support limited browsers.No,mainstream browser has supported by E4X.Mozilla ENGINE(1.8)(beta VERSION) is limited support to E4X.We can SAY that Firebox 1.1 is an first version that support E4X.E4X is also expected to the FUTURE version of INTERNET Explorer.Firefox 1.1: Firefox1.1 can support best for E4X as compare to other browsers.

E4X support limited browsers.No,mainstream browser has supported by E4X.Mozilla engine(1.8)(beta version) is limited support to E4X.We can say that Firebox 1.1 is an first version that support E4X.E4X is also expected to the future version of Internet Explorer.Firefox 1.1: Firefox1.1 can support best for E4X as compare to other browsers.

7.

How To Use Of E4x With Xml?

Answer»

USING E4X we can EASILY use JAVASCRIPT with an XML.

Example:I have written an XML document.

&LT;order>
<date>2009-26-01</date>
<customer> 
<firstname>Porus</firstname> 
<lastname>Jain</lastname>
</customer>
<item><name>Milk</name> 
<qty>4</qty>
<price>100.00</price></item></order> 

We can stroe this XML document as an string in variable order.

var order = new XML(txt) or Assign the XML text to the XML object variable directly.

var order = new XML()
order=<order id="010">
<date>2009-26-01</date>
<customer>
<firstname>Porus</firstname>
<lastname>Jain</lastname>
</customer>
<item><name>Milk</name>
<qty>4</qty>
<price>100.00</price>
</item></order>

We can also calculate the price like that,

var total=order.item.qty * order.item.priceCan 

we display the customers full name like that,

document.write(order.customer.lastname)
document.write(",")
document.write(order.customer.firstname)
Can add new items like that,
order.item+=<item> 
 <name>BREAD</name> 
 <qty>5</qty> 
 <price>70.00</price>
</item>We can display the order id like that,
document.write(order.@id)

We can calculate the total price, when the order has many items like that,

var price=0for each (i in order.item) 
 {
price+= i.qty*i.price 
 }

Using E4X we can easily use JAvAScript with an XML.

Example:I have written an XML document.

<order>
<date>2009-26-01</date>
<customer> 
<firstname>Porus</firstname> 
<lastname>Jain</lastname>
</customer>
<item><name>Milk</name> 
<qty>4</qty>
<price>100.00</price></item></order> 

We can stroe this XML document as an string in variable order.

var order = new XML(txt) or Assign the XML text to the XML object variable directly.

var order = new XML()
order=<order id="010">
<date>2009-26-01</date>
<customer>
<firstname>Porus</firstname>
<lastname>Jain</lastname>
</customer>
<item><name>Milk</name>
<qty>4</qty>
<price>100.00</price>
</item></order>

We can also calculate the price like that,

var total=order.item.qty * order.item.priceCan 

we display the customers full name like that,

document.write(order.customer.lastname)
document.write(",")
document.write(order.customer.firstname)
Can add new items like that,
order.item+=<item> 
 <name>Bread</name> 
 <qty>5</qty> 
 <price>70.00</price>
</item>We can display the order id like that,
document.write(order.@id)

We can calculate the total price, when the order has many items like that,

var price=0for each (i in order.item) 
 {
price+= i.qty*i.price 
 }

8.

Which Of The Following Options Would Be Returned By The Code Shown In The Code Snippet: Var F = &lt;foo&gt; &lt;a&gt; Text &lt;/a&gt; &lt;a&gt; &lt;b/&gt; &lt;/a&gt; &lt;/foo&gt;; Alert(f.a[0].hascomplexcontent());// P Alert(f.a[1].hascomplexcontent());//q Alert(f.a[0].hassimplecontent());//r Alert(f.a[1].hassimplecontent());//s

Answer»

p-1,q-0,r-0,s-1

p-1,q-0,r-0,s-1

9.

What Will Be The Output Of The Following Code Snippet? Var Customer = &lt;customer&gt; &lt;phone Type="mobile"&gt;888-555-1212&lt;/phone&gt; &lt;phone Type="office"&gt;888-555-2121&lt;/phone&gt; &lt;preferred&gt;mobile&lt;/preferred&gt; &lt;/customer&gt;; Alert(customer.childindex());

Answer»

0

0

10.

Which Of The Following Is Not A Reserved Keyword In E4x And Javascript?

Answer»

super

super

11.

Which Of The Following Is Not A Valid Built-in Method For Xmllist Objects In E4x?

Answer»

hasOwnProperty(PROPERTYNAME)

hasOwnProperty(propertyName)

12.

What Is The Correct Way To Add A Method To An Xml.prototype In E4x?

Answer»

XML.prototype.method::[methodNameString]

XML.prototype.method::[methodNameString]

13.

Which Of The Following Methods Would Give The Output Corresponding To The Code Snippet? Var Test = &lt;type Name="joe"&gt; &lt;base Name="bob"&gt;&lt;/base&gt; Example &lt;/type&gt;; Output: &lt;type Name="joe"&gt; &lt;base Name="bob"/&gt; Example &lt;/type&gt;

Answer»

ALERT(test.toXMLString()); , alert(test.elements());

alert(test.toXMLString()); , alert(test.elements());

14.

Which Of The Following Are Not Global Methods And Properties In E4x?

Answer»

setNamespace()

setNamespace()

15.

State Whether True Or False: The Qname.prototype.tostring() Method Throws A Typeerror Exception If Its Value Is Not A Qname Object?

Answer»

True

True

16.

Which Of The Following Public Methods In E4x Has The Return Type Xml?

Answer»

PARENT()

parent()

17.

Which Of The Following Is Not True Of The Namespace Constructor In E4x?

Answer»

If the value is a VALID XML name, the PREFIX property is SET to a string.

If the value is a valid XML name, the prefix property is set to a string.

18.

Consider The Following Code Snippet. Which Of The Given Options Would Be Used In E4x To Change The Color Of The Descendant Node Chair? Var Element = &lt;home&gt; &lt;room&gt; &lt;furniture&gt; &lt;chair Color="brown"/&gt; &lt;furniture&gt; &lt;/room&gt; &lt;/home&gt;

Answer»

element.chair.color="LIGHT BROWN"

element.chair.color="light brown"

19.

What Will Be The Output Of The Following Code Snippet? Element = &lt;xhtml:p Xmlns:xhtml="http://www.example.org"&gt;kibology For All.&lt;/xhtml:p&gt;; Elementname = Element.name(); Alert(elementname.localname); //1 Alert(elementname.uri); // 2

Answer»

1-p,2-http://www.example.org

1-p,2-http://www.example.org

20.

Which Of The Given Options Represents The Correct Length When Alert(emp..*.length()); Is Applied To The Following Code? Var Emp = &lt;emp&gt; &lt;name&gt;mark&lt;/name&gt; &lt;likes&gt; &lt;os&gt;linux&lt;/os&gt; &lt;browser&gt;firefox&lt;/browser&gt; &lt;language&gt;javascript&lt;/language&gt; &lt;language&gt;python&lt;/language&gt; &lt;/likes&gt; &lt;/emp&gt;

Answer»

12

12

21.

Which Of The Following Operators Is Used For Inserting Xml Objects In The Context Of Their Parent In E4x?

Answer»

+=

+=

22.

Which Of The Following Is The Correct Syntax For Calling The Namespace Constructor As A Function In E4x?

Answer»

NAMESPACE(), Namespace(uriValue).

Namespace(), Namespace(uriValue).

23.

Which Of The Following Options Can Be Used For Adding Direct Support For Xml To Javascript?

Answer»

let.

let.

24.

Which Of The Following Methods Is Not One Of The Global Methods And Properties In E4x?

Answer»

isScopeNamespaces(), removeNamespaces().

isScopeNamespaces(), removeNamespaces().

25.

Which Of The Following Characters Are Treated As White Space Characters?

Answer»

LINE FEED, TAB.

Line feed, Tab.

26.

State Whether True Or False: An Arbitrary Xml File Can Be Loaded As An E4x Ready Object?

Answer»

True.

True.

27.

Which Of The Following Is The Correct Way To Create An Xml Object In E4x?

Answer»

VAR LANGUAGES XML = NEW XML('JavaScriptPython');

var languages XML = new XML('JavaScriptPython');

28.

Which Of The Following Options Can Be Used To Delete A Child Node Of An Xml Object In E4x?

Answer»

DELETE xmlobject.@ATTRIBUTE;

delete xmlobject.@attribute;

29.

What Is The Value Returned When The Input Parameter Type Of The Xmllist() Function In E4x Is Number?

Answer»

The VALUE is FIRST CONVERTED to a STRING and then converted to an XMLList object.

The value is first converted to a string and then converted to an XMLList object.

Previous Next