10 Xml And Related Technologies

Web Technology I · Unit 10

XML and Related Technologies

Exam-focused notes for XML and Related Technologies (Web Technology I, BIT251): what the TU syllabus asks and how it has actually been tested, with 13 solved past questions from this unit.

What this unit covers

  • XML definition and purpose
  • XML extensibility concept
  • XML elements and attributes
  • XML naming rules
  • XML namespaces and name conflict resolution
  • CDATA and PCDATA in DTD
  • DTD definition and syntax
  • XSD schema definition and validation
  • DTD versus XSD comparison
  • XPath query language
  • XQuery language and expressions
  • XSLT transformation to HTML

XML elements and attributes

208110 marks

Explain the XML syntax rules.Create a XML file that contains a root element named and “Office”. Inside this root element create four "Employee" elements. Each "Employee" element must contain a "Skills" element and it can contain up to Three "Skills" elements. Now create an XML file for this scenario and write XSD showing the use of minOccurrence and maxOccurrence indicators.[5+5]

--- (a) XML Syntax Rules XML (eXtensible Markup Language) follows strict syntax rules. The key rules are: All elements must be contained within a single root element. Unlike HTML, every opened tag must be properly closed. <Employee and <employee are treated...

Full solved answer →

XSLT transformation to HTML

20815 marks

Create a XML document with some elements and write equivalent XSLT to render XML content in HTML. [5]

--- --- ID Name Faculty Marks --------------------------------- 1 Ram Sharma CSIT 85 2 Sita Thapa BCA 90 3 Hari Poudel BIT 78 --- Element / Attribute Purpose ------ <?xml-stylesheet? Links the XML file to the XSLT stylesheet <xsl:stylesheet Root element of ...

Full solved answer →

XQuery language and expressions

20805 marks

What is Xquery? Given following XML, write an XQuery to retrieve the title of movies having budget greater than 500. Write result of the XQuery expression. [5]

XQuery is a query and functional language designed to query and transform XML data. It is to XML what SQL is to relational databases. XQuery is built on XPath expressions and can extract, filter, and restructure data from XML documents. Key features of XQue...

Full solved answer →

XML definition and purpose

20805 marks

What is the use of XML? Why is it called extensible, justify with example. [5]

XML (eXtensible Markup Language) is a markup language designed to store, transport, and describe data in a structured, human-readable, and machine-readable format. It is a W3C recommended standard. --- Use Description ------------------ Data Storage Stores ...

Full solved answer →
05 marks

What is the use of XML? Discuss the XML elements. [5]

XML (eXtensible Markup Language) is a markup language designed to store, transport, and describe data in a structured, human-readable, and machine-readable format. Unlike HTML, XML focuses on what data is, not how it looks. --- 1. Data Storage and Transport...

Full solved answer →

DTD versus XSD comparison

20805 marks

How DTD is different from XSD? [5]

Note: The reference notes did not contain this topic directly. The following answer is based on standard XML curriculum content appropriate for BSc CSIT. --- DTD is a set of rules/declarations that defines the structure and legal elements of an XML document...

Full solved answer →

XML extensibility concept

207910 marks

What is the meaning of extensible in XML? Mention the XML naming rules. Create an XML file containing an empty element with content, element with element, and element with attribute. Now write equivalent DTD.[10]

--- Extensible in XML means that users can define their own tags (elements) according to their needs. Unlike HTML, which has a fixed set of predefined tags, XML allows you to create custom markup languages tailored to any domain or application. Key points o...

Full solved answer →

XML namespaces and name conflict resolution

20795 marks

Justify with an example that how XML namespace provides a method to avoid name conflict. [5]

An XML Namespace is a mechanism that provides a way to avoid element name conflicts in XML documents by associating element and attribute names with a unique URI (Uniform Resource Identifier). It is declared using the reserved attribute xmlns. Syntax: --- C...

Full solved answer →

XSD schema definition and validation

20795 marks

Create a XMl file containing elements Username, Password. Write its XSD and set the restriction of the password must be minimum 4 characters and maximum 8 characters [5]

--- --- Component Purpose ------ xs:schema Root element of every XSD file xs:complexType Used because <login contains child elements xs:sequence Child elements must appear in order xs:simpleType Defines a custom simple type for Password xs:restriction base=...

Full solved answer →
2080.210 marks

What is the use of XML?, Given following XML, write XSD for validating the XML and also write XSLT to transform the XML into HTML file. The Name, and Address are string type, Number is integer and the Accessible is Boolean type. The child elements should appear in the order as below.[10]

--- XML (eXtensible Markup Language) is a markup language designed to store and transport data in a structured, human-readable, and machine-readable format. Key Uses of XML: Use Description ------------------ Data Storage Stores structured data independentl...

Full solved answer →
05 marks

Given following XML, write its equivalent XSD. [5]

Since no specific XML was provided in the question, I will use a standard example commonly used in TU BSc CSIT exams: --- --- Component Description ------ xs:schema Root element of every XSD document xs:element Declares an XML element with name and type xs:...

Full solved answer →

XPath query language

2080.25 marks

Discuss the use of XQuery and XPath in XML. [5]

Note: The reference notes did not contain material on this topic. The following answer is based on standard, correct computer science knowledge appropriate for BSc CSIT curriculum. --- XPath is a query language used to navigate through elements and attribut...

Full solved answer →

CDATA and PCDATA in DTD

05 marks

What is DTD? How can you use CDATA and PCDATA in DTD? [5]

DTD (Document Type Definition) is a set of rules or declarations that defines the structure, legal elements, attributes, and data types of an XML document. It acts as a blueprint or schema that specifies: - What elements are allowed in the document - How el...

Full solved answer →