1. Which of the following methods is not one of the global methods and properties in E4X?
Answers:
Answers:
Answers:
var test =
<type name=”Joe”>
<base name=”Bob”></base>
example
</type>;
output:
<type name=”Joe”>
<base name=”Bob”/>
example
</type>
Answers:
Answers:
var p1 = <p>Kibology for all.</p>;
alert(p1.name().uri);
default xml namespace = ‘http://www.w3.org/1999/xhtml’;
var p2 = <p>Kibology for all.</p>;
alert(p2.name().uri);
default xml namespace = ”;
var p3 = <p>Kibology for all.</p>;
alert(p3.name().uri);
Answers:
var element = <Home>
<Room>
<Furniture>
<chair color=”Brown”/>
<Furniture>
</Room>
</Home>
Answers:
Answers:
Answers:
var xml = <body></body>;
xml.appendChild(“hello”);
Xml.appendChild(” world”);
xml.normalize();
alert(xml.children().length());
Answers:
var b = ‘Best of luck “Studentname & Roll no” for your exam’;
var el = <foo a={b}/>;
alert(el.toXMLString());
Answers:
Answers:
element = <xhtml:p xmlns:xhtml=”http://www.example.org”>Kibology
for all.</xhtml:p>;
elementName = element.name();
alert(elementName.localName); //1
alert(elementName.uri); // 2
Answers:
Answers:
Answers:
An arbitrary xml file can be loaded as an E4X ready object.
Answers:
element = <xhtml:p xmlns:xhtml=”http://www.example.org”>Kibology
for all.</xhtml:p>;
elementName = element.name();
alert(elementName.localName); //
alert(elementName.uri); //
Answers:
var f =
<foo>
<a>
text
</a>
<a>
<b/>
</a>
</foo>;
alert(f.a[0].hasComplexContent());// p
alert(f.a[1].hasComplexContent());//q
alert(f.a[0].hasSimpleContent());//r
alert(f.a[1].hasSimpleContent());//s
Answers:
Answers:
var customer = <customer>
<phone type=”mobile”>888-555-1212</phone>
<phone type=”office”>888-555-2121</phone>
<preferred>mobile</preferred>
</customer>;
alert(customer.childIndex());
Answers:
Code:
var e= <employee>
<name>Smith</name>
<designation>S/w Engineer</designation>
</employee>
e.prependChild(<prefix>Mr.</prefix>);
alert(e.toString());
Output:
<employee>
<prefix>Mr.</prefix>
<name>Smith</name>
<designation>S/w Engineer</designation>
</employee>
Answers:
Answers:
Answers:
Answers:
The QName.prototype.toString() method throws a TypeError exception if its value is not a QName object.
Answers:
Answers:
Answers:
Answers:
Answers:
var Emp = <Emp>
<name>Mark</name>
<likes>
<os>Linux</os>
<browser>Firefox</browser>
<language>JavaScript</language>
<language>Python</language>
</likes>
</Emp>
Answers:
Answers:
- isXMLName()
- isScopeNamespaces()
- namespaceDeclarations()
- removeNamespaces()
Answers:
- tab
- space
- Line feed
- enter
Answers:
- Namespace()
- Namespace(prefixValue)
- Namespace(uriValue)
- Namespace(prefixValue,uriValue)
var test =
<type name=”Joe”>
<base name=”Bob”></base>
example
</type>;
output:
<type name=”Joe”>
<base name=”Bob”/>
example
</type>
Answers:
- alert(test.toString());
- alert(test.toXMLString());
- alert(test.text());
- alert(test.elements());
Answers:
- TypeError exception
- The value is first converted to a string and then converted to an XMLList object.
- The value is converted to an XMLList object.
- The input value is returned unchanged.
var p1 = <p>Kibology for all.</p>;
alert(p1.name().uri);
default xml namespace = ‘http://www.w3.org/1999/xhtml’;
var p2 = <p>Kibology for all.</p>;
alert(p2.name().uri);
default xml namespace = ”;
var p3 = <p>Kibology for all.</p>;
alert(p3.name().uri);
Answers:
- ”,http://www.w3.org/1999/xhtml,”
- ”,”,”
- ”,http://www.w3.org/1999/xhtml,http://www.w3.org/1999/xhtml
- None of the above
var element = <Home>
<Room>
<Furniture>
<chair color=”Brown”/>
<Furniture>
</Room>
</Home>
Answers:
- element.chair.color=”light brown”
- element.chair.@color=”light brown”
- element..chair.@color=”light brown”
- element…chair.@color=”light brown”
Answers:
- localName()
- nodeKind()
- parent()
- valueOf()
Answers:
- =
- +
- +=
- =+
var xml = <body></body>;
xml.appendChild(“hello”);
Xml.appendChild(” world”);
xml.normalize();
alert(xml.children().length());
Answers:
- 1
- 2
- 3
var b = ‘Best of luck “Studentname & Roll no” for your exam’;
var el = <foo a={b}/>;
alert(el.toXMLString());
Answers:
- <foo a=”Best of luck “Studentname & Roll no” for your exam”/>
- <foo a=”Best of luck Studentname & Roll no for your exam”/>
- <foo a=”Best of luck “Studentname & Roll no” for your exam”/>
- <foo a=”Best of luck “Studentname & Roll no” for your exam”/>
Answers:
- 2
- 0
- 4
- 1
element = <xhtml:p xmlns:xhtml=”http://www.example.org”>Kibology
for all.</xhtml:p>;
elementName = element.name();
alert(elementName.localName); //1
alert(elementName.uri); // 2
Answers:
- 1-p,2-http://www.example.org
- 1-http://www.example.org,2-p
- 1-http://www.example.org,2-http://www.example.org
- 1-p,2-p
Answers:
- attributes()
- descendants([name])
- hasOwnProperty(propertyName)
- append()
Answers:
- volatile
- transient
- super
- version
- synchronized
An arbitrary xml file can be loaded as an E4X ready object.
Answers:
- True
- False
element = <xhtml:p xmlns:xhtml=”http://www.example.org”>Kibology
for all.</xhtml:p>;
elementName = element.name();
alert(elementName.localName); //
alert(elementName.uri); //
Answers:
- ignoreComments
- ignoreProcessingInstructions
- ignoreWhitespace
- All of the above
var f =
<foo>
<a>
text
</a>
<a>
<b/>
</a>
</foo>;
alert(f.a[0].hasComplexContent());// p
alert(f.a[1].hasComplexContent());//q
alert(f.a[0].hasSimpleContent());//r
alert(f.a[1].hasSimpleContent());//s
Answers:
- p-false,q-true,r-true,s-false
- p-true,q-false,r-false,s-true
- p-1,q-0,r-0,s-1
- p-0,q-1,r-1,s-0
Answers:
- E4X
- regex
- Generators and Iterators
- let
var customer = <customer>
<phone type=”mobile”>888-555-1212</phone>
<phone type=”office”>888-555-2121</phone>
<preferred>mobile</preferred>
</customer>;
alert(customer.childIndex());
Answers:
- 0
- 3
- NaN
- 2
Code:
var e= <employee>
<name>Smith</name>
<designation>S/w Engineer</designation>
</employee>
e.prependChild(<prefix>Mr.</prefix>);
alert(e.toString());
Output:
<employee>
<prefix>Mr.</prefix>
<name>Smith</name>
<designation>S/w Engineer</designation>
</employee>
Answers:
- e.insertChildAfter(null,<prefix>Mr.</prefix>);
- e.insertChildBefore(<prefix>Mr.</prefix>);
- b.e.insertChildAfter(null,<prefix>Mr.</prefix>);
- b.e.insertChildBefore(null,<prefix>Mr.</prefix>);
Answers:
- ignoreComments
- ignoreWhiteSpace
- setName()
- setNamespace()
- a and b
- c and d
Answers:
- If the value of the prefixValue parameter is undefined, the prefix is set to undefined.
- If the value is a valid XML name, the prefix property is set to a string.
- If the value is not a valid XML name, the prefix property is set to undefined.
- If a QName object is passed, the uri property is set to the value of the QName object’s uri property.
Answers:
- var languages = new XML(‘<languages type=”dynamic”><lang>JavaScript</lang><lang>Python</lang></languages>’);
- var languages XML = new XML(‘<languages type=”dynamic”><lang>JavaScript</lang><lang>Python</lang></languages>’);
- var languages = <languages type=”dynamic”> <lang>JavaScript</lang> <lang>Python</lang> </languages>;
- All of the above are correct.
- a and c
- b and c
The QName.prototype.toString() method throws a TypeError exception if its value is not a QName object.
Answers:
- True
- False
Answers:
- []
- ()
- {}
- <>
Answers:
- @
- ::
- #
- *
Answers:
- XML.prototype.function::methodName
- XML.prototype.function::[methodNameString]
- XML.prototype.method::[methodNameString]
Answers:
- delete xmlobject.child;
- delete xmlobject.child[0];
- delete xmlobject.@attribute;
- All of the above
var Emp = <Emp>
<name>Mark</name>
<likes>
<os>Linux</os>
<browser>Firefox</browser>
<language>JavaScript</language>
<language>Python</language>
</likes>
</Emp>
Answers:
- 11
- 5
- 7
- 12
No comments:
Post a Comment