0% found this document useful (0 votes)
170 views3 pages

Quiz:XML

The document discusses serialization formats for web services, XML parsing in Python, XML elements and schemas. It provides answers to questions about parsing XML from strings, identifying complex vs simple elements, attributes, parent and child nodes, using XML schemas to define valid values, and representing times and dates in ISO8601 format.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
170 views3 pages

Quiz:XML

The document discusses serialization formats for web services, XML parsing in Python, XML elements and schemas. It provides answers to questions about parsing XML from strings, identifying complex vs simple elements, attributes, parent and child nodes, using XML schemas to define valid values, and representing times and dates in ISO8601 format.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

1 - What is "serialization" when we are talking about web services?

Answer: The act of taking data stored in a program and formatting it so it


can be sent across the network

What is the name of the Python library to parse XML data?

Answer: xml.etree.ElementTree

3 - Which of the following are not commonly used serialization formats?

Answers:
Dictionaries

HTTP

TCP

4 - What is the method to cause Python to parse XML that is stored in a string?

Answer: fromstring()

5 - In this XML, which are the "complex elements"?

<people>
<person>
<name>Chuck</name>
<phone>303 4456</phone>
</person>
<person>
<name>Noah</name>
<phone>622 7421</phone>
</person>
</people>

faalta la respuesta

In this XML, which are the "simple elements"?

<people>
<person>
<name>Chuck</name>
<phone>303 4456</phone>
</person>
<<person>
<name>Noah</name>
<phone>622 7421</phone>
</person>
</people>

Answers:

name

phone

In the following XML, which are attributes?

<person>
<name>Chuck</name>
<phone type="intl">
+1 734 303 4456
</phone>
<email hide="yes" />
</person>

Answers:

hide

type

In the following XML, which node is the parent node of node e

<a>
<b>X</b>
<c>
<d>Y</d>
<e>Z</e>
</c>
</a>

Answer: c

Looking at the following XML, what text value would we find at path "/a/c/e"

<a>
<b>X</b>
<c>
<d>Y</d>
<e>Z</e>
</c>
</a>

Answer: Z

What is the purpose of XML Schema?


Answer: To establish a contract as to what is valid XML

If you were building an XML Schema and wanted to limit the values allowed in an
xs:string field to only those in a particular list, what XML tag would you use in
your XML Schema definition?

Answer: xs:enumeration

For this XML Schema:

<xs:complexType name=”person”>
<xs:sequence>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="age" type="xs:integer"/>
<xs:element name="dateborn" type="xs:date"/>
</xs:sequence>
</xs:complexType>

And this XML,

<person>
<lastname>Severance</lastname>
<Age>17</Age>
<dateborn>2001-04-17</dateborn>
</person>

Which tag is incorrect?

Answer: Age

What does the "Z" mean in this representation of a time:

Answer: This time is in the UTC timezone

What is a good time zone to use when computers are exchanging data over APIs?

Answer: Universal Time / GMT

Which of the following dates is in ISO8601 format?

Answer: 2002-05-30T09:30:10Z

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy