XML Master Basic : Sample Questions

Here are some sample questions.

Section 1   XML Overview

Question 1.

Select which of the following is a correct description of SAX.

A. An interface handling XML documents via a tree structure
B. An interface processing XML documents using events
C. One of the schema definition languages that defines XML document structure
D. A specification for coding a method that selects a specific node from an XML document tree structure

Click here for the correct answer

>> Return to Sample Questions Index

Section 2   Creating XML Documents

Question 2.

Select which of the following is a valid XML document.

A.
<?xml version="1.0"?>
<!DOCTYPE rtelmnt[
<!ELEMENT rtelmnt (elmnt1,elmnt2?)+>
<!ELEMENT elmnt1 (#PCDATA)>
<!ELEMENT elmnt2 (#PCDATA)>
]>

<rtelmnt>
  <elmnt1></elmnt1>
  <elmnt2></elmnt2>
  <elmnt1></elmnt1>
  <elmnt2></elmnt2>
</rtelmnt>

B.
<?xml version="1.0"?>
<!DOCTYPE rtelmnt[
<!ELEMENT rtelmnt (elmnt1,elmnt2?)+>
<!ELEMENT elmnt1 (#PCDATA)>
<!ELEMENT elmnt2 (#PCDATA)>
]>

<rtelmnt>
</rtelmnt>

C.
<?xml version="1.0"?>
<!DOCTYPE rtelmnt[
<!ELEMENT rtelmnt (elmnt1*,elmnt2)?>
<!ELEMENT elmnt1 (#PCDATA)>
<!ELEMENT elmnt2 (#PCDATA)>
]>

<rtelmnt>
  <elmnt1></elmnt1>
  <elmnt2></elmnt2>
  <elmnt1></elmnt1>
  <elmnt2></elmnt2>
</rtelmnt>

D.
<?xml version="1.0"?>
<!DOCTYPE rtelmnt[
<!ELEMENT rtelmnt (elmnt1*,elmnt2)?>
<!ELEMENT elmnt1 (#PCDATA)>
<!ELEMENT elmnt2 (#PCDATA)>
]>

<rtelmnt>
</rtelmnt>

Click here for the correct answer

>> Return to Sample Questions Index

Section 3   DTD

Question 3.

Select which of the following is a DTD definition that best fulfills the following conditions.

Information for a multiple number of products coded within in one XML document. Character data can be coded for product names (element name: product). The product number must have a single, unique name (attribute name: partsno), and is verified as singular and unique by the XML parser. Characters such as # and @ must not be used in price information (attribute name: price) The default value for price (attribute name: price) is “open”. The “product” element must have a defined “partsno” attribute.

A.
<!ELEMENT pdata (product)>
<!ELEMENT product (#PCDATA)>
<!ATTLIST product partsno ID #IMPLIED>
<!ATTLIST product price CDATA "open">

B.
<!ELEMENT pdata (product)*>
<!ELEMENT product (#PCDATA)>
<!ATTLIST product partsno ID #IMPLIED>
<!ATTLIST product price CDATA "open">

C.
<!ELEMENT pdata (product)>
<!ELEMENT product (#PCDATA)>
<!ATTLIST product partsno ID #REQUIRED>
<!ATTLIST product price NMTOKEN "open">

D.
<!ELEMENT pdata (product)*>
<!ELEMENT product (#PCDATA)>
<!ATTLIST product partsno ID #REQUIRED>
<!ATTLIST product price NMTOKEN "open">

Click here for the correct answer

>> Return to Sample Questions Index

Section 4   XML Schema

Question 4.

Select which of the following incorrectly describes the structure defined by the following XML Schema.

[XML Schema]
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ProductItem" type="ProductType" />
  <xs:complexType name="ProductType">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="ProductCode" />
      <xs:element ref="ProductName" />
      <xs:element ref="ProductQuantity" />
      <xs:choice>
        <xs:element name="ProductPrice01" type="xs:string" />
        <xs:element name="ProductPrice02" type="xs:unsignedInt" />
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="LotCode" type="xs:string" use="required"/>
  </xs:complexType>
  <xs:element name="ProductCode" type="xs:string" />
  <xs:element name="ProductName" type="xs:string" />
  <xs:element name="ProductQuantity" type="xs:unsignedInt" />
</xs:schema>

A. The "ProductItem" element must include a "LotCode" attribute
B. The "ProductCode" element has no limitations as to the number of appearances
C. The order of appearance of the "ProductItem" element child element is random
D. Either the "ProductPrice01" element or the "ProductPrice02" element can be coded

Click here for the correct answer

>> Return to Sample Questions Index

Section 5   XSLT, XPath

Question 5.

Select which of the following correctly describes the location path for (1) in the XSLT stylesheet "b.xsl" created as output results from the XML document "a.xml" below.

[a.xml]
----------------------------
<?xml version="1.0"?>
<Exam>
  <Title>XML_Master_Exam</Title>
  <Information>
    <ExamName ExamNumber="I10-001">XML Master:Basic </ExamName>
    <ExamTime>60_Minutes</ExamTime>
    <Questions>50</Questions>
    <MinimumPass>at_least_70% correct</MinimumPass>
  </Information>
  <Information>
    <ExamName ExamNumber="I10-002">XML Master:Professional</ExamName>
    <ExamTime>90_Minutes</ExamTime>
    <Questions>40</Questions>
    <MinimumPass>at_least_80% correct</MinimumPass>
   </Information>
</Exam>
----------------------------

Output results
----------------------------
<test_info>
  <test_no>I10-001</test_no>
  <test_no>I10-002</test_no>
</test_info>
----------------------------

[b.xsl]
----------------------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <test_info>
      <xsl:apply-templates select="//MinimumPass"/>
    </test_info>
  </xsl:template>

  <xsl:template match="MinimumPass">
    <test_no>
      <xsl:value-of select="(1)"/>
    </test_no>
  </xsl:template>
</xsl:stylesheet>
----------------------------

A. /Exam/Information/ExamName[@ExamNumber]
B. /Exam/Information/ExamName/@ExamNumber
C. ../ExamName[@ExamNumber]
D. ../ExamName/@ExamNumber

Click here for the correct answer

>> Return to Sample Questions Index

Section 6   Namespace

Question 6.

For the XML document “src.xml”, select which of the following correctly describes the namespace to which the type attribute of the name element belongs.

[src.xml]
----------------------------
<?xml version="1.0"?>
<product xmlns="urn:trial:exam0">
  <Information>
    <name type="Oil" xmlns:depth="urn:trial:exam1">Ball_point_pen</name>
    <color>Black</color>
    <price>2_dollars</price>
  </Information>
</product>

A. Both urn:trial:exam0 and urn:trial:exam1
B. urn:trial:exam1
C. urn:trial:exam0
D. No namespace to which the type attribute belongs

Click here for the correct answer

>> Return to Sample Questions Index

Go To HOME