0% found this document useful (0 votes)
6 views19 pages

I10 002 Export

The document contains a series of questions and answers related to XML, DOM, SAX, and XSLT processing. It covers topics such as the DOM Node interface, SAX parser methods, and XSLT transformations with specific XML documents. Each question is followed by the correct answer, indicating the expected knowledge in XML technologies.

Uploaded by

MCP Mark
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views19 pages

I10 002 Export

The document contains a series of questions and answers related to XML, DOM, SAX, and XSLT processing. It covers topics such as the DOM Node interface, SAX parser methods, and XSLT transformations with specific XML documents. Each question is followed by the correct answer, indicating the expected knowledge in XML technologies.

Uploaded by

MCP Mark
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 19

XML I10-002

Version

QUESTION NO: 1
Which of the following correctly describes the DOM (Level 2) Node interface?

A. The Node interface can be used to change the value (nodeValue) of the DOM
element node (Element)
B. The Node interface can be used to change the name (nodeName) of the DOM element
node (Element)
C. The Node interface can be used to change the value (nodeValue) of the DOM
attribute node (Attr)
D. The Node interface can be used to change the name (nodeName) of the DOM
attribute node (Attr)
Answer: C

QUESTION NO: 2
Select the following DOM (Level 2) methods that can add an attribute node (Attr) to
an element node (Element). (Multiple answers possible. Select two.)

A. appendChild
B. hasAttribute
C. setAttribute
D. setAttributeNode
Answer: C,D

