山大認證課之IBM-XML題庫

山大的坑爹認證課,不過好在有題庫


1.  (1)

The W3C DOMCoreinterfaces defines a minimal set of:

A.interfaces foraccessing and manipulating document objects

B. Javaobjectimplementations for use with XML parsers.

C. Conventions andprocesses for creating live HTML pages.

D. Mutabledocument trees.

(A)

 

2.  (1)

Which ofthefollowing lists contains only valid W3C XML Schema Language simpleschematypes?

A.anyURL,char,encoding, UTF8

B.fullname,double, long, int

C.TOKEN,timestamp, range,char

D. byte,duration,ENTITY, NMTOKEN

(D)

 

3.  (1)

 Assume thata W3C XML Schema Language documentdesigner uses the following prefixdeclaration

 <xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema">

Thedesignerevaluates the choice of attribute versus elements to describe astructure.Which of the following is a valid reason to avoid attributes for acomplexstructural representation?

A. Elementsareapproximateley twice as concise as attributes.

B. An elementsisrestricted to meta-data representation.

C. Anattributevalue is restricted to representing string data.

D. Anattributevalue cannot contain elements.

(D)

 

4.  (1)

Duringparsing, howmany startElement messages will the ContentHandler for thefollowing XMLdocument receive?

<?xmlversion=”1.0”encoding=”ISO-8859-1”?>

<?xml-stylesheettype=”text/css”href=”person.css”?>

<!DOCTYPEpersonSYSTEM “person.dtd”>

<personxmlns=”http://xml.mycompany.com/person”>

 <name:name xmlns:name=”http://xml.mycompany.com/name”>

   <name:first>Joe</name:first>

   <name:last>Schmoe</name:last>

 </name:name>

 <assignment project_id=”p2”/>

</person>

A.5

B.8

C.9

D.12

(A)

 

5.  (1)

Severalsmall XMLdocuments need to be merged and transformed into a single XHTMLresult. Which ofthe following actions is best to accomplish this task?

A.Parse eachdocument using DOM, and import the results into a common DOM. Passthe resultingDOM to an XSLT transformer to convert to XHTML.

B.Use an externalutility to concatenate all the XML documents and pass theresulting XML to anXSLT transformer to convert to XHTML.

C.Use XSL“document()” function to merge all documents, and then perform anormaltransformation to convert to XHTML output.

D.Use XQuery toextract the entire contents of each document into a single DOM,which will thenbe passed into an XSLT transformer to convert to XHTML.

(C)

 

6.  (1)

Anauto partssupplier stores customer data as XML in a database in the followingformat.

<customerid=”2”>

 <name>SwellMobile</name>

 <address><city>KansasCity</city><state>MO</state></address>

  <purchaseid=”124” totalCost=”984.30”>

   <item id=”123” quantity=”27”/>

   <item id=”456” quantity=”13”/>

 </purchase>

</customer>

Assumethat thefunction XMLCOLUMN(“cust.data”) returns the XML documents from thedatabase.Which of the following XQuery statements returns the names of thecustomers whohave purchased item 123?

A.for $i inXMLCOLUMN (“cust.data”)/customer/purchase/item

where$i/@ id=123

returnXMLCOLUMN(“cust.data”)/customer/name

B.for $c inXMLCOLUMN(“cust.data”)/customer

where$c/purchase/item/@id=123

return$c/name

C.for $c inXMLCOLUMN(“cust.data”)

where$c/purchase/item/@id=123

return$c/name

D.for $c inXMLCOLUMN(“cust.data)/customer/purchase/item[@id=123]

return$c/name

(B)

 

7.  (1)

A W3CSchemaLanguage document designer must incorporate declarations from anexternalWeb-hosted type library schema belonging to another namespace. Whichschemaelement can the designer use to incorporate the external schema so as toreuseits types and elements?

A. xs:require

B. xs:include

C. xs:import

D. xs:redefine

(C)

 

8.  (1)

Consider thegivenXML fragment:

 <Examplexmlns:namespace1="http://www.w3.org"xmlns="http://www.ibm.com">

    <Item1 address1="US"/>

    <namespace1:Item2address="US"/>

 <Example>

To which ofthefollowing namespaces does the element Item1 belong?

A.http://www.w3.org.

B.http://www.ibm.com.

C.http://www.w3.org/namespace.

D. It doesnotbelong to any namespaces.

(B)

 

9.  (1)

A complexXMLformat is to be widely shared acoross organizations that do notnormallyinteract. At a minimum, what kind of information about the formatshould beshared?

A. An XSDLdocumentfor the format.

B. Thedocument'sebXML grammar.

C. Formalschemasor DTDs for the format.

D. A stylesheet.

(C)

 

10. (1)

 To make XSLTtemplates more robust, theparameters(x,y) are checked for errors and boundaryconditions.

Which ofthefollowing tests is NOT necessary?

A. x = y

B. x != y

C. x hasanon-numeric value

D. y does nothavea value

(D)

 

11. (1)

Anapplicationapplies internal business rules to generate XML documents. XSLstylesheets canthen perform complex calculations on the XML documents toproduce summaryreports.What is the best solution to resolve the complexities ofthe XSLTcalculations?

A. Extract allthecalculation logic form the XSL and put them into included functions tobeshared by all the stylesheets.

B. Movethecalculations into the business rules logic of the applicaction and exporttheresults as part of the XML content.

C. Create a commonstylesheetto perform all the calculations appending the results to the XML,which is theninput into the appropriate stylesheet for the actual rendering.

D. Create acustomXSL extensions for each calculation and import them into eachdefinedstylesheet.

(C)?(A)?

 

12. (1)

A form containsthefollowing fields:

  1)First name

  2)Middle name

  3)Last name

  4)Street

  5)City

  6)State

  7)Postal code

Which ofthefollowing is the most appropriate XML representation?

A. <form>

    <name>

      <first>Elvood</first>

      <middle>P<middle>

      <last>Suggins</last>

    </name>

    <location>

      <street>123 Elm St.</street>

      <city>Lizard Lick</city>

      <state>NC</state>

      <postalCode>27699</postalCode>

    </location>

  <form>

B.<addr:formxmlns:loc="http//tempuri.org/index.html">

  <name>

    <first>Elvood</first>

    <middle>P</middle>

    <last>Suggins</last>

  <name>

  <location>

    <street>123 Eln St</street>

    <city>Lizard Lick</city>

    <state>NC</state>

    <postalCode>27699</postalCode>

  </location>

 </addform>

 

C. <form>

  <name fullname="Suggins. ElvoodP">

  <location address="123 Eln St. LizardLick. NC 27699">

  <form>

D. <addrformxmlns loc="http//tempuri.org/index.html">

   <namefullname="Suggins ElvoodP">

  <location address="123 Eln St. LizardLick. NC 27699">

  </addr form>

(A)

 

13. (1)

Given anexternalDTD line

 <!ENTITY% residence "address,bedrooms, bath">

 and aninternal DTD line:

 <!ENTITY% residence "address,footage, bedrooms, baths,available_date"> 

 Which of thefollowing statements is trueconcerning the document that refers to these DTDs?

A. Documentwillnot validate, due to the conflicting declarations.

B.Anavailable_date must be present for a residence to be valid in the document.

C.Anavailable_date is optional for a residence to be valid in the document.

D. Thelastdeclaration the parser encounters takes precedence.

(B)

 

14. (1)

An applicatinmenubar will contain a tree of labeled command "item" elements nestedtoan arbitrary depth. Which of the following XML fragments can define themenubar?

A.<m:menuxmlns:menu="http://tempuri.org/index.html">

    <file item="File">

      <new item="New">

         <file item="File"cmd="newFolder"/>

         <file item="Folder"cmd="newFolder"/>

      </new>

      <open item="Open"cmd="penFile"/>

      <close item="Close"cmd="closeFile"/>

    </file>

    <edit item="Edit">    

      <copy item="Copy"cmd="copy"/>

      <paste item="Paste"cmd="paste"/>

    </edit>

  </m:menu>

