Sample Questions


In this section, I cover several sample questions—drawn from all covered subject areas—to give you a general idea of the kind of questions to expect on the exam.

XML basics

This is the easiest section of the examination, covering general XML questions about syntax and concepts including elements, attributes, namespaces, well-formedness, and document validation.

Questions

Q1. In this XML fragment: <bar:foo b=”a” c=”d”/>, what is the name of the element?

  1. bar:foo is the name of the element

  2. foo is the name of the element

  3. bar is the name of the element

  4. b is the name of the element

  5. None of the above

Q2. Consider the following XML document:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE bar SYSTEM "foo.dtd"> <bar> <a>Some Text</a> <b c="d" f=’e’/> <h> <!-- foo bar --> <g>More text</g> </h> </bar> <!-- foo bar -->

Which of the following statements is true?

  1. This file is invalid

  2. This file is not well formed

  3. bar is the root element of the document

  4. All of the above

  5. None of the above

Q3. What is the correct syntax for instructing an XML parser not to process any special characters, such as elements, attributes, or entities, in a specified section of an XML document?

  1. <PCDATA>Text goes here</PCDATA>

  2. <CDATA> Text goes here </CDATA>

  3. <!PCDATA[Text goes here]]>

  4. <![CDATA[Text goes here]]>

  5. None of the above

Answers

Question 1: The correct answer is (b), foo is the name of the element. The section on general XML editing and validation will most certainly contain at least two or three questions on namespaces. Furthermore, knowledge of namespaces is assumed in order for you to understand some of the questions on XML Schema. So if you don’t completely understand namespaces, you’ll be doubly whacked. Be sure to know your namespace syntax, including how to declare and prefix namespaces. Be sure you understand the rules governing the scoping of namespaces. A suggested exercise is to design an XML Schema that properly imports different schema components. Then practice editing and validating instance documents, first using qualified element default form, and then an unqualified element default form.

Question 2: The correct answer is (c), bar is the root element of the document. First, this question’ format — providing a small XML document and asking you to identify something inside the XML code — is a very common format for exam questions. Don’t be caught off guard by strange element names such as foo and bar. They are meaningless. This question tries to test your understanding of XML document structure; the key to getting this question right is to recall that comments, parsing instructions, CDATA, and a root element are all permitted to appear at the root level of an XML document.

Question 3: The correct answer is (d), <![CDATA[Text goes here]]>. As with many IT certification exams, it’s important to remember the basic XML syntax for important language constructs. Any content appearing within a CDATA block is treated as plain text, even if it contains special characters such as elements, attributes, or entities.

Document Type Definitions

The exam section on DTDs covers syntax, built-in element and attribute types, document type declarations, and entities. It also tests your ability to apply a simple DTD to visually perform a validation on simple instance documents.

Questions

Q1. What symbol is used to denote a parameter entity in a Document Type Definition?

  1. the * symbol

  2. the $ symbol

  3. the # symbol

  4. the @ symbol

  5. the % symbol

Q2. Consider the DTD fragment: <!ELEMENT bar (foo?)>. Which of the following statements is true?

  1. The foo element may occur zero or one time in the bar element

  2. The foo element may occur zero or more times in the bar element

  3. The foo element must occur one or more times in the bar element

  4. The foo element must occur only once in the bar element

  5. None of the above

Answers

Question 1: The correct answer is (e), the % symbol. A parameter entity can be differentiated from a general entity definition in a DTD by the presence of the % sign. You need to know how to declare and reference both general and parameter entities in DTDs.

Question 2: The correct answer is (a), The foo element may occur zero or one time in the bar element. Know your DTD occurrence operators by heart. This question can take time to read and think through. The best strategy for answering such a question is to immediately associate the question mark operator with an element occurrence that specifies 0 or 1 times. Then simply look for the answer among the choices.

XML Schema

XML Schema is the most heavily weighted topic (25 percent) on the Altova XMLSPY—XML Developer Certification examination. This is because XML Schema development is a necessary first step in architecting any XML development project, regardless of what server, application framework, programming language, or database you choose to build your application. The XML Schema questions cover important XML Schema concepts including differences between complex types and global elements, local and global elements, and important XML Schema language constructs. The XML Schema questions also cover the more advanced topics discussed in Chapter 5, including importing XML Schema components and object-oriented XML Schema design.

Questions

Q1. Which of the following XML Schema fragments defines an element called age where the lowest acceptable value is 0 and the highest acceptable value is 120?

  1. <xsd:element name="age" type="xsd:integer">    <xsd:minInclusive value="0"/>    <xsd:maxInclusive value="120"/> </xsd:element> 
  2. <xsd:element name=”age” type=”xsd:integer”>    <xsd:min value=”0”/>    <xsd:max value=”120”/> </xsd:element>
  3. <xsd:element name="age" type="xsd:integer">    <xsd:simpleType>       <xsd:minInclusive value="0"/>       <xsd:maxInclusive value="120"/>    </xsd:simpleType> </xsd:element>
  4. <xsd:element name="age">    <xsd:simpleType>       <xsd:restriction base="xsd:integer">          <xsd:minInclusive value="0"/>          <xsd:maxInclusive value="120"/>       </xsd:restriction>    </xsd:simpleType> </xsd:element>
  5. All of the above

Q2. Consider the following schema:

 <xsd:schema xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>    <xsd:element name=”foo”>       <xsd:complexType>          <xsd:sequence minOccurs=”2” maxOccurs=”10”>             <xsd:element name=”bar” type=”xsd:string”                                      minOccurs=”2” maxOccurs=”10”/>          </xsd:sequence>       </xsd:complexType>    </xsd:element> </xs:schema>