QUESTION NO: 3
Which of the following describes the most correct call order of the ContentHandler
interface methods when parsing the following "XML Document" using a validating SAX
parser? This question reflects line feeds within the XML Document. [XML Document]
<?xml version="1.0"?> <!DOCTYPE a [ <!ELEMENT a (#PCDATA | b)*> <!ELEMENT b
(#PCDATA)> ]> <a> <b>c</b> </a>

A. startDocument - startElement - ignorableWhitespace - startElement - characters -


endElement - ignorableWhitespace -
endElement - endDocument
B. startDocument - startElement - characters - startElement - characters -
endElement - characters - endElement -
endDocument
C. startDocument - startElement - startElement - characters - endElement -
endElement - endDocument
D. startDocument - startElement - startElement - characters - endElement -
ignorableWhitespace - endElement -
endDocument
Answer: B

QUESTION NO: 4
Under the SAX specification, which of the following is a method for determining
whether to validate a document with the SAX parser?

A. Use the getFeature method of XMLReader interface to look up the feature value
under the name
"http://xml.org/sax/features/validation"
B. Use the parse method of XMLReader interface to investigate whether an error
occurs
C. Use the parseWithValidating method of XMLReader interface
D. Use the isValidatingParser method of XMLReader interface
Answer: A

QUESTION NO: 5
When processing the following "XML Document" according to the method shown by "SAX
Processing," which of the following correctly describes the output results (print
method output)? [XML Document] <doc><content>East<![CDATA[&]]>West</content></doc>
[SAX Processing] Use the following "ContentHandlerImpl" class, and parse the XML
Document using SAX. Assume no execution errors. class ContentHandlerImpl extends
DefaultHandler { public void characters(char[] ch, int start, int length) throws
SAXException { System.out.print(new String(ch, start, length)); }

A. East<![CDATA[&]]>West
B. East&West
C. EastWest
D. East
Answer: B

QUESTION NO: 6
Process the following "XML Document" according to the method shown by "DOM
Processing," and output "article" (by print method). Select which of the following
correctly describes what should be in (1) for "DOM Processing" [XML Document]
<content>article</content> [DOM Processing] Process XML using the following method.
printXML( doc ); The variable doc here references the Document instance of the
loaded XML document. public static void printXML( Document doc ) { Element content
= doc.getDocumentElement(); System.out.print( ------(1)------ ); }

A. content.getText()
B. content.getNodeValue()
C. content.getChildNode().getNodeValue()
D. content.getFirstChild().getNodeValue()
Answer: D

QUESTION NO: 7
Push the Exhibit Button to load the referenced "XML Document," and process XML
using "DOM Processing". Select which of the following is the most appropriate
expression of the results under XML 1.0. Line feeds and/or indents are not
reflected in the results. [DOM Processing] Process XML using the following method.
Document output = updateXML( doc ); The variable doc here references the Document
instance of the loaded XML Document. The DOM parser is namespace aware. Assume no
execution errors. public static Document updateXML( Document doc ) { Node data1 =
doc.getElementsByTagNameNS("urn:xmlmaster:EX", "data1").item(0); Node data2 =
doc.getElementsByTagNameNS("urn:xmlmaster:EX", "data2").item(0); data2.appendChild(
data1 ); return doc; }

A. <root xmlns="urn:xmlmaster:EX">
<data1>string value</data1>
<ns:data2 xmlns:ns="urn:xmlmaster:EX">
<data1>string value</data1>
</ns:data2>
</root>
B. <root xmlns="urn:xmlmaster:EX">
<data1>string value</data1>
<data2>
<data1>string value</data1>
</data2>
</root>
C. <root xmlns="urn:xmlmaster:EX">
<ns:data2 xmlns:ns="urn:xmlmaster:EX" xmlns="">
<data1 xmlns="urn:xmlmaster:EX">string value</data1>
</ns:data2>
</root>
D. <root xmlns="urn:xmlmaster:EX">
<data2>
<data1>string value</data1>
</data2>
</root>
Answer: C

QUESTION NO: 8
When processing the following "XML Document" according to the method shown by "DOM
Processing," which of the following correctly describes the output results (print
method output)? [XML Document]
<doc><content>Today's<bold>"hot"</bold>news</content></doc> [DOM Processing]
Process XML using the following method. printXML( doc ); The variable doc here
references the Document instance of the loaded XML Document. Assume no execution
errors. public static void printXML( Document doc ) { Element content =
(Element)doc.getDocumentElement().getFirstChild(); NodeList nl =
content.getChildNodes(); System.out.print( nl.getLength() ); Element bold =
(Element)content.getElementsByTagName( "bold" ).item(0);
content.removeChild( bold ); System.out.print( nl.getLength() ); }

A. 44
B. 43
C. 42
D. 33
E. 32
F. 31
Answer: E

QUESTION NO: 9
Push the Exhibit Button to load the referenced "XML Document 1" and "XML Document
2," and process XML using "DOM Processing". Select which of the following is the
most appropriate expression of the results under XML 1.0. Line feeds and/or indents
are not reflected in the results. [DOM Processing] Process XML using the following
method. Document output = updateXML( doc1, doc2 ); The variable doc1 here
references the Document instance of the loaded "XML Document 1". The variable doc2
here references the Document instance of the loaded "XML Document 2". The DOM
parser is namespace aware. Assume no execution errors. public static Document
updateXML( Document doc1, Document doc2 ) { String NS = "urn:xmlmaster:EX1";
Element data = (Element)doc1.getElementsByTagNameNS(NS, "data").item(0); Attr info
= data.getAttributeNodeNS(NS, "info"); Attr imported = (Attr)doc2.importNode(info,
true); doc2.getDocumentElement().setAttributeNodeNS( imported ); return doc2; }

A. <ns:root2 xmlns:ns="urn:xmlmaster:EX2"
ns:info="value" xmlns:ns="urn:xmlmaster:EX1" />
B. <ns:root2 NS1:info=""
xmlns:ns="urn:xmlmaster:EX2" xmlns:NS1="urn:xmlmaster:EX1" />
C. <ns:root2 NS1:info="value"
xmlns:ns="urn:xmlmaster:EX2" xmlns:NS1="urn:xmlmaster:EX1" />
D. <ns:root2 ns:info="value" xmlns:ns="urn:xmlmaster:EX2" />
Answer: C
QUESTION NO: 10
Push the Exhibit Button to load the referenced "XML document". Assume that the "XML
Document" is changed to the "Results XML Document." Select which XSLT style sheet
correctly performs the transformation. Note that the XSLT processor can output
transformation results as a document. [Results XML Document]
<ZZZ><YYY>lmnop</YYY></ZZZ>

A. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:include href="exam.xsl" />
<xsl:template match="/">
<xsl:apply-templates select="root" />
</xsl:template>
<xsl:template match="root">
<AAA><BBB><xsl:value-of select="data" /></BBB></AAA>
</xsl:template>
</xsl:stylesheet>
[exam.xsl]
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="//root">
<ZZZ><YYY><xsl:value-of select="data" /></YYY></ZZZ>
</xsl:template>
</xsl:stylesheet>
B. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="exam.xsl" />
<xsl:template match="/">
<xsl:apply-templates select="root" />
</xsl:template>
<xsl:template match="root">
<AAA><BBB><xsl:value-of select="data" /></BBB></AAA>
</xsl:template>
</xsl:stylesheet>
[exam.xsl]
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="//root">
<ZZZ><YYY><xsl:value-of select="data" /></YYY></ZZZ>
</xsl:template>
</xsl:stylesheet>
C. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="exam.xsl" />
<xsl:template match="/">
<xsl:apply-templates select="root" />
</xsl:template>
<xsl:template match="root"> <xsl:template match="root">
<AAA><BBB><xsl:value-of select="data" /></BBB></AAA> <AAA><BBB><xsl:value-of
select="data" /></BBB></AAA>
</xsl:template>
</xsl:stylesheet>
[exam.xsl]
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="root">
<ZZZ><YYY><xsl:value-of select="data" /></YYY></ZZZ> <ZZZ><YYY><xsl:value-of
select="data" /></YYY></ZZZ>
</xsl:template>
</xsl:stylesheet>
D. <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">D.<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="exam.xsl" />
<xsl:template match="/"> <xsl:template match="/">
<xsl:apply-templates select="root" /> <xsl:apply-templates select="root" />
</xsl:template>
<xsl:template match="root"> <xsl:template match="root">
<AAA><BBB><xsl:value-of select="data" /></BBB></AAA>
</xsl:template>
</xsl:stylesheet>
[exam.xsl]
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="root"> <xsl:template match="root">
<ZZZ><YYY><xsl:value-of select="data" /></YYY></ZZZ> <ZZZ><YYY><xsl:value-of
select="data" /></YYY></ZZZ>
</xsl:template>
</xsl:stylesheet>
Answer: A

QUESTION NO: 11
Which of the following text strings is not output to the results document when
performing an XSLT transformation on the following "XML Document" using the "XSLT
Style Sheet" below? Note that the XSLT processor can output transformation results
as a document. [XML Document] <doc NS1:title="Title"
xmlns="http://www.xmlmaster.org/exam" xmlns:NS1="http://www.xmlmaster.org/exam">
<body NS1:section="value" xmlns=""> <NS1:content>Content</NS1:content> </body>
</doc> [XSLT Style Sheet] <stylesheet version="1.0"
xmlns="http://www.w3.org/1999/XSL/Transform"
xmlns:NS1="http://www.xmlmaster.org/exam"> <output method="text" /> <template
match="/"> <apply-templates select="descendant::*/attribute::NS1:* |
descendant::NS1:*"/> </template> <template match="* | attribute::*"><value-of
select="name()"/>,</template> </stylesheet>

A. doc
B. NS1:title
C. body
D. NS1:section
E. NS1:content
Answer: C

QUESTION NO: 12
Push the Exhibit Button to load the referenced "XML Document". Assume that the
character "3" is obtained from the "XML document". Select which XSLT style sheet
correctly performs the transformation. (Multiple answers possible. Select two.)

A. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:template match="/">
<xsl:apply-templates select="//data[x='1'][y='2']"/>
</xsl:template>
</xsl:stylesheet>
B. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="//data[(attribute::x='1') and (text()='3')]"/>
</xsl:template>
</xsl:stylesheet>
C. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="//data[self='3']"/>
</xsl:template>
</xsl:stylesheet>
D. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="//data[self::*='3']"/>
</xsl:template>
</xsl:stylesheet>
Answer: B,D

QUESTION NO: 13
Which of the following correctly describes the output results when performing an
XSLT tranformation on the following "XML Document" using the "XSLT Style Sheet"
below? Note that the XSLT processor can output transformation results as a
document. [XML Document] <data xml:lang="en">Tokyo</data> [XSLT Style Sheet]
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <xsl:apply-templates select="data" /> </xsl:template>
<xsl:template match="data"> <xsl:copy> <xsl:apply-templates select="."
mode="processLang" /> <xsl:value-of select="." /> </xsl:copy> </xsl:template>
<xsl:template match="*" mode="processLang"> <xsl:choose> <xsl:when
test="@xml:lang"> <xsl:copy-of select="@xml:lang" /> </xsl:when> <xsl:otherwise>
<xsl:attribute name="xml:lang">ja-JP</xsl:attribute> </xsl:otherwise> </xsl:choose>
</xsl:template> </xsl:stylesheet>

A. <data/>
B. <data>Tokyo</data>
C. <data xml:lang="en">Tokyo</data>
D. <data xml:lang="ja-JP">Tokyo</data>
Answer: C

QUESTION NO: 14
Push the Exhibit Button to load the referenced "XSLT Style Sheet". Select which of
the following correctly describes the output results of an XSLT transformation of
the "XML Document" using the "XSLT Style Sheet". Note that the XSLT processor can
output transformation results as a document. Line feeds and indents are not
reflected. [XML Document] <root xmlns="urn:xmlmaster:A"> <data>89</data>
<data>70</data> </root>

A. <record>
<data value="89"/>
<data value="70"/>
</record>
B. <record xmlns="urn:xmlmaster:B">
<data value="89"/>
<data value="70"/>
</record>
C. <record xmlns="urn:xmlmaster:B">
<data B:value="89" xmlns:B="urn:xmlmaster:B"/>
<data B:value="70" xmlns:B="urn:xmlmaster:B"/>
</record>
D. <record>
<data value="89" xmlns="urn:xmlmaster:A"/>
<data value="70" xmlns="urn:xmlmaster:A"/>
</record>
E. <record>
<data B:value="89" xmlns="urn:xmlmaster:A" xmlns:B="urn:xmlmaster:B"/>
<data B:value="70" xmlns="urn:xmlmaster:A" xmlns:B="urn:xmlmaster:B"/>
</record>
Answer: B

QUESTION NO: 15
Push the Exhibit Button to load the referenced "testml.xsd". Assume that
"testml.xsd" is defined. Without rewriting this XML Schema Document ("testml.xsd"),
create a new, separate XML Schema Document to partially change the schema
definition to write a cellPhone element as a child element of the person element.
As a result, the following "XML Document" will be valid against the new schema.
Which of the following correctly describes the new XML Schema Document? Assume the
XML parser correctly processes the XML schema schemaLocation attribute. [XML
Document] <TestML> <person> <name>John Smith</name> <phone>03-0000-9999</phone>
<cellPhone>000-1111-2222</cellPhone> </person> </TestML> A<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import schemaLocation="testml.xsd"
/> <xs:complexType name="personType"> <xs:sequence> <xs:element ref="name" />
<xs:element ref="phone" /> <xs:element ref="cellPhone" /> </xs:sequence>
</xs:complexType> <xs:element name="cellPhone" type="xs:string" /> </xs:schema>
B<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:include
schemaLocation="testml.xsd" /> <xs:complexType name="newPersonType"
substitutionGroup="personType"> <xs:sequence> <xs:element ref="name" /> <xs:element
ref="phone" /> <xs:element ref="cellPhone" /> </xs:sequence> </xs:complexType>
<xs:element name="cellPhone" type="xs:string" /> </xs:schema> C<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:redefine
schemaLocation="testml.xsd"> <xs:complexType name="personType"> <xs:complexContent>
<xs:extension base="personType"> <xs:sequence> <xs:element ref="cellPhone" />
<xs:element ref="cellPhone" /> </xs:sequence> </xs:extension> </xs:complexContent>
</xs:complexType> </xs:redefine> <xs:element name="cellPhone" type="xs:string" />
<xs:element name="cellPhone" type="xs:string" /> </xs:schema> DIt is not possible
to implement a function of the type proposed.DIt is not possible to implement a
function of the type proposed.DIt is not possible to implement a function of the
type proposed.

Answer:

QUESTION NO: 16
Push the Exhibit Button to load the referenced "XML Document". Create an XML Schema
Document for "XML Document". The definitions of this XML Schema Document require
that the value of the level element must be singularly unique within the XML
Document. Which of the following correctly describes the XML Schema Document?
A<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="TestML"
type="testmlType"> <xs:unique name="levelUnique"> <xs:selector xpath="record/level"
/> <xs:field xpath="record/level" /> </xs:unique> </xs:element> <xs:complexType
name="testmlType"> <xs:sequence> <xs:element ref="record" maxOccurs="unbounded" />
</xs:sequence> </xs:complexType> <xs:element name="record" type="recordType" />
<xs:complexType name="recordType"> <xs:sequence> <xs:element ref="level" />
<xs:element ref="data" /> </xs:sequence> </xs:complexType> <xs:element
name="level" type="xs:int" /> <xs:element name="data" type="xs:int" /> </xs:schema>
B<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="TestML"
type="testmlType"> <xs:unique name="levelUnique"> <xs:selector xpath="record" />
<xs:field xpath="level" /> </xs:unique> </xs:element> <xs:complexType
name="testmlType"> <xs:sequence> <xs:element ref="record" maxOccurs="unbounded" />
</xs:sequence> </xs:complexType> <xs:element name="record" type="recordType" />
<xs:complexType name="recordType"> <xs:sequence> <xs:element ref="level" />
<xs:element ref="data" /> </xs:sequence> </xs:complexType> <xs:element
name="level" type="xs:int" /> <xs:element name="data" type="xs:int" /> </xs:schema>
C<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">C<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema">C<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="TestML"
type="testmlType" /> <xs:complexType name="testmlType"> <xs:sequence> <xs:element
ref="record" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:element
name="record" type="recordType"> <xs:unique name="levelUnique"> <xs:selector
xpath="level" /> <xs:field xpath="level" /> </xs:unique> </xs:element>
<xs:complexType name="recordType"> <xs:sequence> <xs:element ref="level" />
<xs:element ref="data" /> </xs:sequence> </xs:complexType> <xs:element
name="level" type="xs:int" /> <xs:element name="data" type="xs:int" /> </xs:schema>
D<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">D<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema">D<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="TestML"
type="testmlType" /> <xs:complexType name="testmlType"> <xs:sequence> <xs:element
ref="record" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:element
name="record" type="recordType"> <xs:unique name="levelUnique"> <xs:selector
xpath="level" /> <xs:field xpath="." /> </xs:unique> </xs:element> <xs:complexType
name="recordType"> <xs:sequence> <xs:element ref="level" /> <xs:element
ref="data" /> </xs:sequence> </xs:complexType> <xs:element name="level"
type="xs:int" /> <xs:element name="data" type="xs:int" /> </xs:schema>

Answer:

QUESTION NO: 17
Push the Exhibit Button to load the referenced "XML Document". Choose the XML
Schema Document that correctly defines the structure of "XML Document".

A. <xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:xmlmaster:testml"
xmlns:tns="urn:xmlmaster:testml">

<xs:element name="TestML" type="tns:testmlType" />


<xs:complexType name="testmlType">
<xs:sequence>
<xs:element ref="tns:record" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>

<xs:element name="record" type="tns:recordType" />


<xs:complexType name="recordType">
<xs:attribute name="level" type="xs:int" />
<xs:attribute name="data" type="xs:int" />
</xs:complexType>
</xs:schema>
B. <xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:xmlmaster:testml"
xmlns:tns="urn:xmlmaster:testml">

<xs:element name="TestML" type="tns:testmlType" />


<xs:complexType name="tns:testmlType">
<xs:sequence>
<xs:element ref="tns:record" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>

<xs:element name="record" type="tns:recordType" />


<xs:complexType name="tns:recordType">
<xs:attribute ref="tns:level" />
<xs:attribute ref="tns:data" />
</xs:complexType>
<xs:attribute name="tns:level" type="xs:int" />
<xs:attribute name="tns:data" type="xs:int" />
</xs:schema>
C. <xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:xmlmaster:testml"
xmlns:tns="urn:xmlmaster:testml">

<xs:element name="TestML" type="tns:testmlType" /> <xs:element name="TestML"


type="tns:testmlType" />
<xs:complexType name="testmlType">
<xs:sequence>
<xs:element ref="tns:record" maxOccurs="unbounded" /> <xs:element
ref="tns:record" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>

<xs:element name="record" type="tns:recordType" /> <xs:element name="record"


type="tns:recordType" />
<xs:complexType name="recordType"> <xs:complexType name="recordType">
<xs:attribute ref="tns:level" /> <xs:attribute ref="tns:level" />
<xs:attribute ref="tns:data" /> <xs:attribute ref="tns:data" />
</xs:complexType>
<xs:attribute name="level" type="xs:int" />
<xs:attribute name="data" type="xs:int" /> <xs:attribute name="data" type="xs:int"
/>
</xs:schema>
D. <xs:schemaD.<xs:schemaD.<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:xmlmaster:testml" targetNamespace="urn:xmlmaster:testml"
xmlns:tns="urn:xmlmaster:testml"> xmlns:tns="urn:xmlmaster:testml">

<xs:element name="TestML"> <xs:element name="TestML">


<xs:complexType>
<xs:sequence>
<xs:element name="record" maxOccurs="unbounded"> <xs:element name="record"
maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="tns:level" type="xs:int" /> <xs:attribute
name="tns:level" type="xs:int" />
<xs:attribute name="tns:data" type="xs:int" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Answer: C

QUESTION NO: 18
Select a valid XML Document against the "XML Schema" referenced when the Exhibit
Button is pushed. A<TestML xmlns="urn:xmlmaster:testml"> <scenario level="1"
data="100"> <title>Prologue</title> <content>Long long ago...</content> </scenario>
</TestML> B<TestML xmlns="urn:xmlmaster:testml"> <scenario level="1" data="100">
<title xmlns="">Prologue</title> <content xmlns="">Long long ago...</content>
</scenario> </TestML> C<TestML xmlns="urn:xmlmaster:testml"
xmlns:tns="urn:xmlmaster:testml"> <scenario tns:level="1" tns:data="100">
<title>Prologue</title> <content>Long long ago...</content> </scenario> </TestML>
D<TestML xmlns="urn:xmlmaster:testml" xmlns:tns="urn:xmlmaster:testml"> <scenario
tns:level="1" tns:data="100"> <title xmlns="">Prologue</title> <content
xmlns="">Long long ago...</content> </scenario> </TestML>

Answer:

QUESTION NO: 19
Select which of the following correctly describes the results of performing a
validation check on "XML Document". Assume that the XML parser correctly processes
the XML Schema schemaLocation attribute. [XML Document] <TestML
xmlns="urn:xmlmaster:testml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:xmlmaster:testml testml.xsd"> <record level="1"
data="100" /> <record level="2" data="250" /> </TestML> [testml.xsd] <xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:xmlmaster:testml"
xmlns:tns="urn:xmlmaster:testml"> <xs:import namespace="urn:xmlmaster:testml"
schemaLocation="record.xsd" /> <xs:element name="TestML" type="tns:testmlType" />
<xs:complexType name="testmlType"> <xs:sequence> <xs:element ref="tns:record"
maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> </xs:schema> [record.xsd]
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="record"
type="recordType" /> <xs:complexType name="recordType"> <xs:attribute name="level"
type="xs:int" /> <xs:attribute name="data" type="xs:int" /> </xs:complexType>
</xs:schema>

A. Valid
B. The coding for the XML Schema Document is not appropriate; therefore, an error
is thrown (initial error) when
procesing the "testml.xsd" import element
C. The coding for the XML Schema Document is not appropriate; therefore, an error
is thrown (initial error) when
procesing the "testml.xsd" "<xs:element ref="tns:record" maxOccurs="unbounded" />"
D. No processing error, but is not valid.
Answer: B

QUESTION NO: 20
Which of the following correctly explains SOAP (SOAP 1.1) and schema?

A. By including a document type declaration in the SOAP message, you can perform a
validation check on the XML Document
included in the SOAP Body element
B. You cannot perform a validation check on the XML Document included in the SOAP
Body element
C. An XML Document encoded according to the encoding method (SOAP Encoding) defined
under the SOAP 1.1 specification can
only be validated against W3C XML Schema
D. A SOAP message cannot include a DTD; however, other XML coded Schema Documents
can be included as a part of the XML
Answer: D

QUESTION NO: 21
Which of the following fault codes is defined in SOAP specification 1.1? (Multiple
answers possible. Select two.)

A. MustUnderstand
B. RequiredElement
C. Server
D. SyntaxError
Answer: A,C

QUESTION NO: 22
Which of the following correctly describes the results of normalizing the following
XML Document rec element by Exclusive XML Canonicalization? [XML Document] <a:root
xmlns:a="urn:xmlmaster:a"> <b:rec xmlns:b="urn:xmlmaster:b"> <b:field /> </b:rec>
</a:root>

A. <b:rec xmlns:a="urn:xmlmaster:a" xmlns:b="urn:xmlmaster:b">


<b:field></b:field>
</b:rec>
B. <b:rec xmlns:b="urn:xmlmaster:b">
<b:field></b:field>
</b:rec>
C. <b:rec xmlns:a="urn:xmlmaster:a"
xmlns:b="urn:xmlmaster:b"><b:field></b:field></b:rec>
D. <b:rec xmlns:b="urn:xmlmaster:b"><b:field></b:field></b:rec>
Answer: B

QUESTION NO: 23
Which of the following is a correct statement about XML security?

A. To encrypt an XML document using XML Encryption, the XML document must already
have been normalized (normalization
via Canonical XML, etc.)
B. To attach a digital signature to an XML document using XML-Signature, the XML
document must already have been
normalized (normalized via Canonical XML, etc.)
C. SSL cannot be used as security when sending an XML document
D. To encrypt an XML document using XML Encryption, character encoding for the XML
document must be UTF-16
Answer: B

QUESTION NO: 24
Which of the following does not correctly describe WSDL (WSDL 1.1)?

A. Under the WSDL definition, you can use the import element to import another WSDL
definition
B. You do not need to specify a binding element when creating a WSDL definition
C. When a service operation is a "One-way" type, you can specify a fault element to
designate the error message type as
the child element of the operation element within the protType element
D. When a service operation is a "Request-response" type, you can specify a fault
element to designate the error message
type as the child element of an operation element within the portType element
Answer: C

QUESTION NO: 25
Which of the following correctly describes a WSDL (WSDL 1.1) definition defining a
certain service specification? <definitions name="Example"
targetNamespace="http://xmlmaster.org/example/wsdl"
xmlns:tns="http://xmlmaster.org/example/wsdl"
xmlns:xsd="http://xmlmaster.org/example/xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> <schema
targetNamespace="http://xmlmaster.org/example/xsd"
xmlns="http://www.w3.org/2001/XMLSchema"> <element name="Document"> <complexType>
<sequence> <element name="Title" type="string"/> <element name="Content"
type="string"/> </sequence> </complexType> </element> </schema> </types> <message
name="ProcessDocumentMessage"> <part name="body" element="xsd:Document"/>
</message> <portType name="ExamplePortType"> <operation name="ProcessDocument">
<input message="tns:ProcessDocumentMessage"/> </operation> </portType> <binding
name="ExampleSoapBinding" type="tns:ExamplePortType"> <soap:binding
style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation
name="ProcessDocument"> <soap:operation soapAction=""/> <input> <soap:body
use="literal"/> </input> </operation> </binding> </definitions>

A. The service operation is a "Request-response" type


B. The service operation is RPC oriented, and either a parameter or return value is
included in the SOAP message
C. HTTP protocol is used to send the SOAP message to the service sideC.HTTP
protocol is used to send the SOAP message to the service side
D. The service side URL (endpoint URL) is specified to send the SOAP messageD.The
service side URL (endpoint URL) is specified to send the SOAP message
Answer: C

QUESTION NO: 26
Which of the following is clearly an unnecessary step in procedures to create
digital signature via XML-Signature?

A. Prepare a key for signing


B. Normalize the subject of the signature (normalization via Canonical XML, etc.)
C. Remove namespaces in the subject of the signature
D. Calculate a digest of the subject of the signature
Answer: C

QUESTION NO: 27
Which of the following is incorrect with respect to XML?

A. An XML document features high data readability


B. An XML document can be transmitted over general-use protocols such as HTTP and
SMTP
C. XML is designed with the ideal structure for storage in an RDB (relational
database)
D. Some RDBs (relational databases) can output results data in XML format
Answer: C

QUESTION NO: 28
Select which of the following correctly describes the message reception processing
circumstances when a well-formed XML document has been sent/ received.
[Transmission] Character encoding for the transmitted XML document is "UTF-16", and
no XML declaration has been specified. The media type for transmission is set as
"application/xml" without charset parameter. [Receipt] Implementation follows
RFC3023 and XML 1.0. The receiving system first identifies the media type, and then
processes the XML document. At the point that character encoding has been
determined, an XML declaration (including encoding declaration) is appended
automatically to the head of the received XML document.

A. The media type identification appends <?xml version="1.0" encoding="us-ascii"?>,


at which point the XML processor
throws an error when processing the XML document
B. The media type identification appends <?xml version="1.0" encoding="UTF-8"?>, at
which point the XML processor throws
an error when processing the XML document
C. Character encoding is determined by the system locale. Since the XML declaration
is appended accordingly, in certain
cases the XML processor will throw an error when processing the XML document
D. The character encoding is identified from the XML Document binary. An XML
declaration (<?xml version="1.0"
encoding="UTF-16"?>) is appended accordingly
Answer: D

QUESTION NO: 29
Which of the following is incorrect with respect to general characteristics of DOM
(Level 2) processing and data binding tool processing?

A. Data types such as integers and dates cannot be handled by DOM; however, a data
binding tool can be used to handle
the data type
B. A validation against the schema cannot be performed with the DOM; however, a
data binding tool can be used to peform
a validation against the schema
C. A DOM parser cannot be used to execute a program created to use a different DOM
parser; however, a data binding tool
can be used to execute a program created to use a different data binding tool
D. For a compiled programming language, compared to DOM processing, a data binding
tool can detect more element name
mistakes and other programming errors during compiling
Answer: C

QUESTION NO: 30
Select which of the following correctly describes the output results of an XSLT
transformation of the following "XML Document" using the "XSLT Style Sheet". Note
that the XSLT processor can output transformation results as a document. [XML
Document] <number>1</number> [XSLT Style Sheet] <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" />
<xsl:template match="/"> <xsl:call-template name="PRINT"> <xsl:with-param
name="VAR" select="number" /> <xsl:with-param name="END" select="number + 2" />
</xsl:call-template> </xsl:template> <xsl:template name="PRINT"> <xsl:param
name="VAR" select="0" /> <xsl:param name="END" select="2" /> <xsl:if test="$VAR
&lt; $END"> <xsl:value-of select="$VAR" /> <xsl:call-template name="PRINT">
<xsl:with-param name="VAR" select="$VAR+1" /> <xsl:with-param name="END"
select="$END" /> </xsl:call-template> </xsl:if> </xsl:template> </xsl:stylesheet>

A. 0
B. 1
C. 01
D. 12
E. 012
F. 123
Answer: D

QUESTION NO: 31
Push the Exhibit Button to load the referenced "XSLT Style Sheet". Select which of
the following correctly describes the output results of an XSLT transformation of
the following "XML Document" using the "XSLT Style Sheet". Assume that the XSLT
processor can load "sample.xml" normally, and output transformation results as a
document. Line feeds and indents are not reflected. Although the expected
processing result is choice "E", processing may not occur as expected. [XML
Document] <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body></SOAP-
ENV:Body> </SOAP-ENV:Envelope> [sample.xml] <mst:GetExamList
xmlns:mst="urn:xmlmaster:test"> <mst:title>XML MASTER</mst:title>
</mst:GetExamList>

A. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" />


B. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
C. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<mst:title>XML MASTER</mst:title>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
D. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<mst:GetExamList xmlns:mst="urn:xmlmaster:test">
<mst:title>XML MASTER</mst:title>
</mst:GetExamList>
</SOAP-ENV:Envelope>
E. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<mst:GetExamList xmlns:mst="urn:xmlmaster:test">
<mst:title>XML MASTER</mst:title>
</mst:GetExamList>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Answer: D

QUESTION NO: 32
Push the Exhibit Button to load the referenced "XML Document". When processing the
"XML Document" according to the method shown by "SAX Processing," which of the
following correctly describes the output results (print and/or println method
output)? Assume that the processed XML Document has no indents (ignorable white
space such as line feeds, tabs, etc.). [SAX Processing] Use the following
"ContentHandlerImpl" class, and parse the XML Document using SAX. The SAX parser is
namespace aware. Assume no execution errors. class ContentHandlerImpl extends
DefaultHandler { boolean visiting, date, name; public void startElement( String
uri, String localName, String qName, Attributes attr) throws SAXException { if
( uri.equals("urn:xmlmaster:VISIT") && localName.equals("Activity") ) visiting =
true; if ( visiting ) { date = localName.equals("DateTime"); name =
localName.equals("Name"); if ( localName.equals("Job") )
System.out.println( attr.getValue("Procedure") ); } public void endElement(String
uri, String localName, String qName) throws SAXException { if
( uri.equals("urn:xmlmaster:VISIT") && localName.equals("Activity") ) visiting =
false; if (date) { System.out.print(" --- "); date = false; } else if (name)
{ System.out.print(" *** "); name = false; } public void characters(char[] ch, int
start, int length) throws SAXException { if ( date || name ) System.out.print( new
String(ch, start, length) ); }

A. Install freezer 2004-07-01 09:00 --- Helen Edwards ***


Install air conditioner 2004-07-01 13:00 --- John Smith ***
B. 2004-07-01 09:00 --- Helen Edwards *** Install freezerB.2004-07-01 09:00 ---
Helen Edwards *** Install freezerB.2004-07-01 09:00 --- Helen Edwards *** Install
freezer
2004-07-01 13:00 --- John Smith *** Install air conditioner
C. 2004-07-01 09:00 --- Helen Edwards *** C.2004-07-01 09:00 --- Helen Edwards ***
C.2004-07-01 09:00 --- Helen Edwards ***
2004-07-01 13:00 --- John Smith ***
D. Nothing is output.D.Nothing is output.
Answer: B

QUESTION NO: 33
Push the Exhibit Button to load the referenced "XML Document". When processing the
"XML Document" according to the method shown by "SAX Processing," which of the
following correctly describes the output results (println method output)? Assume
that the processed XML Document has no indents (ignorable white space such as line
feeds, tabs, etc.). Although the expected processing result is choice "A",
processing may not occur as expected. [SAX Processing] Use the following
"ContentHandlerImpl" class, and parse the XML Document using SAX. The SAX parser is
namespace aware. Assume no execution errors. class ContentHandlerImpl extends
DefaultHandler { String code=null, timeStr=""; public void startElement( String
uri, String localName, String qName, Attributes attr) throws SAXException { if
(uri.equals("urn:xmlmaster:VISIT") && localName.equals("Activity")) code =
attr.getValue("Code"); if (code != null) { if (localName.equals("Job")) timeStr =
attr.getValue("Time"); } public void endElement(String uri, String localName,
String qName) throws SAXException { if (uri.equals("urn:xmlmaster:VISIT") &&
localName.equals("Activity")) { System.out.println(code + "#Job of " + timeStr + "
hours"); code = null; }

A. 0001#Job of 2 hours
0002#Job of 3 hours
B. 0001#Job of hours
0002#Job of hours
C. #Job of 2 hours
#Job of 3 hours
D. #Job of hours
E. Nothing is output.
Answer: A

QUESTION NO: 34
Push the Exhibit Button to load the referenced "XML Document". When processing the
"XML Document" according to the method shown by "DOM Processing," which of the
following is the most appropriate expression of the results under XML 1.0? Line
feeds and/or indents are not reflected in the results. Assume that the processed
XML Document has no indents (ignorable white space such as line feeds, tabs, etc.).
[DOM Procesing] Create XML using the following method. Document output = createXML(
doc, impl ); The variable doc here references the Document instance of the loaded
XML Document. The variable impl here references the DOMImplementation instance. The
DOM parser is namespace aware. Assume no execution errors. public static Document
createXML( Document doc, DOMImplementation impl ) { String name = "Jim Worker";
Document output = impl.createDocument( "urn:xmlmaster:LIST", "List", null); Element
root = output.getDocumentElement(); NodeList nl =
doc.getElementsByTagNameNS("urn:xmlmaster:WORKER", "Worker"); for (int i = 0; i <
nl.getLength(); i++) { Element e1 = (Element)nl.item(i); if
(e1.getAttribute("Name").equals(name)) { Element elem =
output.createElementNS( "urn:xmlmaster:LIST", "VisitList");
root.appendChild(output.importNode(e1, true)); Element e2 =
(Element)e1.getNextSibling(); root.appendChild(output.importNode(e2, true)); }
return output; }
A. <List xmlns="urn:xmlmaster:LIST">
<Activity xmlns="urn:xmlmaster:VISIT" Code="0003">
<DateTime>2004-07-01 16:00</DateTime>
<Job Procedure="Clean air conditioner" Time="2"/>
<Status>WAITING</Status>
</Activity>
</List>
B. <List xmlns="urn:xmlmaster:LIST">
<VisitList>
<Activity xmlns="urn:xmlmaster:VISIT" Code="0003">
<DateTime>2004-07-01 16:00</DateTime>
<Job Procedure="Clean air conditioner" Time="2"/>
<Status>WAITING</Status>
</Activity>
</VisitList> </VisitList>
</List>
C. <List xmlns="urn:xmlmaster:LIST">C.<List xmlns="urn:xmlmaster:LIST">
<Worker xmlns="urn:xmlmaster:WORKER" Name="Jim Worker"/> <Worker
xmlns="urn:xmlmaster:WORKER" Name="Jim Worker"/>
<Activity xmlns="urn:xmlmaster:VISIT" Code="0003">
<DateTime>2004-07-01 16:00</DateTime>
<Job Procedure="Clean air conditioner" Time="2"/>
<Status>WAITING</Status>
</Activity>
</List>
D. <List xmlns="urn:xmlmaster:LIST">D.<List xmlns="urn:xmlmaster:LIST">D.<List
xmlns="urn:xmlmaster:LIST">
<Worker xmlns="urn:xmlmaster:WORKER" Name="Jim Worker"/> <Worker
xmlns="urn:xmlmaster:WORKER" Name="Jim Worker"/>
<VisitList>
<Activity xmlns="urn:xmlmaster:VISIT" Code="0003">
<DateTime>2004-07-01 16:00</DateTime>
<Job Procedure="Clean air conditioner" Time="2"/>
<Status>WAITING</Status>
</Activity>
</VisitList> </VisitList>
</List>
Answer: C

QUESTION NO: 35
Push the Exhibit Button to load the referenced "XML Document". When processing the
"XML Document" according to the method shown by "DOM Processing," which of the
following correctly describes the output results (print and/or println method
output)? Although the expected processing result is choice "A", processing may not
occur as expected. [DOM Processing] Process XML using the following method.
printXML( doc ); The variable doc here references the Document instance of the
loaded XML Document. The DOM parser is namespace aware. Assume no execution errors.
public static void printXML( Document doc ) { Node node =
doc.getElementsByTagNameNS( "urn:xmlmaster:CONTACT", "Name").item(0); String name =
node.getFirstChild().getNodeValue(); NodeList nl =
doc.getElementsByTagNameNS("urn:xmlmaster:VISIT", "Activity"); for (int i = 0; i <
nl.getLength(); i++) { Element elem = (Element)nl.item(i); node =
elem.getElementsByTagNameNS( "urn:xmlmaster:VISIT", "DateTime").item(0);
System.out.print("Not Visited:");
System.out.print(node.getFirstChild().getNodeValue()); System.out.print(" Worker="
+ name); node = elem.getElementsByTagNameNS( "urn:xmlmaster:CONTACT",
"Name").item(0); System.out.print(", Visit(");
System.out.print(node.getFirstChild().getNodeValue()); System.out.println(")"); }
A. Not Visited:2004-07-01 13:00 Worker=Jeff Workman, Visit(John Smith)
Not Visited:2004-07-01 16:00 Worker=Jeff Workman, Visit(Ken Miller)
B. Not Visited:2004-07-01 13:00 Worker=John Smith, Visit(John Smith)
Not Visited:2004-07-01 16:00 Worker=John Smith, Visit(Ken Miller)
C. Not Visited:2004-07-01 13:00 Worker=Jeff Workman, Visit(John Smith)
D. Not Visited:2004-07-01 13:00 Worker=John Smith, Visit(John Smith)
Answer: B

QUESTION NO: 36
Push the Exhibit Button to load the referenced "XML Document". When processing the
"XML Document" according to the method shown by "DOM Processing," which of the
following is the most appropriate expression of the results under XML 1.0? Line
feeds and/or indents are not reflected in the results. Although the expected
processing result is choice "D", processing may not occur as expected. [DOM
Processing] Process XML using the following method. Document output =
createXML( doc, impl ); The variable doc here references the Document instance of
the loaded XML Document. The variable impl here references the DOMImplementation
instance. The DOM parser is namespace aware. Assume no execution errors. public
static Document createXML( Document doc, DOMImplementation impl ) { String code =
"0001"; Document output = impl.createDocument( "urn:xmlmaster:REPORT", "Report",
null); Element root = output.getDocumentElement(); Element src =
(Element)doc.getElementsByTagNameNS( "urn:xmlmaster:WORKER", "Worker").item(0);
root.appendChild(output.importNode(src, true)); NodeList nl =
doc.getElementsByTagNameNS("urn:xmlmaster:VISIT", "Activity"); for (int i = 0; i <
nl.getLength(); i++) { src = (Element)nl.item(i); if
(code.equals(src.getAttribute("Code"))) { Element elem =
(Element)output.importNode(src, true); root.appendChild(elem); Element status =
(Element)elem.getElementsByTagName( "Status").item(0);
status.getFirstChild().setNodeValue("COMPLETED"); break; } return output; }

A. <Report xmlns="urn:xmlmaster:REPORT">
<Worker xmlns="urn:xmlmaster:WORKER" />
</Report>
B. <Report xmlns="urn:xmlmaster:REPORT">
<Worker Name="Jeff Workman" xmlns="urn:xmlmaster:WORKER" />
</Report>
C. <Report xmlns="urn:xmlmaster:REPORT">C.<Report
xmlns="urn:xmlmaster:REPORT">C.<Report xmlns="urn:xmlmaster:REPORT">
<Worker xmlns="urn:xmlmaster:WORKER" />
<Activity xmlns="urn:xmlmaster:VISIT">
<Status>COMPLETED</Status>
</Activity>
</Report>
D. <Report xmlns="urn:xmlmaster:REPORT">D.<Report xmlns="urn:xmlmaster:REPORT">
<Worker Name="Jeff Workman" xmlns="urn:xmlmaster:WORKER" />
<Activity xmlns="urn:xmlmaster:VISIT" Code="0001">
<DateTime>2004-07-01 09:00</DateTime>
<Job Procedure="Install freezer" Time="2" />
<Status>COMPLETED</Status>
</Activity>
</Report>
Answer: D

QUESTION NO: 37
When receiving an XML document following the DTD defined by NewsML (portions
modified for this question), the document is processed via SAX programming. Push
the Exhibit Button to load the referenced "DTD". When processing the following "XML
Document" according to the method shown by "SAX Processing," which of the following
correctly describes the output results (print method output)? Note that the
attribute value is not output for this question. [XML Document] The root element
name (document element name) is "NewsML". The XML document follows the "DTD"
definition. The XML Document has no document type declaration. The XML Document is
comprised of elements, attributes and character data; comments and CDATA secions,
etc. are not included. The XML Document is indented, and includes ignorable white
spaces such as line feeds and tabs before the start-tags. [SAX Processing] Use the
following "ContentHandlerImpl" class, and parse the XML Document using SAX. Assume
no execution errors. class ContentHandlerImpl extends DefaultHandler { private
String elementName = ""; public void startElement( String namespaceURI, String
localName, String qName, Attributes atts) throws SAXException { elementName =
qName; } public void endElement( String namespaceURI, String localName, String
qName) throws SAXException { elementName = ""; } public void characters(char[] ch,
int start, int length) throws SAXException { if ( elementName.equals("") == false )
{ System.out.print(new String(ch, start, length)); }

A. All character data of elements can be output, ignorable white spaces are not
output
B. All character data of elements can be output, and ignorable white spaces are
also output
C. A portion of character data of elements cannot be output
D. No character data of elements can be outputD.No character data of elements can
be outputD.No character data of elements can be output
Answer: B

QUESTION NO: 38
Use XSLT transformation to create XML according to the schema (portions modified
for this question) defined by TravelXML. Perform XSLT transformation on the "XML
Document" using the following "XSLT Style Sheet". Select which of the following
correctly describes the results of performing a validation check on the post-
transformation XML against the schema ("XML Schema" referenced when the Exhibit
Button is pushed). [XML Document] <form xmlns="urn:xmlmaster"> <field1>Sky Star
Hotel</field1> <field2></field2> <field3></field3> </form> [XSLT Style Sheet]
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fm="urn:xmlmaster" exclude-result-prefixes="fm"> <xsl:template match="/">
<xsl:element name="BookingNotification"
xmlns="http://www.xmlns.org/2003/TravelXML"> <xsl:element
name="AccommodationInformation"> <xsl:element name="AccommodationName">
<xsl:value-of select="fm:form/fm:field1" /> </xsl:element> <xsl:if
test="fm:form/fm:field2/text()"> <xsl:element name="ChainName"> <xsl:value-of
select="fm:form/fm:field2" /> </xsl:element> </xsl:if> <xsl:if
test="fm:form/fm:field3/text()"> <xsl:element name="AccommodationPhoneNumber">
<xsl:value-of select="fm:form/fm:field3" /> </xsl:element> </xsl:if>
</xsl:element> </xsl:template> </xsl:stylesheet>

A. The root element (document element) of the post-transformation XML is an empty


element, and the post-transformation
XML is not valid against the schema
B. The post-transformation XML does not include the required elements defined by
the schema (all elements defined once
they have appeared, namespace reflected); therefore, is not valid
C. The post-transformation XML does not include the required elements defined by
the schema (all elements defined once
they have appeared, namespace reflected); therefore, is not valid
D. The post-transformation XML includes all of the required elements defined by the
schema (all elements defined once
they have appeared, namespace reflected); however, is not valid
E. The post-transformation XML includes all of the required elements defined by the
schema (all elements defined once
they have appeared, namespace reflected); however, is not valid
F. The post-transformation XML includes all of the required elements defined by the
schema (all elements defined once
they have appeared, namespace reflected); however, is not valid
G. The post-transformation XML is validD.The post-transformation XML is validD.The
post-transformation XML is valid
Answer: G

QUESTION NO: 39
Use DOM programming to create XML according to the schema defined by NewsML
(portions modified for this question). Push the Exhibit Button to load the
referenced "XML Document". Load the "XML Document" and update the XML according to
the method shown by "DOM Processing". Select which of the following correctly
describes the results of performing a validation check on the created XML against
the schema ("DTD" and "article.dtd"). Assume that "article.dtd" can be parsed
normally during validation. The existence of a document type declaration during
validation is not reflected. [DOM Processing] Create XML using the following
method. Document output = createXML( doc ); The variable doc here references the
Document instance of the loaded XML Document. Assume no execution errors. public
static Document createXML( Document doc ) { Element contentElement =
(Element)doc.getElementsByTagName( "DataContent").item(0); Element articleElement =
doc.createElement( "article" ); contentElement.appendChild( articleElement ); Text
textNode = doc.createTextNode( "Start XML Master: Professional Exam" );
articleElement.appendChild( textNode ); return doc; } [DTD] <!ENTITY % article
SYSTEM "article.dtd"> %article; <!ENTITY % data " (Encoding | DataContent )?"> <!
ELEMENT ContentItem ( %data; )> <!ATTLIST ContentItem Href CDATA #IMPLIED > <!
ELEMENT Encoding %data;> <!ATTLIST Encoding Notation CDATA #REQUIRED > <!ELEMENT
DataContent ANY> <!ELEMENT NewsItem (ContentItem*)> <!ELEMENT NewsML (NewsItem+)>
[article.dtd] <!ELEMENT article (#PCDATA)> <!ATTLIST article title CDATA
#REQUIRED >

A. The created XML does not include required attributes; therefore, is not valid
against the schema
B. The created XML has an illegal attribute value; therefore, is not valid against
the schemaB.The created XML has an illegal attribute value; therefore, is not valid
against the schemaB.The created XML has an illegal attribute value; therefore, is
not valid against the schema
C. The created XML does not follow element type declarations; therefore, is not
valid against the schemaC.The created XML does not follow element type
declarations; therefore, is not valid against the schema
D. The created XML is valid against the schemaD.The created XML is valid against
the schemaD.The created XML is valid against the schema
Answer: A

You might also like