B.<m:menuxmlns:m="http://tempuri.org/index.html">

    <file item="File"/>

      <new item="New"/>

        <file item="File"cmd="newFile"/>

        <file item="Folder"cmd="newFolder"/>

      </new>

      <open item="Open"cmd="OpenFile"/>

      <close item="Close"cmd="closeFile"/>

    </file>

    <edit item="Edit">

       <copy item="Copy"cmd="copy"/>

       <paste item="Paste"cmd="paste"/>

    </edit>

 </m:menu>

C.<m:menuxmlns:menu="http://tempuri.org/index.html">

    <item label="File">

      <item label="New">

         <item label="File"cmd="openFile"/>

         <item label="Close"cmd="closeFile"/>

      </item>

      <item label="Open"cmd="openFile"/>

      <item label="Close"cmd="closeFile"/>

    </item>

    <item label="Edit">

      <item label="Copy" cmd="copy"/>

      <item label="Paste"cmd="paste"/>

    </item>

  </m:menu>

D.<m:menuxmlns:m="http://tempuri.org/index.html">

    <item label="File">

      <item label="New">

         <item label="File"cmd="openFile"/>

         <item label="Close" cmd="closeFile"/>

      </item>

      <item label="Open"cmd="openFile"/>

      <item label="Close"cmd="closeFile"/>

    </item>

    <item label="Edit">

      <item label="Copy"cmd="copy"/>

      <item label="Paste"cmd="paste"/>

    </item>

  </m:menu>

(D)

 

15.  (2)

Whichtwo of thefollowing may NOT be nested within a CDATA section?

A.HTML documents

B.Javascriptsource

C.Other CDATAsections

D.The XML escapecharacters(<,>,&,’,an”)

E. XSLT that needsto beprocessed

(CE)

 

16.  (1)

Ina museum, XMLdata stored on powerful servers is served to customers throughWeb browsersrunning on network-connected computers. The performance of thosecomputers islimited. Which of the following approaches will best suit theXMLtransformation?

A.Pass both theXML data and stylesheets to web browsers.

B.Output XHTML viaa server-side XSL transformation.

C.Use only asubset of the XHTML and use Format Objects to apply style.

D.Transform theXML data into the open format document and display.

(D)

 

17.  (1)

An XMLdocumentconsists of one <Book> element and three <Price>elementsrepresenting different vendor's selling price. What is the bestapproach todefine this XML document?

A. Todifferentiatevendor's prices, add a prefix before each Price tag. such as<OneVendorPrice>.

B. Whendefiningthis XML document's schema, use different date types for element<Price>.

C. At thebeginningof the XML document, add Price namespace declarations for differentvendors.

D. Put threesamePrice tags into the XML document, XML processor has embedded mechanismtodifferentiate them.

(C)

 

18.  (1)

An HRapplicationwill carry out arbitrary read-only queries across employees,managers, anddepartments. The data will be saved in a persistence store. Whichof thefollowing supports XML as the HR application's data medium?

A. XQuerysupportsinsert, update, and delete operations.

B. XQuerysupportsFLWOR join operations across three XML documents.

C. XSLTsupportstransformation of SQL result sets. SQL aliases cannot be used forcolumn namesand table names.

D. SQLsupportsquering the contents of XML documents stored as BLOBs. SQL does notsupportnamespaces.

(B)

 

19.  (1)

XML isbeingtransformed using XSLT. An xsl:variable is needed later in this process tosetan element color. Which of the following is the way to initializethexsl:variable hue based upon the value of the context node's statusattribute?

A.<xsl:choose>

   <xsl:variable name="hue">

     <xsl:whentest="@status='late'">red</xsl:when>

   </xsl:variable>

   <xsl:variable name="hue">

     <xsl:otherwise>green</xsl:otherwise>

   </variable>

  </xsl:variable>

 </xsl:choose>

B.<xsl:choose>

    <xsl:whentest="@status='late'">

       <xsl:variablename="hue">red</xsl:variable>

    </xsl:when>

    <xsl:otherwise>

      <xsl:variablename="hue">green</xsl:variable>

    </xsl:otherwise>

  <xsl:choose>

C.<xsl:variablename="hue">

    <xsl:choose>

      <xsl:whentest="@status='later'">red</xsl:when>

      <xsl:otherwise>green</xsl:otherwise>

    </xsl:choose>

  </xsl:variable>

D.<xsl:variablename="hue">

    <xsl:iftest="@status='late'">red</xsl:if>

    <xsl:else>green</xsl:else>

  </xsl:variable>

(C)

 

20.  (1)

Howshould an XMLdeveloper store binary data which has been encoded (as base64) asthe

contentof anelement "image" in an XML document?

A.<![CDATA[<image>...Binarydata encoded as characterdata...</image> ]]>

B.<image>...Binary data encoded as character data... </image>

C.<image><![CDATA[...Binary data encoded as character data...]]></image>

D.<imagevalue="...Binary data encoded as character data..."/>

E.Binary datacannot be stored.

(C)

 

21.  (1)

TheXML specconstrains the valid values for an ID attribute. Which of thefollowing isFALSE?

A.ID attributevalue cannot begin with and contain any whitespace.

B.ID attributevalue cannot begin with a number.

C.ID attributevalue cannot match the value of an existing IDREF attribute value.

D.ID attributevalue has to be unique throughout the whole XML document.

(C)

 

22.  (1)

How should aCSSstylesheet be applied to an XML document?

A. PreprocesstheXML using and XSLT stylesheet to transform the document to valid HTMLfirst.Then send the XHTML document to the browser.

B. Embeda<style type="text/css">...</style> element within theXMLdocument that contains CSS rendering instructions.

C. Use XSLTCtoapply the CSS to the XML DOM, and return the results as an XHTML documenttothe browser.

D. Inserta<?xml-stylesheet href="XXX.css"type="text/css"?>instruction referencing an external CSS file.

(D)

 

23.  (1)

A commadelimitedlist is being constructed via the XSLT fragment below. Which of thefollowingways is most appropriate to conditionally write a comma after eachvalue in thelist except for the last one?

<xsl:for-eachselect="//thing">

  <xsl:value-ofselect="@thingNo"/>

  <!--Conditonally write comma here.-->

<xsl:for-each>

A.<xsl:iftest="position()=last()">,</xsl:if>

B.<xsl:iftest="position()!=last()">,</xsl:if>

C.<xsl:iftest="following-sibling::*">,</xsl:if>

D.<xsl:iftest="following::*">,</xsl:if>

(B)

 

24.  (1)

What is thedefaultaxis in XPath?

A.descendant::

B.descendant-or-self::

C. child::

D. parent::

(C)

 

25.  (1)

Giventhe followingDTD lines, which XML document fragment would be valid?

<!ELEMENT  person    (name, profession*)>

<!ELEMENT  name     (first_name, last_name)>

<!ELEMENT  first_name (#PCDATA)>

<!ELEMENT  last_name (#PCDATA)>

<!ELEMENT  profession (#PCDATA)>

A. <person>

<profession>computerscientist</profession>

<name>

 <first_name>Alan</first_name>

<last_name>Turing</last_name>

</name>

</person>

B.<person>

<name>

 <first_name>Alan</first_name>

<last_name>Turing</last_name>

</name>

wasa<profession>computer scientist</profession>

</person>

C.<person>

<name>

 <first_name>Alan</first_name>

<last_name>Turing</last_name>

</name>

<publication>OnComputableNumbers</publication>

</person>

D.<person>

<name>

 <first_name>Alan</first_name>

<last_name>Turing</last_name>

</name>

</person>

(D)

 

26.  (1)

Anapplicationsaves and restores internal program state across invocations. Theoffline stateresides in an XML file. Only that one application reads andwrites the file. Thedesigner wrote a constraint schema for the XML, and hadthe application validatethe state file upon input. Which of the followingindicates why?

A.    Todetect data corruption.

B.    Toautomatically convert string fields tonumeric.

C.   Tooptimize parsing.

D.   Tobind the file to a set of state objects.

(A)

 

27.  (1)

A company isdevelopingan AJAX(AsynchronousJavaScript and XML) application which passes XML betweenthe client and theserver. After the client's Web browser receives the serverresponse, whichtechnology is NOT suited for rendering the XML data?

A. XSLT

B. XSL-FO

C. CSS

D. Javascript

(D)

 

28.  (1)

Which of thefollowingis NOT necessarily a trait of “tail recursion”?

A. Dependinguponthe stylesheet processor, it may not exhaust the stack space as quicklyasgeneral recursion.

B. Eachrecursivecall sets up the next sub-problem to be half as large as the currentone.

C.Stylesheetprocessors may optimize this kind of recursion by internaltransformation intoan iterative solution.

D. Therecursivecall comes at the end of the template.

(B)

 

29.  (1)

Consideringthefollowing XML document:

<?xmlversion="1.0"encoding="UTF-8"?>

<BankAccount>

  <Account ID="00023"Name="Alex Halavais"Type="Cheking"Balance="10000USD"/>

  <Account ID="00082"Name="Alice Mckinley"Type="Saving"Balance="20000USD"/>

</BankAccount>

If an XMLdeveloperwants to output the above document as a colon delimited text file,which of thefollowing stylesheets can achieve the desired result?

A. <?xmlversion="1.0"encoding="UTF-8"?>

<xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSLT/Transform">

  <xsl:output method="text"/>

  <xsl:templatematch="Account">

      <xsl:value-ofselect="@ID"/><xsl:output>:</xsl:output>

      <xsl:value-ofselect="@Name"/><xsl:output>:</xsl:output>

      <xsl:value-ofselect="@Type"/><xsl:output>:</xsl:output>

      <xsl:value-of select="@Balance"/>

      <xsl:output>:</xsl:output>

  </xsl:template>

</xsl:stylesheet>

B. <?xmlversion="1.0"encoding="UTF-8"?>

<xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSLT/Transform">

  <xsl:output method="text"/>

  <xsl:template match="BankAccount">

      <xsl:value-ofselect="@ID"/><xsl:output>:</xsl:output>

      <xsl:value-ofselect="@Name"/><xsl:output>:</xsl:output>

      <xsl:value-ofselect="@Type"/><xsl:output>:</xsl:output>

      <xsl:value-ofselect="@Balance"/>

      <xsl:output>:</xsl:output>

  </xsl:template>

</xsl:stylesheet>

C. <?xmlversion="1.0"encoding="UTF-8"?>

<xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSLT/Transform">

  <xsl:output method="text"/>

  <xsl:templatematch="Account">

      <xsl:value-ofselect="@ID"/><xsl:text>:</xsl:text>

      <xsl:value-ofselect="@Name"/><xsl:text>:</xsl:text>

      <xsl:value-ofselect="@Type"/><xsl:text>:</xsl:text>

      <xsl:value-ofselect="@Balance"/>

      <xsl:text>:</xsl:text>

  </xsl:template>

</xsl:stylesheet>

D. <?xmlversion="1.0"encoding="UTF-8"?>

<xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSLT/Transform">

   <xsl:outputmethod="text"/>

  <xsl:templatematch="BankAccount">

      <xsl:value-ofselect="@ID"/><xsl:text>:</xsl:text>

      <xsl:value-ofselect="@Name"/><xsl:text>:</xsl:text>

      <xsl:value-ofselect="@Type"/><xsl:text>:</xsl:text>

      <xsl:value-ofselect="@Balance"/>

      <xsl:text>:</xsl:text>

  </xsl:template>

</xsl:stylesheet>

(C)

 

30.  (1)

XML documentsofthe same schema design are received from many unknown sources. Thedocumentswill be stored as native XML, and accessed randomly, but frequentlyfrom manydifferent Web Service methods. What is the best processing path tomanage thesedocuments?

A.Receiveddocument should be parsed and validated, then persisted(保存). When requested, the document istransformed to theproper format with no further parsing or validation.

B. Persistreceiveddocuments, when requested, parse, validate, and transform the documentto theproper format.

C.Receiveddocuments should be parsed, validated, and transformed into eachdefined targetformat, which are then persisted. When requested the properpre-formatteddocument is retrieved.

D.Receiveddocuments are persisted. When requested, the document is transformed totheproper format.

(C)

 

31.  (1)

Given thefollowingDTD document, which of the following XML document is valid?

<ELEMENTcourse(name, location, student)>

<!ELEMENTlocation(#PCDATA)>

<!ELEMENTname(#PCDATA)>

<!ELEMENTstudent(name)>

<!ATTLISTcoursecode CDATA #IMPLIED>

<!ATTLISTstudentid CDATA #IMPLIED>

A.<coursecode="AA123">

     <location>Phoenix</location>

     <name>Advanced counting techniques</name>

     <student><name>Bob Bobberson</name></student>

  </course>

B.<coursecode="AA123">

    <name>Advanced counting techniques</name>

    <location>Phoenix</location>

    <student><name>BobBobberson</name></student>

   </course>

C.<coursecode="AA123">

     <name>Advanced counting techniques</name>

     <location>Phoenix</location>

  </course>

D.<coursecode="AA123" location="Phoenix">

     <name>Advanced counting techniques</name>

     <student><name>BobBollerson</name></student>

  </course>

(B)

 

32.  (1)

An autopartssupplier stores customer data as XML in a database in the followingformat.

<customerid="2">

  <name>SvellMobile</name>

  <address><city>KansasCity</city><state>MO</state></address>

  <purchase id=124"totalCost="984.30">

     <item id="123"quantity="27"/>

     <item id="456"quantity="13"/>

  </purchase>

</customer>

Which ofthefollowing XQuery statements returns the names of the customers who havemadepurchases with a totalCost over 1000?

A. for $cinXMLCOLUMN("cust.data")/customer/purchase[@totalCost > 1000]return$c/name

B. for $cinXMLCOLUMN("cust.data")

where$c/customer/purchase[@totalCost> 1000]

return $c/name

C. for$pinXMLCOLOMN("cust.data")/customer/purchase

let $c :=XMLCOLUMN("cust.data")/customer

where$p/@totalCost> 1000

return $c/name

D. for $cinXMLCOLUMN("cust.data")/customer

where$c/purchase[@totalCost> 1000]

return $c/name

(D)

 

33.  (1)

Given the followingXMLinstance document fragment:

<countryname="Afghanistan"region="Asia"     area = "652000"population="25838797" />

<countryname="Albania"       region="Europe"  area ="28748"population="3490435" />

Using DOM2,whichof the following will print out the names of all the countries?

A. Element world=document.getTrunkElement();

for(Node n=world.getfirstChild(); n != null; n= n.getNextSibling()) 

{

        Element country = (Element) n;

        System.out.println(country.getAttribute("name"));

}

 

B. Element world=document.getTrunkElement();

for(Node n=world.getfirstChild(); n != null; n= n.getNext()) 

{

        Element country = (Element) n;

        System.out.println(country.getAttribute("name"));

}

 

C. Element world=document.getDocumentElement();

for(Node n=world.getfirstChild(); n != null; n= n.getNextSibling()) 

{

        Element country = (Element) n;

        System.out.println(country.getAttribute("name"));

}

 

D. Element world=document.getDocumentElement();

for(Node n=world.getfirstChild(); n != null; n= n.getNextChild()) 

{

        Element country = (Element) n;

        System.out.println(country.getAttribute("name"));

}

(C)

 

34.  (1)

Given thefollowingXML Schema document, which of the following XML documents is valid?

<xsd:schemaxmlns : xsd ="http://www.w3.org/2001/XMLSchema">

        <xsd:element name="itinerary"><xsd:complexType><xsd:sequence>

                  <xsd:elementname="passenger" type="xsd:string" />

                  <xsd:elementname="origin" type="xsd:string" />

                  <xsd:elementname="destination" maxOccurs="unbounded">

                  <xsd:complexType><xsd:simpleContent>

                           <xsd:extensionbase="xsd:string">

                           <xsd:attributename="transfer" fixed="true"type="xsd:string"use="optional" />

                           </xsd:extension>

                  </xsd:simpleContent></xsd:complexType></xsd:element></xsd:sequence>

                  <xsd:attributename="type" type="xsd:string" />

                  </xsd:complexType>

        </xsd:element>

</xsd:schema>

A.<itinerary>

        <passenger>a. Traveler</passenger>

        <origin>Ottawa</origin>

        <destination transfer="true">Toronto</destination>

        <destination>Delhi</destination>

   </itinerary>

B.<itinerarytype="business">

        <passenger>a.Traveler</passenger>

        <origin>Ottawa</origin>

        <departuretransfer="true">Toronto</departure>

        <destination>Delhi</destination>

   </itinerary>

C.<itinerarytype="business">

        <passenger>a. Traveler</passenger>

        <origin>Ottawa</origin>

        <destinationtransfer="false">Toronto</destination>

        <destination>Delhi</destination>

   </itinerary>

D.<itinerarytype="business">

        <passenger>a. Traveler</passenger>

        <origin>Ottawa</origin>

        <destinationtransfer="true">Toronto</destination>

        <destination>Delhi</destination>

   </itinerary>

(D)

 

 

35.  (1)

Which ofthefollowing statements is TRUE concerning this fragment of XML Schema?

<schema xmlns="http://www.v3.org/2001/XMLSchema" targetNamespace = "urn:nonstandard : test"

        elementFormDefault ="qualified" xmlns : ts = "urn : nonstandard: test">

        <complexTypename = "Order">

                  <sequence>

                      <element name = "user" type ="ts :User" />

                      <element name = "products"type = "ts :Products" minOccurs = "1" maxOccurs ="1" />

                  </sequence>

           <attribute name = "number" type = "xs :decimal"/>

        </complexType>

 

A. An<Order>has child elements.

B. Declaringnumberas type decimal requires <Order> to be a complexType.

C. An<Order>may contain more than one <user>.

D. An<Order>must have a number.

(BS)

 

36.  (2)

Which two of thefollwing statements are true aboutthese lines of JavaScript?

var newText=document.createTextNode("Hello DOM!");

      var para =document.getElementById("example");

      para.appendChild(newText);

A. For the linestowork correctly, there must be an element with an ID attributeof"example"  

B. newText willbeappended as the last child of the node with an ID attributeof"example"         

C. newText willbeappended as the first child of the node with an ID attributeof"example"

D. If there isnoelement with an ID attribute of "example", newText will beappendedto the end of the document

E. If newTextiscurrently part of the document, the append will fail.

(AB)

 

37.  (2)

Which of thefollowing two statements must be used tovalidate an XML instance document withSAX?

A. XMLParserparser= XMLParserFactory.createXMLParser();

B. XMLParserparser= new XMLReader();

C. XMLParserparser= XMLReaderFactory.createXMLReader();

D.parser.setFeature("http://xml.org/sax/features/validation",true);

E.parser.setProperty("http://xml.org/sax/features/validation",true);

(CD)

 

38. (1)

Given thefollowingXML fragment

<Employee>

        <Age>35</Age>

        <!--Based on this year'sperformace-->

        <Salary>10000</Salary>

</Employee>

WhichSAX2interface should the developer implement to extract the value of theXMLcomment?

A. ContentHandler

B. DTDHandler

C. EntityResolver

D. LexicalHandler

(D)

 

39.  (2)

Which twostatementsare true concerning the use of the Node.removeChild(Node child)?

A. The children ofthechild are kept in the document.

B. The child andallits children are removed.

C. Pointers mustbeupdated before attempting removeChild() or an Exception will be thrown.

D. All pointersareautomatically updated.

E. If the childdoesnot exist in the document, nothing will happen.

(BD)

 

40.  (1)

Giventhe followingXML fragment

  <BookIFN="SG24-6369-01">

     <Name> WebSphere Application ServerV6 Migration Guide </Name>

     <Publisher> IBM </Publisher>

 </Book>      

 How can anXML developer extract the Nameelement and its contents in SAX2-based XMLprocessing?

A.ImplementDocumentHandler and use the startElement and characters methods.

B.Implement DocumentHandlerand use the startDocument and characters methods.

C.ImplementContentHandler and use the startElement and characters methods.

D.ImplementContentHandler and use the startDocument and characters methods.

(C)

 

41.  (1)

Whichof thefollowing are considered by the DOM API to be a leaf-level node withoutanychild nodes?

A.Attr

B.Text

C.Entity

D.EntityReference

E.ProcessingInstruction

(BE)

 

42.  (2)

Avalidating parseris not required to :

A.Performattributedefaulting

B.DereferenceNamespaces.廢棄,解除參照

C.Expandexternalentity references.

D.Validatedatatypes.

E.validateCDATAsections

(AE)

 

43.  (1)

Whichof thefollowing statements is TRUE for a well-formed XML document?

A.It must contain<!DOCTYPE ... !> statement.                

B.There must be atleast ONE root element that has NO attributes.                 

C.Each of theparsed entities referenced is well-formed.                

D.The root elementCANNOT belong to a namespace.          

E.An attributevalue cannot have reference to an entity.

(C)

 

44.  (1)

Giventhe followingXML instance document fragment:

<countryname=”Afghanistan”region=”Asia” area=”652000” population=”2538797”/>

<countryname=”Albania”   region=”Europe”area=”28748”  population=”3490435”/>

UsingDOM2, whichof the following will retrieve the name of the last country?

A. NodeList nodes=document.getElementById(“country”);

StringlastCountryName=nodes.item(nodes.getLength()1).getAttrbutes().getNameditem(“name”);

B.NodeList nodes =document.getElementById(“country”);

StringlastCountryName=nodes.item(nodes.getLength()).getAttrbutes().getNameditem(“name”);

C.NodeList nodes =document.getElementByTagName(“country”);

StringlastCountryName=nodes.item(nodes.getLength()-1).getAttrbutes().getNameditem(“name”);

D.NodeList nodes =document.getElementByTagName(“country”);

StringlastCountryName=nodes.item(nodes.getLength()).getAttrbutes().getitemNamed(“name”);

(C)

 

45.  (1)

Giventhe followingXML Schema document, which of the following XML documents isvalid?

<xsd:schemaxmlns:xsd=”http://www.w3.org/2002/XMLSchema”>

 <xsd:elementname=”course”>

 <xsd:complexType> <xsd:sequence>

   <xsd:element ref=”name”/>

   <xsd:element name=”location” type=”xsd:string”/>

   <xsd:element maxOccurs=”unbounded”minOccurs=”1” ref=”student”/></xsd:sequence>

   <xsd:attribute name=”Code” type=”xsd:string”use=”optional”/></xsd:complexType>

 <xsd:element>

 <xsd:element name=”name” type=”xsd:string”/>

 <xsd:element name=”student”><xsd:complexType> <xsd:sequence>

   <xsd:element maxOccurs=”1” minOccurs=”0”ref=”name”/>

 <xsd:sequence> </xsd:complexType></xsd:element>

<xsd:schema>

A. <coursecode=”AA123”>

<name>Advancedcountingtechniques</name>

<location>Phoenix</location>

<student><name>BobBobberson</name></student>

</course>

B. <coursecode=”AA123”>

<name>Advancedcountingtechniques</name>

<location>Phoenix</location>

</course>

C. <coursecode=”AA123” location=”Phoenix”>

<name>Advancedcountingtechniques</name>

<student><name>BobBobberson</name></student>

</course>

D. <coursecode=”AA123”>

<location>Phoenix</location>

<name>Advancedcountingtechniques</name>

<student><name>BobBobberson</name></student>

</course>

(A)

 

46.  (1)

Anapplication isbeing written that will act as a B2B intermediary for variouscompanies. Thedata will come from many sources and will be delivered to manytargets. Each ofthe potential source companies and data types have not beendefined. Given theopen-ended nature of the requirements, which is the bestpotential design?

A.For each companyand data type, a custom conversion routine will transform thereceived data intoan appropriate ebXML defined XML schema that will be used tosend to targetcompanies.

B.For each companyand data type, a custom conversion routine will transform thereceived data intoan internal XML schema for local storage. When requested,the data will beconverted to the target company’s required format.

C.Define customXML Schema designs for each data type, and require that eachsource and targetcompany adhere to that vocabulary when sending for receivingdata.

D.Require thateach source and target company conform to an appropriate ebXMLstandard schemafor each data type.

(A)

 

47.  (3)

Whatare the threemain advantages of the Namespace recommendation?

AProvide a locatorfor any tangible resources

BProvide accessorsto DOM nodes in merged vocabularies

CPrevent namingcollisions in merged vocabularies

DPermitapplications to access a node by namespace

EAffect thevalidation

FAllow validationfor merged vocabularies

(BCF)

 

48.  (1)

The W3C DOMCoreinterfaces defines a minimal set of:

A. interfaces foraccessing and manipulating document objects

B. Java objectimplementations for use with XML parsers.

C. Conventions andprocesses for creating live HTML pages.

D. Mutabledocument trees.

(A)

 

49.  (1)

AnXML applicationprocesses XML documents with SAX2. What is the correct order ofthe methodsbeing called when processing the following XML document?

<?xmlversion=”1.0”encoding=”UTF-8”?>

<?xml-stylesheethref=”paragraph.css”type=”text/css”?>

<paragraph>Thisparagraphcontains<bold>some</bold>information</paragraph>

A.startDocument

 processingInstruction

 startElement

 startElement

  endElement

  endElement

  characters

characters

characters

endDocument

B.startDocument

 startElement

 startElement

  characters

  characters

  endElement

  characters

endElement

processingInstruction

endDocument

C.startDocument

 processingInstruction

 startElement

  characters

startElement

characters

endElement

characters

endElement

endDocument

D.startDocument

startElement

        characters

        startElement

        characters

        endElement

        characters

        endElement

        processingInstruction

        endDocument

(C)

 

50.  (1)

Giventhe followingDTD document, which of the following XML documents is valid?

<!ELEMENTdepartures(flight)>

<!ELEMENTdestination(#PCDATA)>

<!ELEMENTflight(destination)>

<!ATTLISTflightairline CDATA #REQUIRED>

<!ATTLISTflightgate CDATA #IMPLIED>

<!ATTLISTflightnumber CDATA #REQUIRED>

A.<departures>

<flightairline=”XYZ”number=”992”>

 <destination>YYZ</destination>

 </flight>

</departures>

B.<departures>

<flightairline=”XYZ”number=”992”>

 <destination>YYZ</destination>

         <destination>YOW</destination>

 </flight>

</departures>

C.<departures>

<flightairline=”XYZ”gate=”25”>

 <destination>YYZ</destination>

 </flight>

</departures>

D.<departures>

<destinationairline=”XYZ”number=”992” gate=”25”>

 <flight>YYZ</destination>

 </destination>

</departures>

(A)

 

51.  (2)

Whichtwo of thefollowing should be considered to increase performance when usingXSLT toprocess an XML instance document?

A.Use defaultattributes.

B.Use xsl:keyelements and the key() function to retrieve node sets.

C.Use ”//”(descendant axes) patterns near the root of a large document.

D.Where possible,use pattern matching rather than xsl:if or xsl: whenstatements.

E.Convert US ASCII(“US-ASCII”) documents to Unicode (“UTF-8” or “UTF-16”) beforeparsing.

(BD)

 

52.  (1)

Considerthefollowing XML document

<?xmlversion=”1.0”encoding=”UTF-8?”>

<Books>

  <BookID=”001”>

   <Title>Finding New World</Title>

   <Author>Jone Smith</Author>

 </Book>

  <BookID=”080”>

   <Title>How toProgramming</Title>

   <Author>Tom Alston</Author>

 </Book>

</Books>

AnXML developerwants to generate a HTML document that lists the ID, title andauthor of a bookin a HTML table. Which of the following stylesheets canachieve the desiredresult?

A.<?xmlversion=”1.0” encoding=”ISO-8859-1”?>

<xsl:stylesheetversion=”1.0”xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”>

<xsl:templatematch=”Books”>

<html>

<body>

  <tablewidth=”100%” border=”1”>

   <xsl:for-each select=”/”>

   <tr>

         <td><xsl:value-of select=”@ID”/></td>

         <td><xsl:value-of select=”Title”/></td>

         <td><xsl:value-of select=”Author”/></td>

       <tr>

       </xsl:for-each>

      </table>

    </body>

    </html>

    </xsl:template>

    </xsl:stylesheet>

B.<?xmlversion=”1.0” encoding=”ISO-8859-1”?>

<xsl:stylesheetversion=”1.0”xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”>

<xsl:templatematch=”/”>

<html>

<body>

  <tablewidth=”100%” border=”1”>

   <xsl:for-each select=”Books/Book”>

   <tr>

         <td><xsl:value-of select=”@ID”/></td>

         <td><xsl:value-of select=”Title”/></td>

         <td><xsl:value-of select=”Author”/></td>

       <tr>

       </xsl:for-each>

      </table>

    </body>

         </html>

    </xsl:template>

    </xsl:stylesheet>

C.<?xmlversion=”1.0” encoding=”ISO-8859-1”?>

<xsl:stylesheetversion=”1.0”xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”>

<xsl:templatematch=”/”>

<html>

<body>

  <tablewidth=”100%” border=”1”>

   <xsl:for-each select=”Books/Book”>

   <tr>

         <td><xsl:value-of select=”ID”/></td>

         <td><xsl:value-of select=”.”/></td>

         <td><xsl:value-of select=”.”/></td>

       <tr>

       </xsl:for-each>

      </table>

    </body>

    </html>

    </xsl:template>

    </xsl:stylesheet>

D.<?xmlversion=”1.0” encoding=”ISO-8859-1”?>

<xsl:stylesheetversion=”1.0”xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”>

<xsl:templatematch=”Books”>

<html>

<body>

  <tablewidth=”100%” border=”1”>

   <xsl:for-each select=”Book”>

   <tr>

         <td><xsl:value-of select=”ID”/></td>

         <td><xsl:value-of select=”Title”/></td>

         <td><xsl:value-of select=”Author”/></td>

       <tr>

       </xsl:for-each>

      </table>

    </body>

    </html>

    </xsl:template>

    </xsl:stylesheet>

(B)

 

53.  (1)

A Webapplicationmust support a variety of browser types and versions. Information isstored inthe database as XML data. How and where should the XML documet beprocessed forrendering?

A. Webapplicationsupplies both the XML data and the stylesheet to browsers, and letsthebrowsers make the rendering.

B. Webapplicationonly need to supply the XML data. Browsers can handle the renderingbythemselves.

C. Use XSL-FOtotransform XML data PDF form so that all the contents have the same lookandfeel on different browsers.

D. Webapplicationtransforms the XML data into HTML on the server side and then sendsto clientbrowsers.

(C)

 

54.  (1)

Given thefollowingDTD fragment, which XML instance document fragment will PASSvalidation?

<!ELEMENTplanet (country*)>

  <!ELEMENT country EMPTY>

  <!ATTLIST country cc     ID   #REQUIRED

                    name  CDATA #REQUIRED

                    border IDREF #IMPLIED

   >

A. <planet>

    <country  cc="au"

             name="Australia"/>

  </planet>

B. <planet>

    <country  cc="kn nv"

             name="Saint Kitts & Nevis"/>

  </planet>

C. <planet>

    <country  cc="3s"

             name="Spain"/>

  </planet>

D. <planet>

    <country  cc="ca"

             border="us"/>

  </planet>

(A)

 

55.  (1)

AnIntranet Webapplication provides news for thousands of users inside onecompany. Theapplication gets XML data from a database and then transforms thedata into HTMLwith server-side XSLT. Currently the web application performspoorly. Which ofthe following actions should the application developer to addressthe problem?

A.Updata thedatabase to a higher version.

B.Use well formedXHTML tags in the application.

C.Supply the XMLdata and the stylesheet to Web browsers.

D.Use XSL-FO tomake the transformation.

(C)

 

56.  (1)

Whichof thefollowing answers best defines the XForms design goal?

A.Utilizesexternal DTD for field types and value limits.

B.Encapulates allJavaScript code within data elements.

C.Define complexinput controls based on assigned Schema.

D.Separates theforms content from presentation.

(D)

 

57.  (1)

Whatwill thefollowing XSLT snippet return, if the value of parameter i is “redivider”?

<XSL:templatename=”Do”>

  <xsl:param name=”i”/>

 <xsl:variable name=”j” select=”string-length($i)”/>

 <xsl:choose>

   <xsl:when test=”$j<2”>

     <xsl:value-of select=”$i”/>

   </xsl:when>

 <xsl:otherwise>

    <xsl:variable name=”k” select=”floor($jdiv 2)”/>

    <xsl:call-template name=”Do”>

      <xsl:with-param name=”i” select=”substring($i,1, $k)”/>

    </xsl:call-template>

    <xsl:call-template name=”Do”>

      <xsl:with-param name=”i” select=”substring($i,$k+1, $k+1)”/>

    </xsl:call-template>

   </xsl:otherwise>

  </xsl:choose>

</xsl:template>

A.rreeddiivviiddeerr

B. rediv

C. redivider

D. rdvdr

(C)

 

58.  (1)

Giventhe followingDTD line, which of the following XML documents is valid?

   <!ATTLIST employee empNum ID#REQUIRED>

A.<employee empNum=”abcde”/>

B.<employee empNum=”12345”/>

C.<employee empNum=””/>

D.<employeeempNum=”abcde”/>…<employeeempNum=”abcde”/>

(A)

 

59.  (1)

Whatis the correctvalue for the match attribute of the xsl:template below toselect all elementswithin an XML document?

<xsl:templatematch=””>

 <xsl:value-of select=”name()”/>

 <xsl:value-of select=”@id”/>

 <xsl:apply-templates/>

</xsl:template>

A.node()

B.*/*

C.//

D./

(D)

 

60.  (1)

Whichof thefollowing statements regarding CSS transformation of XML is valid?

A.It can be usedto render XML into PDF.

B.It can renderXML into a format appropriate for printing.

C.It may only beapplied to well formed XHTML documents.

D.It can mergemultiple XML documents into a single XHTML for browser rendering.

(B)

 

61.  (1)

Thelink element inthe following XML fragment is the context node. Its targetattribute is storedwithin the XSL:variable linkTarget. What XPath expressionwill find the pageelement whose id attribute value is described by the valueof linkTarget?

<site>

  <pageid=”000”/>

  <pageid=”001”>

   <page id=”001_000”>

     <linktarget=”003_000”/>

   </page>

   <page id=”001_001”/>

 </page>

<pageid=”002”/>

<page id= ”003”>

<pageid=”003_000”/>

<pageid= “003_001”/>

 </page>

</site>

A..//page[@id=$linkTarget]

B../../pge[@id=’003’]/page[@id=linkTarget]

C.//page[@id=$linkTarget]

D.ancestor ::page/ancestor ::page/child ::page/child ::page[id=$linkTarget]

(C)

 

62.  (1)

Whatis the resultof the following XSLT template if the value of k is the string ‘foo’?

<xsl:templatename=”Do”>

 <xsl:param name=”j” select=”3”/>

  <xsl:param name=”k”/>

  <xsl:iftest=”$j”>

   <xsl:value-of select=”$k”/>

   <xsl:call-template name=”Do”>

     <xsl:with-param name=”j” select=”$j-1”/>

     <xsl:with-param name=”k” select=”$k”/>

   </ xsl:call-template>

 </xsl:if>

</xsl:template>

A.‘foo’

B.‘foo’(repeateduntil stack overflow)

C.‘foofoofoo’

D.‘foo foo foo’

(C)

 

63.  (1)

Whichof thefollowing is a trait that distinguishes XSLT2.0 from XSLT1.0?

A.xsl:for-each inXSLT 2.0 supports arbitrary sequences in addition to node sets.

B.xsl:value-of inXSLT2.0 includes an attribute called “delimiter” that allowsdelimitedsequences.

C.xsl:variable inXSLT 2.0 includes an tribute called “type” to indicate type.

D.xsl:with-paramin XSLT 2.0 does not throw an error if that parameter is notdefined in thecalled template.

(C)

 

64.  (1)

WhichXPath axisbelow may be described as “all nodes that contain the context node,but not thecontext node itself?”

A.ancestor::

B.ancestor-or-self::

C.namespace::

D.preceding::

(A)

 

65.  (1)

Anonline bookstoreoffers services that enables customers to view the onlineeBooks with a varietyof Web browsers and order high quality hard copies ondemand. If the bookstorestores all the book contents with XML format, which ofthe following renderingapproaches is the most suitable?

A.When browsersrequest and customers order hard copies, transform the XML datawith XSL-FO andthen convert the file into PDF for viewing and printing.

B.When browsersrequest and customers order hard copies, render the XML data withCSS and thenuse the file for viewing and printing.

C.When browsersrequest, render the XML data with CSS. When customers order hardcopies,transform the XML data with XSL-FO and then convert the file into PDFforprinting.

D.When browsersrequest, render the XML data with XSL-FO and then convert thefile into PDF forviewing. When customers order hard copies, transform the XMLdata with CSS andthen use the file for printing.

(C)

 

66.  (1)

Considerthefollowing XML document.

<?xmlversion=”1.0”encoding=”UTF-8”?>

<nsl:Company1xmlns:nsl=”http://www.acompany.com/” xmlns=”http://www.bcompany.com/”>

 <Company2>

<Company3xmlns=”http://www.ccompany.com/”>

 <Company4 ID=”4”/>

</Company3>

 </Company2>

</nsl:Company1>

Whichof thefollowing statements is true?

A.The usage ofnamespace is not correct, default namespace can’t be changed.

B.Namespace ofElement Company3 belongs to http://www.bcompany.com/.

C.Namespace ofElement Company4 belongs to http://www.ccompay.com/.

D.Namespace ofElement Company2 belongs to http://www.acompany.com/.

(C)

 

67.  (1)

Which ofthefollowing is a characteristic of XForms rendering?

A. Providesprecisecontrol over the form layout.

B. Providesdragand drop design of form elements.

C. Providesinputintent, but not rendering specifics.

D. Definesnewinput controls for date and time selections.

(C)

 

68.  (1)

Given twounequalintegers x and y, which XPath 1.0 expression is equivalent to thefollowingXSLT?

<xsl:choose>

  <xsl:when test="$x &gt; =$y">

     <xsl:value-ofselect="$x"/>

   </xsl:when>

  <xsl:otherwise>

    <xsl:value-ofselect="$y"/>

  </xsl:otherwise>

</xsl:choose>

A. ($x&lt;=$y)*$x+($y &lt;= $x)*$y

B. ($x&lt;=$y)*$x+($y &gt;= $x)*$y

C. ($x&gt;=$y)*$x+($y &lt;= $x)*$y

D. ($x&gt;=$y)*$x+($y &gt;= $x)*$y

(D)

 

69.  (1)

Forthe given XMLfragment:

<Examplexmlns:namespace1=”http://www.w3.org”xmlns=”http://www.ibm.com”>

<Itemaddress1=”US”namespace1:address2=”UK”/>

</Example>

Whichnamespacedoes the attribute address1 belong to ?

A.http://www.w3.org.

B.http://www.ibm.com.

C.http://www.w3.org/namespace.

D.It does notbelong to any namespaces.

(D)

 

70.  (1)

Aschema written inW3C Schema Language defines a person’s full name as a complextype composed ofthree child elements: first name, middle name, and last name.How should theschema author specify the middle name element as optional?

A.    Setattribute minOccurs = ”0” on the element.

B.    Setattribute maxOccurs = ”-1” on theelement.

C.   Setthe minimum length of the element’sstring type to zero.

D.   Usethe ? operator in the elementdeclaration.

(A)

 

71.  (1)

ADTD, as opposedto an XML schema, often provides a sufficient level ofvalidation for which ofthe following?

A.    Anarrative document.

B.    Anapplication record.

C.   ACSS stylesheet.

D.   AnXSLT stylesheet.

(A)

 

72.  (1)

Agarage door iscomposed of:
1) a set of four white sections,

2)a spring kit,

3)a track, and

4)a door opener.

Whichof thefollowing XML fragments best models this door?

A.     

<door>

<openermodel =“PickerUpper”>

        <track radius = “12”>

                  <spring-kit kind = “torsion”>

                           <section window =“yes” color = “white”/>

                           <section color = “white”/>

                           <section color = “white”/>

                  </spring-kit>

        </track>

</opener>

</door>

B.     

<door>

        <sections>

<openermodel =“PickerUpper” />

        <spring-kit kind = “torsion” />

        <track radius = “12”>

        <section window = “yes” color = “white”/>

        <section color = “white”/>

        <section color = “white”/>

        <section color = “white”/>

        </sections>

</door>

C.    

<door>

        <sections>

        <section window = “yes” color = “white”>

        <section color = “white”>

        <section color = “white”>

        </sections>

<trackradius =“12” />

<spring-kitkind = “torsion”>

<opener model =“PickerUpper”>

</door>

D.    

<door>

        <sections>

        <section window = “yes” color = “white”/>

        <section color = “white” />

        <section color = “white” />

        <section color = “white” />

</sections>

<trackradius =“12” />

<spring-kitkind = “torsion”/>

<opener model =“PickerUpper”/>

</door>

(D)

 

73.  (1)

Currently,most Webfront-end markup is not XML. A Web search for “car wash” yieldsdisparateresults about a movie and about cleaning automobiles. The searchengine poorlydistinguishes among kinds of results. What is the most likelycause of theproblem?

A.    Currentsearch engines index HTML pooly.

B.    WSDLmarkup mitigates the problem, but fewpages use it.

C.   Browerdesign trade-offs ignore semanticinformation.

D.   Afront-end HTML document conveys no datasemantics.

(D)

 

74.  (1)

Assumethat a W3CXML Schema Language document uses the following prefix declaration:

        <xs: schemaxmlns:xs = “http://www.w3.org/2001/XMLSchema”>

Whichof thefollowing should be used to directly define a type in that schema?

A.    xs:sequence

B.    xs:type

C.   xs:union

D.   xs:intersection

(C)

 

75.  (1)

Adeveloper createsa file named sample .xhtml. Which of the following is thebest example of properXHTML file content?

A.     

<!DOCTYPEhtmlPUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”“DTD/xhtml-transitional.dtd”>

        <html xmlns = “http://www.w3.org/1999/xhtml”>

                  <head>

                           <title>XHTMLSample</title>

                  </head>

                  <body bgcolor = “#ffffdd”>

                           <form onclick = “alert(‘Click’)”>

                                    <inputtype = “Checkbox” id = “id1” name = “verbose” value = “verbose”checked = “checked”/>

                           </form>

                  </body>

        </html>

B.     

<!DOCTYPEhtmlPUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”“DTD/xhtml-transitional.dtd”>

        <HTML xmlns = “http://www.w3.org/1999/xhtml”>

                  <HEAD>

                           <TITLE>XHTMLSample</TITLE>

                  </HEAD>

                  <BODY bgcolor = “#ffffdd”>

                           <FROM onclick = “alert(‘Click’)”>

                                    <inputtype = “Checkbox” id = “id1” name = “verbose” value = “verbose”checked = “checked”/>

                           </FROM>

                  </BODY>

        </HTML>

C.    

<!DOCTYPEhtmlPUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”“DTD/xhtml-transitional.dtd”>

        <html>

                  <head>

                           <title>XHTMLSample</title>

                  </head>

                  <body bgcolor = “#ffffdd”>

                           <form onclick = “alert(‘Click’)”>

                                    <inputtype = “Checkbox” id = “id1” name = “verbose” value = “verbose”checked = “1”/>

                           </form>

                  </body>

        </html>

D.    

<!DOCTYPEhtmlPUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”“DTD/xhtml-transitional.dtd”>

        <xhtml xmlns = “http://www.w3.org/1999/xhtml”>

                  <xhead>

                           <title>XHTMLSample</title>

                  </xhead>

                  <xbody bgcolor = “#ffffdd”>

                           <xform onclick = “alert(‘Click’)”>

                                    <xinputtype = “Checkbox” id = “id1” name = “verbose” value = “verbose”checked = “checked”/>

                           </xform>

                  </xbody>

        </xhtml>

(A)

 

76.  (1)

Whichof thefollowing elements will directly express a logical subset of an existingtypedeclared in an XML schema document?

A.    xs:restriction

B.    xs:extension

C.   xs:include

D.   xs:import

(A)

 

77.  (1)

Anapplicationparses large XML documents received via an HTTP connection. Thedata does notneed to be modified. The volume of traffic is high andperformance is an issue.Which of the following technologies should be used toparse the incomingdocument?

A.    DOM

B.    SAX

C.   XPath

D.   XSLT

(B)

 

78.  (1)

Consider thefollowingXML fragment

<Person id="1234567" sex="male">

<First-name>Smith</First-name>

<Last-name>Doe</Last-name>

</Person>

What can anXMLdeveloper do to gather the attributes of Person in SAX2-based XMLprocessing?

A.ImplementDocumentHandler and collect all of the Attributes passed on during thestartAttribute call-back method where the element name is Person.

B.ImplementDocumentHandler and collect the Attributes passed on during the start Elementcall-backmethod.

C.ImplementContentHandler and collect the Attributes passed on during the startElementcall-back method.

D.ImplementContentHandlerand collect all of the Attributes passed on during the startattribute call-backmethod where the element name is Person.

(C)

 

79.  (1)

Whichof thefollowing CORRECTLY describes the two letter abbreviations for theMid-Atlanticstates of the USA?NOTE: The Mid-Atlantic states are Maryland,North Corolina,Pennsylvania Virginia, and West Virginia, Their abbreviations are MD,NC, PA,VA, and WV, respectively.

A.<xsd:simpleTypename=”midAtlanticStates”>

<xsd:restrictionbased=”xsd:string”>

<xsd:lengthvalue=”2”/>

<xsd:patternvalue=”[A-Z]{2}”/>

</xsd:restriction>

        </xsd:simpleType>

B.<xsd:simpleTypename=”midAtlanticStates”>

<xsd:restrictionbase=”xsd:string”>

        <xsd:length value=”2”>

</xsd:restriction>

        </xsd:simpleType>

C.<xsd:simpleTypename=”midAtlanticStates”>

<xsd:restrictionbase=”xsd:string”>

<xsd:enumerationvalue=”MD”/>

<xsd:enumerationvalue=”NC”/>

<xsd:enumerationvalue=”PA”/>

<xsd:enumerationvalue=”VA”/>

<xsd:enumerationvalue=”WV”/>

</xsd:restriction>

        </xsd:simpleType>

D.<xsd:simpleTypename=”midAtlanticStates”>

<xsd:restrictionbase=”xsd:string”>

        <xsd:min value=”MD”/>

        <xsd:max value=”WV”/>

</xsd:restriction>

        </xsd:simpleType>

E.<xsd:simpleTypename=”midAtlanticStates”>

<xsd:restrctionbase=”xsd:string”>

<xsd:enumerationlist=”MD NC PA VA WV”>

</xsd:restrition>

</xsd:simpleType>

(C)

 

80. (1)

Whatmechanismwould an XML developer use to write the output of an XSLT processorto multiplefiles?

A.document(“xml.doc”)

B.save(“xml.doc”)

C.write(“xml.doc”)

D.output(“xml.doc”)

E.Thedeveloperwill have to use an extension mechanism, since it is not supported byXSLT 1.0

(E)

 

81.  (1)

Considerthefollowing XML

                  <temperature>-10</temperature>

                  processed by this XPathexpression

                  <xsl:value-ofselect=”number(//temperature)”/>

Whichof thefollowing is TRUE?

A.NaN will beoutput, since the argument is a string.

B.NaN will beoutput, since a non-numeric character was found.

C.This element maynot be found by the XPath expression.

D.The argument isconverted to a floating point number.

E.The argument isconverted to an integer.

(D)

 

82.  (1)

Fromthe XPathspecification, which of the following correctly defines the“following” axis?

A.All of the nodesof the following-sibling axis and the descendant axis.

B.All of the nodesof the following-sibling axis minus the nodes of the siblingaxis.

C.All of the nodesthe descendant axis the preceding axis.

D.All of the nodesthat are not a member of the preceding axis.

E.All of the nodesthat are after the context node, excluding any descendant,attribute, andnamespace nodes.

F.There is no suchaxis.

(E)

 

83.  (2)

TheHTML intervalresult element <table border=”{@SIZE}”/> can also bewritten as which ofthe following xslt fragment:

A.     <table>

                  <xsl:attribute name=”border”>

                  <xsl:value-of select=”@SIZE”/>

                  </xsl:attribute>

        </table>

B.     <xsl:element name=”table”>

        <xsl:attribute name=”border”>

                  <xsl:value-of select=”@SIZE”/>

        </xsl:attribute>

        </xsl:element>

C.    <table border=”xsl:value-of select=”@SIZE”/>

 

D.<tableborder=”@SIZE”/>

E.

        <xsl:apply-templates select=”table”/>

<xsl:apply-templatesselect=”@border”/>

F.     <xsl:variable name=”test”>

<xsl:apply-templatesselect=”table@border”/>

</xsl:variable>

<xsl:value-ofselect=”$variable”/>

(AB)

 

84.  (1)

 Anapplication needs to extract many smallsegments from many very large XMLdocuments. The extracted data needs to bemerged into a single document forfurther processing. What is the best way todesign this application?

A. Parselargedocuments using SAX, importing extracted segments into a commonDOMobject. 

B. Parselargedocuments using DOM, extract segments and import them into a common DOMobject.

C. Transformeachlarge document using XSLT to produce required segments, and then parseeachsegment directly int o a common DOM object.

D. Use theXSL"document()" function to load and then transform all largedocuments,to produce a single document containing all segments, that can thenbe parsedas a DOM object.

(C)

 

85.  (1)

 An XMLdeveloper extends the DefaultHandlerand overwrites its characters method. Inthe characters method, the applicationprints each chunk of character datapassed in to the screen. If the XMLdeveloper uses this XML application toprocess the following XML fragment, whatwill the XML developer view on thescreen?

<businessCard>

   <Name sex ="Male">Thomas</Name>

   <Title>Account</Title>

   <Phone>555-654345</Phone>

   <Email>[email protected]</Email>

</businessCard>

A.   BusinessCard

        thomas

        Account

        555-654345

        [email protected]

        BusinessCard

B.    BusinessCard

        Name

        Title

        Phone

        Email

        BusinessCard

C.    Thomas

        Account

        555-654345

        [email protected]

D.   Male

        thomas

        Account

        555-654345

        [email protected]

(C)

 

86.  (1)

TheParserAdapterclass in SAX2 converts:

A.a DOM2 Parsertype to a SAX2 Parser type.

B.a SAX2 Parsertype to a DOM2 Parser type

C.a SAX1 Parsertype to SAX2 XMLReader type

D.a SAX1 Parsertype to SAX2 Parser type

E.an InputSourcetype to SAX2 XMLReader type

(C)

 

87.  (1)

Whenusing an XMLparser in a custom XML processing module, the SAX parser interfaceis MOSTuseful when:

A.Documents mustbe processed in a nonlinear fashion.

B.Processor memoryis not an issue.

C.Serialprocessing of the XML documents is sufficient.

D.Theoutput of theprocess an XML document.

(C)

 

88.  (1)

Whatdoes thefollowing XSL template resolve?

        <xsl:template match=”Name”>

        <xsl:apply-templatesselect=”*[@Prefix]” />

        </xsl:template>

A.Find the firstchild element of “Name” with a “Prefix” attribute.

B.Find the “Name”elements with “Prefix” attribute.

C.Find all the“Name” elements with a “Prefix” attribute.

D.Find all thechild elements of “Name” with a “Prefix” attribute.

(D)

 

89.  (2)

Whichof thefollowing would raise an error if the empID attribute’s datatype wasdefined astype ID in the DTD?

A.<nameempID=”17563”> Joe Smith</name>

B.<nameempID=”_17563”> Joe Smith</name>

C.<nameempID=”a17563”> Joe Smith</name>

D.<nameempID=”ft17563”> Joe Smith</name>

E.<nameempID=””> Joe Smith</name>

(AE)

 

90.  (2)

Someadvantages ofthe Namespace recommendation are that it:(Select 2)

A.It provides alocator for any tangible resources.

B.It permitsapplications to access a node by namespace.錯

C.It preventsnaming collisions in merged vocabularies.

D.It is fullysupported by DTDs. 肯定錯

(AC)

 

91.  (1)

Expressions areused in XSLT for all thefollowing purposes EXCEPT:

A.to select nodesfor processing

B.to specifyconditions for different waysof processing a node

c.to process<![CDATA[...]>section inthe XML document instance

D.to generate textto inserted in theresult tree

(C)

 

92.  (1)

Tocapture whethera customer is active or inactive, which of these XML models isBEST?

A.<!ATTLISTCustomer Active CDATA #REQUIRED>

B.<!ATTLISTCustomer Active (1|0) “1”>

C.<!ATTLISTCustomer ActiveStatus (yes|no) “yes”>

D.<!ATTLISTCustomer Status (active|inactive) “active”>

(D)

 

93.  (1)

What is theresultof the following XSLT template?

<xls:templatename="Do">

  <xsl:param name="j"select="5"/>

  <xsl:param name="k"select="1"/>

  <xsl:choose>

     <xsl:when test="$j &lt;2">

       <xsl:value-ofselect="$k"/>

     </xsl:when>

     <xsl:otherwise>

       <xsl:call-template name="Do">

          <xsl:with-paramname="j" select="$j-1"/>

          <xsl:with-paramname="k" select="$j*$k"/>

       </xsl:call-template>

     </xsl:otherwise>

  </xsl:choose>

</xls:template>

A. 1 2 3 4 5

B. 15

C. 60

D. 120

(D)

 

94.  (1)

An onlinetradingsystem supports multiple clients such as Web Browsers, PersonalDigitalAssistants(PDAs) and mobile phones. It retrieves XML data from a nativeXMLdatabase and then displays the information to different clients. Whichapproachis more suitable for rendering the data sent to different devices?

A. Thetradingsystem should send both the raw XML data and devices-specific files toclients.

B. Thetradingsystem should transform the XML data into the devices-specific formatson theserver.

C. The XMLdatashould be converted to XHTML then sent to different devices.

D. XSL-FO shouldbeused for different rendering targets.

(D)

 

95.  (1)

For stringvaluesof i of length less than 20, the XSLT template below will output i inreverseorder. What would be the output of this template if the order of thetwotemplate calls between the two comments('START' and 'END') were reversed?

<xsl:templatename="Do">

 <xsl:param name="i"/>

 <xsl:variable name="j"select="string-length($i)"/>

 <xsl:choose>

   <xsl:when test="$j<2">

     <xsl:value-ofselect="$i"/>

   </xsl:when>

   <xsl:otherwise>

     <xsl:variable name="k"select="floor($j div2)"/>

     <!--START-->

     <xsl:call-templatename="Do">

        <xsl:with param name="i"select="substring($i, $k+1,$k+1)"/>

     </xsl:call-template>

     <xsl:call-templatename="Do">

        <xsl:with-param name="i"select="substring($i, 1,$k)"/>

     </xsl:call-template>

     <!--END-->

   </xsl:otherwise>

 </xsl:choose>

</xsl:template>  

A. Alternatethevalute of i and the value of k by the number of this times indicated by j.

B. Repeat thevalueof i.

C. Reversethevalue of i.

D. Donothingbecause the value of j cannot be changed once assigned.

(B)

 

96.  (1)

A DTD ismoreconvenient than an XML schema for which of the following purpose?

A.Explicitysupporting a namespace.

B. Enforcingsimpledata types for attribute values.

C. Limitinglengthof content.

D. Defininggeneralentities.

(D)

 

 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章