xml q and a

Embed Size (px)

Citation preview

  • 8/18/2019 xml q and a

    1/14

  • 8/18/2019 xml q and a

    2/14

    SBM011

    Which of the following options is NOT true aboutinclude element?

    1, The includeelement is usedto include orrefer to anexternal schemathat is locatedat a definiteaddress.

    2, The includeelementcontains theschemaLocationattribute.

    3, The includeelement can havemultipleoccurrences in anXSD document.

    4, The inclelement allyou to accecomponenmultiple scthat may bto differentargetnamespace

    yes SBM012

    You want to refer a set of related elements byusing a common name in an XML schema. Whichof the following elements can be incorporated intoa complex data type to achieve this?

    1, sequence 2, group 3, attributeGroup 4, all

    yes SBM013

    Which of the following text properties can beapplied only to inline elements?

    1, vertical-align 2, text-transform

    3, text-align 4, text-inde

    yes SBM014

    Which of the following statements is NOT trueabout XSLT?

    1, Uses lessmemory

    2, Written usingXML and followsXML syntax

    3, Complex to use 4, Can reordadd, or delelements

    SBM015

    Which of the following characters in Xpathexpressions searches for the specified element at

    any node level?

    1, // 2, / 3, . 4, *

    yes SBM016

    Which of the following operators is used to checkwhether a value of price is greater than or equal to20?

    1, PRICE[ .&>= 20]

    2, PRICE[ .&&gt= 20]

    3, PRICE[ . &&gt=;20]

    4, PRICE &20

    yes SBM017

    Which of the following HTML tags is used as aparent for the TR and TD elements?

    1, THead 2, TBody 3, TH 4, Table

    yes SBM018

    Which of the following XML DOM Objectsrepresents a collection of Node objects and is usedto iterate through the collection?

    1, Documentobject

    2, Elementobject

    3, Node object 4, NodeLisobject

    yes SBM019

    Which of the following XML DOM propertiesindicates whether the document has been loaded

    completely?

    1, readyState 2, async 3,validateOnParse

    4, parseErr

    SBM020

    What will be the output of the following stringfunction:

    1, M/DD/YY 2, MM 3, DD/YY 4, MM/DD

    substring('MM/DD/YY',2)

    yes SBM021

    Which of the following options is a validXMLSchemaCache method that returns thenamespace associated with the schema at thespecified index number?

    1,namespaceURI(index number)

    2,get(namespaceURI)

    3, get() 4,Namespace

    SBM022

    Joe wants to write a script that will be used toaccess an XSLT stylesheet. Which of the following

    DOM objects Joe needs to use to achieve this?

    1, XSLTemplateobject

    2, XSLProcessorObject

    3, DOMDocument 4,XMLSche

    eSBM023

    Bob is working as an EDP head in CyberShoppe. Hehas to ensure that the data sent in the form of XMLdocuments is consistent. For this, he wants towrite a script that validates the data stored in anXML document against a schema. Identify thecorrect code that Bob should write that willassociate the XML document with the XML schemaspecified by the user.

    1, varnamespace=xmlDoc.documentElement.namespaceURI;

    2, varnamespace=xmlDoc.documentElement.namespaceURI;

    3, varnamespace=xmlDoc.namespaceURI;

    4, varnamespaceoc.documement.nameURI;

    xmlDoc.validateOnParse=true;

    xmlDoc.validateOnParse=true;

    xmlDoc.validateOnParse=true;

    xmlDoc.vanParse=tru

    New Section 2 Page 2

  • 8/18/2019 xml q and a

    3/14

    varxsdschemacache = newActiveXObject("Msxml2.XMLSchemaCache.6.0");

    varxsdschemacache= newActiveXObject();

    varxsdschemacache= newActiveXObject("Msxml2.XMLSchemaCache.6.0");

    varxsdschema= newActiveXObsxml2.XMaCache.6.0

    xsdschemacache.add(namespace,document.frmTransform.

    xsdschemacache.add(namespace,document.frmTransform.

    xsdschemacache.add(namespace,document.frmTransform.

    xsdschemaadd(namesocument.frsform.

    TxtXSDFileName.value);

    TxtXSDFileName.value);

    TxtXSDFileName.value);

    TxtXSDFi

    xmlDoc.schemas=xsdschemacache;

    xmlDoc.schemas=xsdschemacache;

    xmlDoc.schemas=xsdschemacache;

    xmlDoc.scxsdschema

    xmlDoc.load(document.frmTransform.TxtXMLFileName.value);

    xmlDoc.load(document.frmTransform.TxtXMLFileName.value);

    xmlDoc.load(document.frmTransform.TxtXMLFileName.value);

    xmlDoc.loument.frmorm.TxtXMame);

    yes SBM024

    Bob has written the following code snippet tocreate an element node called Product:

    1, The numberof parameterspassed to thecreateNodemethod isincorrect. Thecorrect code isas follows:

    2, The numberof parameterspassed to thecreateNodemethod isincorrect. Thecorrect code isas follows:

    3, The number ofparameterspassed to thecreateNodemethod isincorrect. Thecorrect code is asfollows:

    4, The numparameterspassed to tcreateNodmethod isincorrect. Tcorrect codfollows:

    var docobj=newActiveXObject("Msxml2.DOMDocument.6.0");

    var docobj =newActiveXObject("Msxml2.DOMDocument.6.0");

    var docobj =newActiveXObject("Msxml2.DOMDocument.6.0");

    var docobj = newActiveXObject("Msxml2.DOMDocument.6.0");

    var docobjActiveXObsxml2.DOment.6.0")

    docobj.async=false; docobj.async=false;

    docobj.async=false;

    docobj.async=false;

    docobj.asye;

    if (docobj.childNodes.length==0) if(docobj.childNodes.length==0)

    if(docobj.childNodes.length==0)

    if(docobj.childNodes.length==0)

    if(docobj.ches.length=

    { { { { {

    myroot=docobj.createNode("Product"); myroot=docobj.createNode(2,"Product","");

    myroot=docobj.createNode(1,"Product");

    myroot=docobj.createNode(2,"Product");

    myroot=doeateNode(duct","");

    docobj.appendChild(myroot); docobj.appendChild(myroot);

    docobj.appendChild(myroot);

    docobj.appendChild(myroot);

    docobj.appild(myroot

    docobj.save("d:\Prod.xml"); docobj.save("d:\Prod.xml");

    docobj.save("d:\Prod.xml");

    docobj.save("d:\Prod.xml");

    docobj.sav\Prod.xml"

    } } } } }

    But on executing the code snippet, it resulted in anerror. Identify the error in the code.

    SBM025

    Bob has created the following XML file: 1, varmyxmldoc=newActiveXObject("Msxml2.DOMD

    2, varmyxmldoc=newActiveXObject("Msxml2.DOMDo

    3, varmyxmldoc=newActiveXObject("Msxml2.DOMDocu

    4, varmyxmldocActiveXObsxml2.DO

    New Section 2 Page 3

  • 8/18/2019 xml q and a

    4/14

    ocument.6.0"); cument.6.0"); ment.6.0"); ment.6.0");

    var i; var i; var i; var i;

    myxmldoc.async=false;

    myxmldoc.async=false;

    myxmldoc.async=false;

    myxmldocfalse;

    myxmldoc.load("C:\\emp.xml");

    myxmldoc.load("C:\\emp.xml");

    myxmldoc.load("C:\\emp.xml");

    if(myxmldoc.readyState == 4&& myxmldoc.parseError.errorCode==0)

    if(myxmldoc.readyState == 1&& myxmldoc.parseError.errorCode==0)

    if(myxmldoc.readyState == 3&& myxmldoc.parseError.errorCode==0)

    if(myxmldoState == 2&& myxmrseError.ere==0)

    John Rambo { { { {

    Texas varroot=myxmldoc.documentElement;

    varroot=myxmldoc.documentElement;

    varroot=myxmldoc.documentElement;

    varroot=myxmocumentEl

    for (i=0;i< root.childNod

    es.length; ++ i)

    for (i=0;i< root.childNod

    es.length; ++ i)

    for (i=0;i< root.childNodes

    .length; ++ i)

    for (i=0;i< root.chi

    s.length; + { { { {

    James Bond alert(root.childNodes.item(i).xml);

    alert(root.childNodes.item(i).xml);

    alert(root.childNodes.item(i).xml);

    alert(root.childtem(i).xml

    London } } } }

    } } } }

    else else else else

    { { { {

    alert("Failed toload thedocument.Check whetheryourXML documentis well-formed");

    alert("Failed toload thedocument.Check whetheryourXML documentis well-formed");

    alert("Failed toload thedocument. Checkwhether yourXML document iswell-formed");

    alert("Faileload thedocument.whether yoXML docuwell-forme

    He has saved the preceding document as emp.xml.Now, he wants to create a file that will navigatethrough the child nodes of the root element in thepreceding document. Which of the following codesnippet will enable him to achieve this task?

    } } } }

    SBM026 Bob has created the following XML file: 1,

    2,

    3,

    4,

    10 NEWSLAND ESTATE,NY

    New Section 2 Page 4

  • 8/18/2019 xml q and a

    5/14

    30

    11 NEWSLAND ESTATE,NY

    50

    Bob wants to calculate the total sales amount for aproduct. Which of the following options will enableBob to achieve this task?

    SBM027

    Bob wants to use an XPath function that will returnthe largest integer that is less than or equal to theargument. Which of the following functions willenable Bob to achieve this task?

    1, floor(num) 2, ceiling(num) 3, round(num) 4, number(ob

    yes SBM0

    28

    Bob wants to create a stylesheet that will display

    the details of the product whose price is equal to$500. Which of the following code snippetsenables Bob to check the product's price?

    1,

    2,

    3,

    4,

    SBM029

    Bob wants to process an XML document by using astyle sheet. For this, he needs to instantiate theXSLProcessor object. Which of the followingoptions will enable him to achieve this task?

    1, varxslprocobj=xsltobj.createProcessor();

    2, varxslprocobj=newcreateProcessor();

    3, varxslprocobj=newActiveXObject(xsltobj);

    4, varxslprocobjProcessor(

    SBM030

    Bob has created the Product.xml file. TheProduct.xml contains the following information:

    1,

    2,

    3,

    4,

  • 8/18/2019 xml q and a

    6/14

    select="QUANTITY"/>

    select="PRICE"/>

    select="QUANTITY"/>

    select="QUY"/>

    75


    New Section 2 Page 6

    http://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transformhttp://www.w3.org/1999/XSL/Transform

  • 8/18/2019 xml q and a

    7/14

    William Anderson

    13, Cross Street

    New York

  • 8/18/2019 xml q and a

    8/14

    them on the Web document. Which of thefollowing objects will Joe use to achieve this task?

    SBM036

    Which of the following options is an empty tag inHTML?

    1,
    2, 3, 4,

    yes SBM037

    Which of the following HTML tags is used to grouplines of text in a Web page?

    1,

    2, 3, 4,

    yes SBM038

    Joe is working as a Web designer with Global Inc.He is designing a Web page in which he wants to

    specify the key aspects of a Web page. Which ofthe following HTML tags should Joe use to achievethis task?

    1, 2,

    3, 4,

  • 8/18/2019 xml q and a

    9/14

    SBM041

    You want to create an attribute named PRODID.You want to ensure that the attribute shouldcontain a value that starts with P followed by threeinteger numbers. For this, you have created aschema that contains the following code snippet:

    1,

    2,

    3,

    4,

  • 8/18/2019 xml q and a

    10/14

    namespaces.

    :

    :

    Which of the following statements is NOT true forthe preceding code snippet?

    yes SBM044

    You have been assigned a task of creating a XSDschema. You need to ensure that the value enteredby the user for the element addressType should beeither office or residence. Which of the followingoptions will you use to achieve this task?

    1,

    2, 3, 4,

    New Section 2 Page 10

    http://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchema

  • 8/18/2019 xml q and a

    11/14

  • 8/18/2019 xml q and a

    12/14

  • 8/18/2019 xml q and a

    13/14

    specify the build version number?

    yes SBM052

    Which of the following options correctly definesstreaming?

    1, Streaming is aserver-sidescriptingtechnology thatis used to createdynamic andinteractive Webpages

    2, Streaming isthe server-basedtechnology thattransmits audioor video contentin a continuousstream to theuser

    3, Streaming is adatabase querylanguage

    4, Streaminprotocoldeveloped Netscape ftransmittinprivatedocumentsthe Interne

    SBM053

    Which of the following options is the correct codesnippet to add a row in a table with the border ofwidth 5 pixels?

    1,

    2, 3, 4,

  • 8/18/2019 xml q and a

    14/14

    :

    :

    But he is not able to reuse the schema. Identify thereason for the same.

    SBM055

    Consider the following code snippet: 1,namespaceURI

    2,validateOnParse

    3, add 4, xmlDoc

    var xsdschemacache = newActiveXObject("Msxml2.XMLSchemaCache.6.0");

    var xmlDoc = newActiveXObject("Msxml2.FreeThreadedDOMDocument.6.0");

    xmlDoc.validateOnParse=true;xmlDoc.load("products.xml");

    varnamespace=xmlDoc.documentElement.namespaceURI;

    xsdschemacache.add(namespace,"products.xsd");

    Analyze the code and identify which of thefollowing options is used to return the namespace-URI specified in the XML document.