Comments
bruce.armstrong wrote: Somebody just said it better than I did, and with more chops to say it: Open Letter to Mark Zuckerberg, Sheryl Sandberg & Facebook Mobile
Cloud Expo on Google News

SYS-CON.TV
Cloud Expo & Virtualization 2009 East
PLATINUM SPONSORS:
IBM
Smarter Business Solutions Through Dynamic Infrastructure
IBM
Smarter Insights: How the CIO Becomes a Hero Again
Microsoft
Windows Azure
GOLD SPONSORS:
Appsense
Why VDI?
CA
Maximizing the Business Value of Virtualization in Enterprise and Cloud Computing Environments
ExactTarget
Messaging in the Cloud - Email, SMS and Voice
Freedom OSS
Stairway to the Cloud
Sun
Sun's Incubation Platform: Helping Startups Serve the Enterprise
POWER PANELS:
Cloud Computing & Enterprise IT: Cost & Operational Benefits
How and Why is a Flexible IT Infrastructure the Key To the Future?
Click For 2008 West
Event Webcasts
XML Certification Quizzer
XML Certification Quizzer

Last month's column introduced you to the exam objectives for IBM Test 141 on XML and Related Technologies. This installment will present five more questions from the five different exam objectives. It can be used as a learning tool for people who are new to XML. If you are preparing for the exam, the article will help you review key concepts.

Question 1 (XML Processing)
Which of the following XSLT elements sets the value of a variable x to the literal string value "a"?

A. <xsl:variable name='x' select='a'/>
B. <xsl:variable name="x" value="a"/>
C. <xsl:variable name='x' select="'a'"/>
D. <xsl:variable select='"a"' value="x" />

Select one answer.
Explanation: Choice C is the correct answer. There are three methods for specifying the value of a variable:
1.   Use an empty xsl:variable element with a select attribute. The value of the variable is the object that results from evaluating the expression in the select attribute.
2.   Use a nonempty xsl:variable element with no select attribute. In this case, the xsl:variable has one or more child nodes, which form a template. The template is instantiated to produce a result tree fragment, which is the value of the variable. The root node of the result tree fragment contains a sequence of child nodes generated by instantiating the template.
3.   Set the value of the variable to an empty string by using an empty xsl:variable element with no select attribute.

In order to assign a literal string value to a variable, the value must be delimited with quotes. These quotes must be placed within the quotes used to delimit the value of the select attribute. The following will set the value of a variable x to the literal string value "a":

<xsl:variable name='x' select="'a'"/>
<xsl:variable select='"a"' name="x"/>

Note that in XML, the ordering of attributes is not important and attribute values can be delimited either by a pair of single quotes or a pair of double quotes.

Choice A is not correct, because it sets the value of the variable x to a node set containing all the elements <a>, children of the context node. The XSLT stylesheet may not generate an error, but will certainly produce an output that is different from the expected result.

Choices B and D are not correct because XSLT does not specify the value attribute on the xsl:variable element.

Question 2 (Information Modeling)
Consider the following DTD declarations:

<!ELEMENT CrossReference (#PCDATA)>
<!ATTLIST CrossReference
Linkend IDREF #REQUIRED>

Which of the following XML Schema declarations is the best translation of the DTD declarations above? A.

<xsd:element name = "CrossReference">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base =
"xsd:string">
<xsd:attribute name = "Linkend"
use = "required" type = "xsd:IDREF"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>

B.

<xsd:element name = "CrossReference"
type="xsd:string">
<xsd:attribute name = "Linkend" use =
"required" type = "xsd:IDREF"/>
</xsd:element>

C.

<xsd:element name = "CrossReference">
<xsd:complexContent>
<xsd:extension base = "xsd:string">
<xsd:attribute name = "Linkend"
use = "required"
type = "xsd:IDREF"/>
</xsd:extension>
</xsd:complexContent>
</xsd:element>

Select one answer.
Explanation: Choice A is the correct answer. The CrossReference element has an attribute. Simple types cannot have attributes. Therefore, the declaration of the CrossReference element must contain a complex type definition.

The content model of CrossReference contains only character data and no child elements. The simpleContent element is used inside the complexType to indicate that CrossReference is an extension of the simple type xsd:string. Since the simple type xsd:string is extended by adding a Linkend attribute, we use an extension element inside simpleContent.

Choice B is not correct. The element declaration does not specify whether CrossReference is a simple type or a complex type.

Choice C is not correct. The complexContent element is used to restrict or extend the content model of a complex type.

Question 3 (XML Rendering)
Which of the following XSL-FO fragments will display the content of pages in two columns?

A.

<fo:simple-page-master master-name="one"
page-height="11in"
page-width="8.5in"
margin-top="1in"
margin-bottom="1in"
margin-left="0.75in"
margin-right="0.75in">
<fo:column
margin-top="1in" margin-bottom="1in"
column-count="2" column-gap="0.25in"/>
<fo:region-before extent="1in" />
<fo:region-after extent="1in" />
</fo:simple-page-master>

B.

<fo:simple-page-master master-name="one"
page-height="11in"
page-width="8.5in"
margin-top="1in"
margin-bottom="1in"
margin-left="0.75in"
margin-right="0.75in">
<fo:region-body
margin-top="1in" margin-bottom="1in"
column-count="2" column-gap="0.25in"/>
<fo:region-before extent="1in" />
<fo:region-after extent="1in" />
</fo:simple-page-master>

C.

<fo:page-sequence master-name="one"
page-height="11in"
page-width="8.5in"
margin-top="1in"
margin-bottom="1in"
margin-left="0.75in"
margin-right="0.75in">
<fo:region-body
margin-top="1in" margin-bottom="1in"
column-count="2" column-
gap="0.25in"/>
<fo:region-before extent="1in" />
<fo:region-after extent="1in" />
</fo:page-sequence >

Select one answer.
Explanation: Choice B is the correct answer. The fo:simple-page-master is used to specify the dimensions of the page (page-height and page-width) and margin properties, including margin-top, margin-bottom, margin-left, and margin-right. In addition, the fo:simple-page-master specifies the five regions of the page: region-body, region-before, region-after, region-start, and region-end.

If the page is subdivided in multiple columns, a column-count attribute is attached to the fo:region-body element to provide multiple columns. The column-gap attribute specifies the width of the separation between adjacent columns.

The fo:page-sequence formatting object specifies a sequence or sub-sequence of pages within a document. Its fo:flow and fo:static-content flow objects child elements specify the content of these pages.

Choice A is not correct because there is no fo:column formatting object defined in XSL.

Choice C is not correct because the allowed content of fo:page-sequence is the following: (title?,static-content*, flow).

Question 4 (Testing & Tuning)
Consider the following complex type definitions:

<xsd:schema
xmlns:xsd="http://www.w3.org/2001/ XMLSchema"
xmlns:di="http://www.xdrugs.com/di"
targetNamespace="http://www.xdrugs.com/di">

<xsd:complexType name="PatientInfo">
<xsd:sequence>
<xsd:element name="patientid"
type="xsd:string"/>
<xsd:element name="name"
type="xsd:string"/>
<xsd:element name="illness"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="DrugInfo">
<xsd:sequence>
<xsd:element name="id"
type="xsd:string"/>
<xsd:element name="dosage"
type="xsd:string"/>
<xsd:element name="consumer"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
......
</xsd:schema>

A prescriptions element must be defined in the schema. Prescriptions elements must contain one or more patient elements of type PatientInfo followed by one or more drug elements of type DrugInfo. Inside a prescriptions element, the patientid child of patient must be unique, and each consumer child of drug must have a corresponding patientid.

Which of the following is the BEST method for modeling the content of the prescriptions element?

A.

<xsd:element name="prescriptions">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="patient" type="di:
PatientInfo"
minOccurs="1" maxOccurs="unbounded"
type="xsd:ID"/>
<xsd:element name="drug" type=
"di:DrugInfo" minOccurs="1"
maxOccurs="unbounded"
type="xsd:IDREF"/>
</xsd:sequence>
</xsd:complexType>

B.

<xsd:element name="prescriptions">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="patient" type="di:
PatientInfo"
minOccurs="1" maxOccurs="unbounded"/>
<xsd:element name="drug" type="di:
DrugInfo" minOccurs="1" maxOccurs="
unbounded"/>
</xsd:sequence>
</xsd:complexType>

<xsd:ID name='PatientKey'>
<xsd:selector xpath='patient'/>
<xsd:field xpath='patientid'/>
</xsd:ID>

<xs:IDREF name='DrugKeyRef' refer="di:
PatientKey">
<xsd:selector xpath='drug'/>
<xsd:field xpath='consumer'/>
</xsd:IDREF>
</xsd:element>

C.

<xsd:element name="prescriptions">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="patient" type="di:
PatientInfo"
minOccurs="1" maxOccurs="unbounded"/>
<xsd:element name="drug" type="di:Drug
Info" minOccurs="1"maxOccurs=
"unbounded"/>
</xsd:sequence>
</xsd:complexType>

<xsd:key name='PatientKey'>
<xsd:selector xpath='patient'/>
<xsd:field xpath='patientid'/>
</xsd:key>

<xs:keyref name='DrugKeyRef'
refer="di:PatientKey">
<xsd:selector xpath='drug'/>
<xsd:field xpath='consumer'/>

</xsd:keyref>
</xsd:element>

Select one answer.
Explanation: Choice C is the correct answer. The key element applies to the content of patientid elements that are children of the patient element. This means that the value of patientid must be unique and is not nillable. The key can be referenced from elsewhere with its name, PatientKey. To ensure that consumer children of the drug elements have a corresponding value in the patientid elements identified by the key, we use the keyref element.

Choice A and Choice B are not correct. For compatibility with XML1.0, ID and IDREF should be used only on attributes.

Question 5 (Architecture)
An international industry group of airlines, aircraft manufacturers, and parts suppliers decides to adopt Web services for the parts ordering process. Airlines must be able to query thousands of manufacturer and supplier parts catalogs and place orders based on availability, price, quantity, quality, and shipping costs. The industry group forms a Web Services Working Group to provide technical recommendations on the adoption of Web services by its members.

Which of the following is least likely to be part of the recommendations of the Working Group?

A.   The industry group must define a WSDL service interface definition, and register it as a tModel in a UDDI registry.
B.   SOAP request and response messages must be exchanged over HTTP.
C.   The industry group must create an XML Schema to describe the messages used to search aircraft parts catalogs, place orders, and track orders.
D.   Each aircraft manufacturer or part supplier must define its own specific WSDL service interface definition, and put a copy of the WSDL file on its Web server.

Select one answer.
Explanation: Choice D is the correct answer. If each aircraft manufacturer or part supplier defines its own specific WSDL service interface definition, an airline must know the service provider in advance before it can obtain the WSDL definition. Since there are thousands of manufacturers and suppliers, that solution will not bring significant efficiency gains.

Once an industry standard WSDL service interface definition is registered as a tModel in a UDDI registry, programmers at airlines can retrieve the WSDL document by following the overviewDoc link in the tModel.

The network address of each service access point is encoded in the accessPoint element of a bindingTemplate. Client applications will query the UDDI registry for the access points of all registered Web services that implement the industry standard WSDL.

Conclusion
When preparing for IBM XML Certification, it is important to understand how various XML-related specifications are used together to design a solution, and the role of each specification in the architecture.

About Joel Amoussou
Joel Amoussou is founder and chief learning architect of XMLMentor.net, where he develops blended learning solutions for building and assessing XML skills. Joel is the author of an XML exam simulator and teaches live e-learning courses on XML certification.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Latest Cloud Developer Stories
With BigDataExpo 2012 New York (www.BigDataExpo.net), co-located with 10th Cloud Expo, now just three weeks away, what better time to introduce you in greater detail to the distinguished individuals in our incredible Speaker Faculty for the technical and strategy sessions at the ...
In his session at the 10th International Cloud Expo, Marvin Wheeler, Open Data Center Alliance Chairman, will discuss the success the organization has had in charting the requirements for broad-scale enterprise adoption of the cloud and how 2012 is forecast to be the tipping poin...
The move to cloud-based applications has undeniably delivered tremendous benefits. However, the associated distribution creates various challenges from the quality perspective: End-to-end tests need to pass through multiple dependent systems, which are commonly unavailable, evo...
For many of the same reasons that Software-as-a-Service is catching on with enterprise buyers, delivering web services on top of Infrastructure-as-a-Service architectures is appealing to the SaaS developers. Operational agility, lower CapEx, and a broad array of tools and service...
With Cloud Expo 2012 New York (10th Cloud Expo) now just under three weeks away, what better time to introduce you in greater detail to the distinguished individuals in our incredible Speaker Faculty for the technical and strategy sessions at the conference... We have technica...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers
ADS BY GOOGLE