19. Using XSLT, how would you extract the value of a specific attribute from an element in an XML document?
The components necessary for the above mentioned operation are as follows:
- The template element – Matches the correct XML element.
- The value-of element – Selects the attribute value.
- The optional apply-templates element – Allows continuous processing of the document
20. Which classes are supported to make an XML DOM?
The following are the different classes in the System.Xml namespace that make up the XML DOM:
- The XmlNode class
- The XmlDocument Class
- The XmlElement Class
- The XmlAttribute Class
- The XmlText class
- The XmlComment class
- The XmlNodeList Class
21. Which class is used to encode and decode XML names and contains different methods to convert between CLR types and XSD types.
The XmlConvert Class.
22. What is the DTD?
The DTD is Document Type Definition that describes the formation of the content of an XML document. The DTD manages the data to store in a consistent format. It defines the XML elements and attributes about how they should be present in XML documents and what relation they should have with other elements and attributes. The DTD also allows you to mention whether an XML element is optional or not. If the XML documents are not according to the DTD rules, they are not considered valid.
23. Is it true that the XML’s goal is to replace HTML?
No, it is not true. Both are necessary in their respective fields.
24. What is XSLT?
XSLT is Extensible Stylesheet Language Transformations that is a part of XML, which is a mechanism to transform an XML document into another XML or HTML document.
25. Describe the rules and regulations that must be followed while creating a well-formed XML document.
The following are the rules and regulations that are necessary to follow while creating a well-formed XML document:
- Every start tag must end with an end tag.
- A root element should be included for enclosing other child elements.
- XML tags are case-sensitive; therefore, start and end tags must be of same spelling and the casing should also be the same.
- XML’s empty tags are necessary to close with a forward slash (/).
- XML’s attributes values are necessary to enclose within double quotation marks.
- XML tags must be properly nested. It means starting tags should be closed in the reverse order in which they present.
26. What are the naming conventions required for XML elements tags?
The following are the naming conventions that need to be followed for XML elements tags:
- Element names should contain only characters, numbers, hyphens, and periods.
- Element names cannot not begin with a number or punctuation character.
- Element names must not start with the word xml (or XML, or Xml).
- Element names cannot consist spaces.
- Element names can be used any words except xml, XML, or Xml because no words are reserved in XML.
27. The XML preserves white spaces. Is it true?
Yes, it is true.
28. Explain the XML elements.
The elements are the central units of an XML document that explain and identify data. The elements are represented by the tags. You can also make your own tags, which make XML a user-friendly language. By creating custom meaningful elements, you can improve readability of the document. XML elements can be nested and the nested elements are known as child elements.
No comments:
Post a Comment