Be described as root elements of the xml document a c

This preview shows page 14 - 17 out of 51 pages.

be described as root elements of the XML document.a, c, and d are valid XML documents. In b, the “DataFileName” child element of the “DataFile” elementoccurs two times, and is therefore not a valid XML document. In e, the “DataFile” element is an emptyelement, and is therefore not a valid XML document.Accordingly, the correct answers are a, c, and d.
Question 19Select the XPath expression that fits in _____ (1) _____ of “XSLT Stylesheet” when “XSLT Stylesheet” isapplied to the given “XML Document” to output “Transformation Results”.“XML Document”<?xml version="1.0" encoding="UTF-8" ?><UserList><UserID Password="xxxxxx" authority="administrator">User01</UserID><UserID Password="zzzzzz" authority="general">User02</UserID><UserID Password="xyzxyz" authority="system">User03</UserID><UserID Password="yyyyyy" authority="general">User04</UserID></UserList>“Transformation Results”<?xml version="1.0" encoding="UTF-8"?>
<UserID>User02</UserID><authority>general</authority><UserID>User04</UserID><authority>general</authority></GeneralUserList>“XSLT Stylesheet”<?xml version="1.0" encoding="UTF-8" ?><xsl:stylesheet version="1.0" xmlns:xsl=""><xsl:template match="/"><GeneralUserList><xsl:apply-templates select="_____ ( 1 ) _____" /></GeneralUserList></xsl:template><xsl:template match="UserID"><UserID><xsl:value-of select="text()" /></UserID><xsl:element name="authority"><xsl:value-of select="@authority" /></xsl:element></xsl:template></xsl:stylesheet>a. UserList/UserID[@authority='general']b. UserList/UserID/@authority='general'c. UserList/UserID/[@authority='general']d. There is no correct description, since there is an error in the XPath expressionsSelect any 1 option.Correct answer :aThe node set can be filtered using XPath. This is called the “XPath predicate,” where the “[terms]” comingafter the XPath expression are described. The authority attribute filters according to “general” via thetransformation results. The “UserList/UserID” is described in the select attribute of the xsl:apply-templateselement, after which [@authority=’general.’] is described to perform node set filtering. The authorityattribute becomes “general” only, and “Transformation Results” is output.Accordingly, the correct XPath expression is a.Question 20
Select which of the following is the correct combination of XML Schema elements when a simple typeelement is defined by the XML Schema, and restrictions have been placed on the simple type.
Select any 1 option.Correct answer :cA simpleType element is used to define the simple type; a restriction element is used to place restrictions.Use a constraining facet as the child element of the restriction element, placing restrictions on the elementcontent.In the following example, a regular expression is used for the “ProductNumber” element, and the valuesthat can be set have been restricted (“X” + 2 numeral number + “-” + 4 numeral number (e.g. X01-0001))<xs:element name="ProductNumber" type="productType" /><xs:simpleType name="productType">

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 51 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Summer
Professor
N/A
Tags
XML Schema

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture