XML Multiple choices


Total available count: 49
Subject - Web Development
Subsubject - XML

For the XML parser to ignore a certain section of your XML document, which syntax is correct?


 

 

 

 



C


Solution:-

<![CDATA[ Text to be ignored ]]> syntax is correct for the XML parser to ignore a certain section of your XML document.

An XML parser is a software library or a package that provides an interface for client applications to work with XML documents. It checks for the proper format of the XML document and may also validate the XML documents. The goal of a parser is to transform XML into readable code.

This example parses a text string into an XML DOM object, and extracts the info from it with JavaScript:

<html>
<body>

<p id="demo"></p>

<script>
var text, parser, xmlDoc;

text = "<bookstore><book>" +
"<title>Slightbook-1</title>" +
"<author>Slightbook Author</author>" +
"<year>2017</year>" +
"</book></bookstore>";

parser = new DOMParser();
xmlDoc = parser.parseFromString(text,"text/xml");

document.getElementById("demo").innerHTML =
xmlDoc.getElementsByTagName("title")[0].childNodes[0].nodeValue;
</script>

</body>
</html>

 




Next 5 multiple choice(s)

1

What is a correct way of referring to a stylesheet called "mystyle.xsl"?

2

What does XSL stand for?

3

XML attribute values must always be enclosed in quotes

4

Which is not the correct name for an XML element?

5

XML elements cannot be empty

Comments