What can be said of the following instance document (assume that the XML Schema Validating Processor can locate the corresponding XML Schema file):

<foo> <bar>moo</bar> <bar>moo</bar> </foo> 
  1. The instance document is valid.

  2. The instance document is invalid.

  3. The instance document is not well formed.

  4. Impossible to tell / None of the above.

Q3. Consider the following XML Schema fragment:

<xs:element name=”foo”>   <xs:simpleType>     <xs:restriction base=”xs:string”>       <xs:pattern value=”\d{4}-[a-z]-[A-Z]{3}”/>     </xs:restriction>   </xs:simpleType> </xs:element>

Which of the following describes an acceptable range of values for the foo element?

  1. Four digits, followed by three uppercase or lowercase letters

  2. Four digits, followed by a hyphen, followed by a lowercase letter, followed by a hyphen, followed by three uppercase letters

  3. A slash followed by four instances of the letter d, followed by a lowercase letter, followed by three uppercase letters

  4. A slash followed by four digits, followed by a hyphen, followed by a lowercase letter, followed by three lowercase letters from a to z

  5. None of the above

Answers

Question 1: The correct answer is (d). You can assume that there will be questions asking you to define and derive simple types, as well as to define and derive complex types. These questions will either be in this format or the reverse: the component definition is given, and you must explain what has been defined.

Question 2: The correct answer is (b), The instance document is invalid. The element bar must occur a minimum of two times, but it is nested inside of a compositor that specifies a minimum occurrence of two times. Therefore, the net result is a multiplicative effect: bar must occur a minimum of four times in an instance document. The instance document is, therefore, invalid (bar appears only twice). You can be certain that the various compositors (sequence, choice, all) will be covered in the examination.

Question 3: The correct answer is (b) Four digits, followed by a hyphen, followed by a lowercase letter, followed by a hyphen, followed by three uppercase letters. This question requires an understanding of regular expressions, which are described in detail in Appendix C. Regular expressions are included in the exam because they are a very frequently used means for constraining the value space of string types.

XSL/XSLT

Questions on XSL/XSLT focus on stylesheet flow control, variables, data types, and templates; the section includes questions on XSL/XSLT syntax, and questions which ask you to determine the output, given a specified input document and stylesheet.

Questions

Q1. Which element allows you to iterate through a node-set in XSLT?

  1. xsl:while

  2. xsl:loop

  3. xsl:for-each

  4. xsl:repeat

  5. xsl:for

Q2: How is a variable called foo referenced in XSLT?

  1. #foo

  2. $foo

  3. {foo}

  4. (foo)

  5. %foo

Answers

Question 1: The correct answer is (c) xsl:for-each. There are numerous questions regarding syntax of XSL language constructs and so these kinds of questions are pretty much a giveaway. Where it gets tricky is that more advanced questions assume you understand these language constructs. You will be asked to mentally perform an XSLT transformation; and the specified stylesheet will, of course, use many of the basic XSLT language constructs.

Question 2: The correct answer is (b) $foo. The $ symbol is used to reference variables in XSLT. Again, it is imperative that you understand how to declare a variable, assign it to a parameter, and use the parameter in invoking (or calling) a specific template by name.

XPath

The XPath section is a section for picking up easy questions quickly. Most of the questions are XPath expressions that you need to evaluate in your head. Other questions are the reverse. They ask you to take an XML document and give the XPath expression to retrieve a specified node-set. The recommended exercise to study for this section is to use the XMLSPY XPath Analyzer to visualize node-sets resulting from XPath expressions. Be sure to know both the shorthand and complete ways of specifying an axis and the most common XPath functions, and data types.

Questions

Q1. Which XPath pattern selects all children nodes of the current node?

  1. //* selects all children of the current node

  2. // selects all children of the current node

  3. .. selects all children of the current node

  4. $ selects all children of the current node

  5. * selects all children of the current node

Q2. Which XPath expression selects all foo nodes with a moo attribute equal to bar?

  1. //foo[moo=’bar’]

  2. //foo[@moo=’bar’]

  3. //foo/[moo=’bar’]

  4. //foo/moo/[@=’bar’]

  5. //foo/moo/[‘bar’]

Answers

Question 1: The correct answer is (e), * selects all children of the current node. This is a simple question—just memorize the various selection operators and you can pick up some easy points.

Question 2: The correct answer is (b), //foo[@moo=’bar’]. Again, all that is required to answer this question is an understanding of how to specify axis and predicates.

WSDL

WSDL questions cover both concepts and syntax, although this section is more weighted in concepts relative to other sections. For example, consider the following two conceptual questions:

Questions

Q1. In WSDL a notification is defined as:

  1. An operation that sends a message without waiting for a response

  2. An operation that sends a message and waits for a response

  3. An operation that can receive a message without sending a response

  4. None of the above

Q2. Compared to a conventional programming language the WSDL portType element is roughly the same as:

  1. A function library or package

  2. A function or method

  3. A variable

  4. A function or method parameter

  5. None of the above

Answers

Question 1: The correct answer is (a), An operation that sends a message without waiting for a response. Recall from the discussion on WSDL in Chapter 8 that you can describe various types of method invocations.

Question 2: The correct answer is (a) A function library or package. Again, this question tests your understanding of WSDL concepts.




The XMLSPY Handbook
The Official XMLSPY Handbook
ISBN: 764549642
EAN: 2147483647
Year: 2001
Pages: 121
Authors: Larry Kim

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net