山东大学IBM XML模拟题

来源:互联网 发布:美工助理招聘 编辑:程序博客网 时间:2024/05/17 07:09

1.  (1)

The W3C DOM Coreinterfaces defines a minimal set of:

A.interfaces for accessing and manipulating document objects

B. Javaobject implementations for use with XML parsers.

C. Conventions and processes for creating live HTML pages.

D. Mutable document trees.

(A)

 

2.  (1)

Which of thefollowing lists contains only valid W3C XML Schema Language simple schematypes?

A. anyURL,char,encoding, UTF8

B. fullname,double, long, int

C. TOKEN,timestamp, range,char

D. byte, duration,ENTITY, NMTOKEN

(D)

 

3.  (1)

 Assume that a W3C XML Schema Language documentdesigner uses the following prefix declaration

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

The designerevaluates the choice of attribute versus elements to describe a structure.Which of the following is a valid reason to avoid attributes for a complexstructural representation?

A. Elements areapproximateley twice as concise as attributes.

B. An elements isrestricted to meta-data representation.

C. An attributevalue is restricted to representing string data.

D. An attributevalue cannot contain elements.

(D)

 

4.  (1)

Duringparsing, how many startElement messages will the ContentHandler for thefollowing XML document receive?

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

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

<!DOCTYPEperson SYSTEM “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 XML documents need to be merged and transformed into a single XHTMLresult. Which of the following actions is best to accomplish this task?

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

B.Use an external utility to concatenate all the XML documents and pass theresulting XML to an XSLT transformer to convert to XHTML.

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

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

(C)

 

6.  (1)

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

<customerid=”2”>

  <name>SwellMobile</name>

  <address><city>Kansas City</city><state>MO</state></address>

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

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

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

  </purchase>

</customer>

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

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

where$i/@ id=123

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

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

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

return$c/name

C.for $c in XMLCOLUMN(“cust.data”)

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

return$c/name

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

return$c/name

(B)

 

7.  (1)

A W3C SchemaLanguage document designer must incorporate declarations from an externalWeb-hosted type library schema belonging to another namespace. Which schemaelement can the designer use to incorporate the external schema so as to reuseits types and elements?

A. xs:require

B. xs:include

C. xs:import

D. xs:redefine

(C)

 

8.  (1)

Consider the givenXML fragment:

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

     <Item1 address1="US"/>

     <namespace1:Item2address="US"/>

 <Example>

To which of thefollowing namespaces does the element Item1 belong?

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

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

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

D. It does notbelong to any namespaces.

(B)

 

9.  (1)

A complex XMLformat is to be widely shared acoross organizations that do not normallyinteract. At a minimum, what kind of information about the format should beshared?

A. An XSDL documentfor the format.

B. The document'sebXML grammar.

C. Formal schemasor DTDs for the format.

D. A stylesheet.

(C)

 

10. (1)

 To make XSLT templates more robust, theparameters(x,y) are checked for errors and boundary conditions.

Which of thefollowing tests is NOT necessary?

A. x = y

B. x != y

C. x has anon-numeric value

D. y does not havea value

(D)

 

11. (1)

An applicationapplies internal business rules to generate XML documents. XSL stylesheets canthen perform complex calculations on the XML documents to produce summaryreports.What is the best solution to resolve the complexities of the XSLTcalculations?

A. Extract all thecalculation logic form the XSL and put them into included functions to beshared by all the stylesheets.

B. Move thecalculations into the business rules logic of the applicaction and export theresults as part of the XML content.

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

D. Create a customXSL extensions for each calculation and import them into each definedstylesheet.

(C)?(A)?

 

12. (1)

A form contains thefollowing fields:

   1)First name

   2)Middle name

   3)Last name

   4)Street

   5)City

   6)State

   7)Postal code

Which of thefollowing 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>

 </add form>

 

C. <form>

   <name fullname="Suggins. ElvoodP">

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

   <form>

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

   <name fullname="Suggins ElvoodP">

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

   </addr form>

(A)

 

13. (1)

Given an externalDTD line

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

 and an internal DTD line:

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

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

A. Document willnot 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. The lastdeclaration the parser encounters takes precedence.

(B)

 

14. (1)

An applicatin menubar will contain a tree of labeled command "item" elements nested toan arbitrary depth. Which of the following XML fragments can define the menubar?

A.<m:menu xmlns: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:menu xmlns: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:menu xmlns: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:menu xmlns: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 the following may NOT be nested within a CDATA section?

A.HTML documents

B.Javascript source

C.Other CDATA sections

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

E. XSLT that needs to beprocessed

(CE)

 

16.  (1)

Ina museum, XML data stored on powerful servers is served to customers throughWeb browsers running on network-connected computers. The performance of thosecomputers is limited. Which of the following approaches will best suit the XMLtransformation?

A.Pass both the XML data and stylesheets to web browsers.

B.Output XHTML via a server-side XSL transformation.

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

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

(D)

 

17.  (1)

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

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

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

C. At the beginningof the XML document, add Price namespace declarations for different vendors.

D. Put three samePrice tags into the XML document, XML processor has embedded mechanism todifferentiate them.

(C)

 

18.  (1)

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

A. XQuery supportsinsert, update, and delete operations.

B. XQuery supportsFLWOR join operations across three XML documents.

C. XSLT supportstransformation of SQL result sets. SQL aliases cannot be used for column namesand table names.

D. SQL supportsquering the contents of XML documents stored as BLOBs. SQL does not supportnamespaces.

(B)

 

19.  (1)

XML is beingtransformed using XSLT. An xsl:variable is needed later in this process to setan element color. Which of the following is the way to initialize thexsl:variable hue based upon the value of the context node's status attribute?

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 XML developer store binary data which has been encoded (as base64) asthe

contentof an element "image" in an XML document?

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

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

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

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

E.Binary data cannot be stored.

(C)

 

21.  (1)

TheXML spec constrains the valid values for an ID attribute. Which of thefollowing is FALSE?

A.ID attribute value cannot begin with and contain any whitespace.

B.ID attribute value cannot begin with a number.

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

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

(C)

 

22.  (1)

How should a CSSstylesheet be applied to an XML document?

A. Preprocess theXML using and XSLT stylesheet to transform the document to valid HTML first.Then send the XHTML document to the browser.

B. Embed a<style type="text/css">...</style> element within the XMLdocument that contains CSS rendering instructions.

C. Use XSLTC toapply the CSS to the XML DOM, and return the results as an XHTML document tothe browser.

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

(D)

 

23.  (1)

A comma delimitedlist is being constructed via the XSLT fragment below. Which of the followingways is most appropriate to conditionally write a comma after each value in thelist except for the last one?

<xsl:for-each select="//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 the defaultaxis in XPath?

A.descendant::

B.descendant-or-self::

C. child::

D. parent::

(C)

 

25.  (1)

Giventhe following DTD 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>computer scientist</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>

was a<profession>computer scientist</profession>

</person>

C.<person>

<name>

  <first_name>Alan</first_name>

<last_name>Turing</last_name>

</name>

<publication>OnComputable Numbers</publication>

</person>

D.<person>

<name>

  <first_name>Alan</first_name>

<last_name>Turing</last_name>

</name>

</person>

(D)

 

26.  (1)

Anapplication saves and restores internal program state across invocations. Theoffline state resides in an XML file. Only that one application reads andwrites the file. The designer wrote a constraint schema for the XML, and hadthe application validate the state file upon input. Which of the followingindicates why?

A.    To detect data corruption.

B.    To automatically convert string fields tonumeric.

C.   To optimize parsing.

D.   To bind the file to a set of state objects.

(A)

 

27.  (1)

A company isdeveloping an AJAX(AsynchronousJavaScript and XML) application which passes XML between the client and theserver. After the client's Web browser receives the server response, whichtechnology is NOT suited for rendering the XML data?

A. XSLT

B. XSL-FO

C. CSS

D. Javascript

(D)

 

28.  (1)

Which of the followingis NOT necessarily a trait of “tail recursion”?

A. Depending uponthe stylesheet processor, it may not exhaust the stack space as quickly asgeneral recursion.

B. Each recursivecall sets up the next sub-problem to be half as large as the current one.

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

D. The recursivecall comes at the end of the template.

(B)

 

29.  (1)

Considering thefollowing 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 XML developerwants to output the above document as a colon delimited text file, which of thefollowing stylesheets can achieve the desired result?

A. <?xml version="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="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. <?xml version="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. <?xml version="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. <?xml version="1.0"encoding="UTF-8"?>

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

   <xsl:output method="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 documents ofthe same schema design are received from many unknown sources. The documentswill be stored as native XML, and accessed randomly, but frequently from manydifferent Web Service methods. What is the best processing path to manage thesedocuments?

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

B. Persist receiveddocuments, when requested, parse, validate, and transform the document to theproper format.

C. Receiveddocuments should be parsed, validated, and transformed into each defined targetformat, which are then persisted. When requested the proper pre-formatteddocument is retrieved.

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

(C)

 

31.  (1)

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

<ELEMENT course(name, location, student)>

<!ELEMENTlocation (#PCDATA)>

<!ELEMENT name(#PCDATA)>

<!ELEMENTstudent (name)>

<!ATTLIST coursecode CDATA #IMPLIED>

<!ATTLISTstudent id CDATA #IMPLIED>

A.<course code="AA123">

      <location>Phoenix</location>

      <name>Advanced counting techniques</name>

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

   </course>

B.<course code="AA123">

     <name>Advanced counting techniques</name>

     <location>Phoenix</location>

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

    </course>

C.<course code="AA123">

      <name>Advanced counting techniques</name>

      <location>Phoenix</location>

   </course>

D.<course code="AA123" location="Phoenix">

      <name>Advanced counting techniques</name>

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

   </course>

(B)

 

32.  (1)

An auto partssupplier stores customer data as XML in a database in the following format.

<customer id="2">

   <name>SvellMobile</name>

  <address><city>Kansas City</city><state>MO</state></address>

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

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

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

   </purchase>

</customer>

Which of thefollowing XQuery statements returns the names of the customers who have madepurchases with a totalCost over 1000?

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

B. for $c inXMLCOLUMN("cust.data")

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

return $c/name

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

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

where $p/@totalCost> 1000

return $c/name

D. for $c inXMLCOLUMN("cust.data")/customer

where$c/purchase[@totalCost > 1000]

return $c/name

(D)

 

33.  (1)

Given the followingXML instance 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 the followingXML Schema document, which of the following XML documents is valid?

<xsd:schema xmlns : 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 of thefollowing 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. Declaring numberas 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 the follwing statements are true aboutthese lines of JavaScript?

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

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

       para.appendChild(newText);

A. For the lines towork correctly, there must be an element with an ID attribute of"example"  

B. newText will beappended as the last child of the node with an ID attribute of"example"         

C. newText will beappended as the first child of the node with an ID attribute of"example"

D. If there is noelement with an ID attribute of "example", newText will be appendedto the end of the document

E. If newText iscurrently part of the document, the append will fail.

(AB)

 

37.  (2)

Which of the following two statements must be used tovalidate an XML instance document with SAX?

A. XMLParser parser= XMLParserFactory.createXMLParser();

B. XMLParser parser= new XMLReader();

C. XMLParser parser= 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 the followingXML fragment

<Employee>

         <Age>35</Age>

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

         <Salary>10000</Salary>

</Employee>

Which SAX2interface should the developer implement to extract the value of the XMLcomment?

A. ContentHandler

B. DTDHandler

C. EntityResolver

D. LexicalHandler

(D)

 

39.  (2)

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

A. The children of thechild are kept in the document.

B. The child and allits children are removed.

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

D. All pointers areautomatically updated.

E. If the child doesnot exist in the document, nothing will happen.

(BD)

 

40.  (1)

Giventhe following XML fragment

  <Book IFN="SG24-6369-01">

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

      <Publisher> IBM </Publisher>

  </Book>      

 How can an XML developer extract the Nameelement and its contents in SAX2-based XML processing?

A.Implement DocumentHandler and use the startElement and characters methods.

B.Implement DocumentHandler and use the startDocument and characters methods.

C.Implement ContentHandler and use the startElement and characters methods.

D.Implement ContentHandler and use the startDocument and characters methods.

(C)

 

41.  (1)

Whichof the following are considered by the DOM API to be a leaf-level node withoutany child nodes?

A.Attr

B.Text

C.Entity

D.EntityReference

E.ProcessingInstruction

(BE)

 

42.  (2)

Avalidating parser is not required to :

A.Performattribute defaulting

B.DereferenceNamespaces. 废弃,解除参照

C.Expandexternal entity references.

D.Validatedatatypes.

E.validateCDATA sections

(AE)

 

43.  (1)

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

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

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

C.Each of the parsed entities referenced is well-formed.                 

D.The root element CANNOT belong to a namespace.           

E.An attribute value cannot have reference to an entity.

(C)

 

44.  (1)

Giventhe following XML instance document fragment:

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

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

UsingDOM2, which of 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 following XML Schema document, which of the following XML documents isvalid?

<xsd:schema xmlns: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. <course code=”AA123”>

<name>Advancedcounting techniques</name>

<location>Phoenix</location>

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

</course>

B. <course code=”AA123”>

<name>Advancedcounting techniques</name>

<location>Phoenix</location>

</course>

C. <course code=”AA123” location=”Phoenix”>

<name>Advancedcounting techniques</name>

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

</course>

D. <course code=”AA123”>

<location>Phoenix</location>

<name>Advancedcounting techniques</name>

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

</course>

(A)

 

46.  (1)

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

A.For each company and data type, a custom conversion routine will transform thereceived data into an appropriate ebXML defined XML schema that will be used tosend to target companies.

B.For each company and data type, a custom conversion routine will transform thereceived data into an internal XML schema for local storage. When requested,the data will be converted to the target company’s required format.

C.Define custom XML Schema designs for each data type, and require that eachsource and target company adhere to that vocabulary when sending for receivingdata.

D.Require that each source and target company conform to an appropriate ebXMLstandard schema for each data type.

(A)

 

47.  (3)

Whatare the three main advantages of the Namespace recommendation?

AProvide a locator for any tangible resources

BProvide accessors to DOM nodes in merged vocabularies

CPrevent naming collisions in merged vocabularies

DPermit applications to access a node by namespace

EAffect the validation

FAllow validation for merged vocabularies

(BCF)

 

48.  (1)

The W3C DOMCore interfaces defines a minimal set of:

A. interfaces for accessing and manipulating document objects

B. Java object implementations for use with XML parsers.

C. Conventions and processes for creating live HTML pages.

D. Mutable document trees.

(A)

 

49.  (1)

AnXML application processes XML documents with SAX2. What is the correct order ofthe methods being called when processing the following XML document?

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

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

<paragraph>Thisparagraph contains<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 following DTD document, which of the following XML documents is valid?

<!ELEMENTdepartures (flight)>

<!ELEMENTdestination (#PCDATA)>

<!ELEMENTflight (destination)>

<!ATTLISTflight airline CDATA #REQUIRED>

<!ATTLISTflight gate CDATA #IMPLIED>

<!ATTLISTflight number 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 the following should be considered to increase performance when usingXSLT to process an XML instance document?

A.Use default attributes.

B.Use xsl:key elements 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)

Considerthe following XML document

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

<Books>

  <Book ID=”001”>

    <Title>Finding New World</Title>

    <Author>Jone Smith</Author>

  </Book>

  <Book ID=”080”>

    <Title>How toProgramming</Title>

    <Author>Tom Alston</Author>

  </Book>

</Books>

AnXML developer wants to generate a HTML document that lists the ID, title andauthor of a book in a HTML table. Which of the following stylesheets canachieve the desired result?

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

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

<xsl:templatematch=”Books”>

<html>

<body>

  <table width=”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.<?xml version=”1.0” encoding=”ISO-8859-1”?>

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

<xsl:templatematch=”/”>

<html>

<body>

  <table width=”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.<?xml version=”1.0” encoding=”ISO-8859-1”?>

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

<xsl:templatematch=”/”>

<html>

<body>

  <table width=”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.<?xml version=”1.0” encoding=”ISO-8859-1”?>

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

<xsl:templatematch=”Books”>

<html>

<body>

  <table width=”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 Web applicationmust support a variety of browser types and versions. Information is stored inthe database as XML data. How and where should the XML documet be processed forrendering?

A. Web applicationsupplies both the XML data and the stylesheet to browsers, and lets thebrowsers make the rendering.

B. Web applicationonly need to supply the XML data. Browsers can handle the rendering bythemselves.

C. Use XSL-FO totransform XML data PDF form so that all the contents have the same look andfeel on different browsers.

D. Web applicationtransforms the XML data into HTML on the server side and then sends to clientbrowsers.

(C)

 

54.  (1)

Given the followingDTD fragment, which XML instance document fragment will PASS validation?

<!ELEMENT planet (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 Web application provides news for thousands of users inside onecompany. The application gets XML data from a database and then transforms thedata into HTML with server-side XSLT. Currently the web application performspoorly. Which of the following actions should the application developer to addressthe problem?

A.Updata the database to a higher version.

B.Use well formed XHTML tags in the application.

C.Supply the XML data and the stylesheet to Web browsers.

D.Use XSL-FO to make the transformation.

(C)

 

56.  (1)

Whichof the following answers best defines the XForms design goal?

A.Utilizes external DTD for field types and value limits.

B.Encapulates all JavaScript code within data elements.

C.Define complex input controls based on assigned Schema.

D.Separates the forms content from presentation.

(D)

 

57.  (1)

Whatwill the following 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 following DTD 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.<employee empNum=”abcde”/>…<employeeempNum=”abcde”/>

(A)

 

59.  (1)

Whatis the correct value for the match attribute of the xsl:template below toselect all elements within 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 the following statements regarding CSS transformation of XML is valid?

A.It can be used to render XML into PDF.

B.It can render XML into a format appropriate for printing.

C.It may only be applied to well formed XHTML documents.

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

(B)

 

61.  (1)

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

<site>

  <page id=”000”/>

  <page id=”001”>

    <page id=”001_000”>

      <linktarget=”003_000”/>

    </page>

    <page id=”001_001”/>

  </page>

<page id=”002”/>

<page id= ”003”>

<page id=”003_000”/>

<page id= “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 result of 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:if test=”$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’(repeated until stack overflow)

C.‘foofoofoo’

D.‘foo foo foo’

(C)

 

63.  (1)

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

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

B.xsl:value-of in XSLT2.0 includes an attribute called “delimiter” that allowsdelimited sequences.

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

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

(C)

 

64.  (1)

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

A.ancestor::

B.ancestor-or-self::

C.namespace::

D.preceding::

(A)

 

65.  (1)

Anonline bookstore offers services that enables customers to view the onlineeBooks with a variety of Web browsers and order high quality hard copies ondemand. If the bookstore stores all the book contents with XML format, which ofthe following rendering approaches is the most suitable?

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

B.When browsers request and customers order hard copies, render the XML data withCSS and then use the file for viewing and printing.

C.When browsers request, render the XML data with CSS. When customers order hardcopies, transform the XML data with XSL-FO and then convert the file into PDFfor printing.

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

(C)

 

66.  (1)

Considerthe following 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 the following statements is true?

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

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

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

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

(C)

 

67.  (1)

Which of thefollowing is a characteristic of XForms rendering?

A. Provides precisecontrol over the form layout.

B. Provides dragand drop design of form elements.

C. Provides inputintent, but not rendering specifics.

D. Defines newinput controls for date and time selections.

(C)

 

68.  (1)

Given two unequalintegers x and y, which XPath 1.0 expression is equivalent to the followingXSLT?

<xsl:choose>

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

     <xsl:value-of select="$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 XML fragment:

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

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

</Example>

Whichnamespace does the attribute address1 belong to ?

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

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

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

D.It does not belong to any namespaces.

(D)

 

70.  (1)

Aschema written in W3C Schema Language defines a person’s full name as a complextype composed of three child elements: first name, middle name, and last name.How should the schema author specify the middle name element as optional?

A.    Set attribute minOccurs = ”0” on the element.

B.    Set attribute maxOccurs = ”-1” on theelement.

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

D.   Use the ? operator in the elementdeclaration.

(A)

 

71.  (1)

ADTD, as opposed to an XML schema, often provides a sufficient level ofvalidation for which of the following?

A.    A narrative document.

B.    An application record.

C.   A CSS stylesheet.

D.   An XSLT stylesheet.

(A)

 

72.  (1)

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

2)a spring kit,

3)a track, and

4)a door opener.

Whichof the following 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-kit kind = “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-kit kind = “torsion”/>

<opener model = “PickerUpper”/>

</door>

(D)

 

73.  (1)

Currently,most Web front-end markup is not XML. A Web search for “car wash” yieldsdisparate results about a movie and about cleaning automobiles. The searchengine poorly distinguishes among kinds of results. What is the most likelycause of the problem?

A.    Current search engines index HTML pooly.

B.    WSDL markup mitigates the problem, but fewpages use it.

C.   Brower design trade-offs ignore semanticinformation.

D.   A front-end HTML document conveys no datasemantics.

(D)

 

74.  (1)

Assumethat a W3C XML Schema Language document uses the following prefix declaration:

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

Whichof the following 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 creates a file named sample .xhtml. Which of the following is thebest example of proper XHTML file content?

A.     

<!DOCTYPEhtml PUBLIC “-//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.     

<!DOCTYPEhtml PUBLIC “-//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.    

<!DOCTYPEhtml PUBLIC “-//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.    

<!DOCTYPEhtml PUBLIC “-//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 the following elements will directly express a logical subset of an existingtype declared in an XML schema document?

A.    xs:restriction

B.    xs:extension

C.   xs:include

D.   xs:import

(A)

 

77.  (1)

Anapplication parses large XML documents received via an HTTP connection. Thedata does not need to be modified. The volume of traffic is high andperformance is an issue. Which of the following technologies should be used toparse the incoming document?

A.    DOM

B.    SAX

C.   XPath

D.   XSLT

(B)

 

78.  (1)

Consider the followingXML fragment

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

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

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

</Person>

What can an XMLdeveloper do to gather the attributes of Person in SAX2-based XML processing?

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

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

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

D.ImplementContentHandler and collect all of the Attributes passed on during the startattribute call-back method where the element name is Person.

(C)

 

79.  (1)

Whichof the following CORRECTLY describes the two letter abbreviations for theMid-Atlantic states 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:simpleType name=”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:simpleType name=”midAtlanticStates”>

<xsd:restrctionbase=”xsd:string”>

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

</xsd:restrition>

</xsd:simpleType>

(C)

 

80. (1)

Whatmechanism would an XML developer use to write the output of an XSLT processorto multiple files?

A.document(“xml.doc”)

B.save(“xml.doc”)

C.write(“xml.doc”)

D.output(“xml.doc”)

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

(E)

 

81.  (1)

Considerthe following XML

                   <temperature>-10</temperature>

                   processed by this XPathexpression

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

Whichof the following is TRUE?

A.NaN will be output, since the argument is a string.

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

C.This element may not be found by the XPath expression.

D.The argument is converted to a floating point number.

E.The argument is converted to an integer.

(D)

 

82.  (1)

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

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

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

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

D.All of the nodes that are not a member of the preceding axis.

E.All of the nodes that are after the context node, excluding any descendant,attribute, and namespace nodes.

F.There is no such axis.

(E)

 

83.  (2)

TheHTML interval result element <table border=”{@SIZE}”/> can also bewritten as which of the 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)

 An application needs to extract many smallsegments from many very large XML documents. The extracted data needs to bemerged into a single document for further processing. What is the best way todesign this application?

A. Parse largedocuments using SAX, importing extracted segments into a common DOMobject. 

B. Parse largedocuments using DOM, extract segments and import them into a common DOM object.

C. Transform eachlarge document using XSLT to produce required segments, and then parse eachsegment directly int o a common DOM object.

D. Use the XSL"document()" function to load and then transform all large documents,to produce a single document containing all segments, that can then be parsedas a DOM object.

(C)

 

85.  (1)

 An XML developer extends the DefaultHandlerand overwrites its characters method. In the characters method, the applicationprints each chunk of character data passed in to the screen. If the XMLdeveloper uses this XML application to process the following XML fragment, whatwill the XML developer view on the screen?

<businessCard>

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

    <Title>Account</Title>

    <Phone>555-654345</Phone>

    <Email>xxx@acompany.com</Email>

</businessCard>

A.    BusinessCard

         thomas

         Account

         555-654345

         xxx@ibm.com

         BusinessCard

B.     BusinessCard

         Name

         Title

         Phone

         Email

         BusinessCard

C.     Thomas

         Account

         555-654345

         xxx@acompany.com

D.    Male

         thomas

         Account

         555-654345

         xxx@acompany.com

(C)

 

86.  (1)

TheParserAdapter class in SAX2 converts:

A.a DOM2 Parser type to a SAX2 Parser type.

B.a SAX2 Parser type to a DOM2 Parser type

C.a SAX1 Parser type to SAX2 XMLReader type

D.a SAX1 Parser type to SAX2 Parser type

E.an InputSource type to SAX2 XMLReader type

(C)

 

87.  (1)

Whenusing an XML parser in a custom XML processing module, the SAX parser interfaceis MOST useful when:

A.Documents must be processed in a nonlinear fashion.

B.Processor memory is not an issue.

C.Serial processing of the XML documents is sufficient.

D.Theoutput of the process an XML document.

(C)

 

88.  (1)

Whatdoes the following XSL template resolve?

         <xsl:template match=”Name”>

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

         </xsl:template>

A.Find the first child 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 the child elements of “Name” with a “Prefix” attribute.

(D)

 

89.  (2)

Whichof the following would raise an error if the empID attribute’s datatype wasdefined as type ID in the DTD?

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

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

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

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

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

(AE)

 

90.  (2)

Someadvantages of the Namespace recommendation are that it:(Select 2)

A.It provides a locator for any tangible resources.

B.It permits applications to access a node by namespace.错

C.It prevents naming collisions in merged vocabularies.

D.It is fully supported by DTDs. 肯定错

(AC)

 

91.  (1)

Expressions are used in XSLT for all thefollowing purposes EXCEPT:

A.to select nodes for processing

B.to specify conditions for different waysof processing a node

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

D.to generate text to inserted in theresult tree

(C)

 

92.  (1)

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

A.<!ATTLIST Customer Active CDATA #REQUIRED>

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

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

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

(D)

 

93.  (1)

What is the resultof 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 online tradingsystem supports multiple clients such as Web Browsers, Personal DigitalAssistants(PDAs) and mobile phones. It retrieves XML data from a native XMLdatabase and then displays the information to different clients. Which approachis more suitable for rendering the data sent to different devices?

A. The tradingsystem should send both the raw XML data and devices-specific files to clients.

B. The tradingsystem should transform the XML data into the devices-specific formats on theserver.

C. The XML datashould be converted to XHTML then sent to different devices.

D. XSL-FO should beused for different rendering targets.

(D)

 

95.  (1)

For string valuesof i of length less than 20, the XSLT template below will output i in reverseorder. What would be the output of this template if the order of the twotemplate 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. Alternate thevalute of i and the value of k by the number of this times indicated by j.

B. Repeat the valueof i.

C. Reverse thevalue of i.

D. Do nothingbecause the value of j cannot be changed once assigned.

(B)

 

96.  (1)

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

A. Explicitysupporting a namespace.

B. Enforcing simpledata types for attribute values.

C. Limiting lengthof content.

D. Defining generalentities.

(D)

 

 

0 0