SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 2 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 01 Nov 2017 My Price 10.00

The first template should match the root of the document.

XML Application Development

 

The example that will be used here will be the translating of measurements, both distance and weight, from one measurement standard to another. The distance measurements will translate from Imperial mile to Metric Kilometer. The weight measurements will translate from Troy Ounce to Metric Gram.

 

For this, you will produce 4 files:

 

· measurements1.html

 

· measurements1.xml

 

· measurements1.xsd

 

· measurements1.xslt

 

You will be creating the xml, xsd, and the xslt files using any text editor you want. The html file will be created for you using the saxon tool.

 

1. Use the measurements1.xsd file from the previous assignment.

 

2. Build an XML document based on the schema in measurements1.xsd. Name this document measurements1.xml.

 

a. This XML document should have a root of measurements.

b. This XML document should have at least 3 child elements to measurements.

 

3. Provide a XSLT style sheet to display the contents in the measurements1.xml file. Name this file measurements1.xslt.

 

a. The first template should match the root of the document.

i. Inside the template, provide a html document that outputs the total number of items in the measurements1.xml file and how many of each kind are in the file.

ii. There should also be an apply-templates call that matches the measurement element.

b. The second template should match measurement.

i. In this template, choose between weight and distance based on the attribute typeOfMeasurement

ii. For distanceType, you should output the distance/@measureDistance attribute, as well as the distance element.

iii. For weightType, you should output the weight@measureWeight attribute, as well as the weight element.

 

4. Run these through the sax processor with the command 

Transform.exe -sa -s:measurements1.xml -xsl:measurements1.xslt -xsd:measurements1.xsd -o:measurements1.html

This should result in an html file that outputs something similar to:

 

The 3 measurements that I want transformed.

 

There are 2 distance measurements

 

There is 1 weight measurement.

 

A distance measurement using the imperial scale is:

 

The length of the distance is 1.45

A weight measurement using the troy scale is:

 

The amount of the weight is .6<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="https://www.w3.org/2001/XMLSchema">

<xs:element name="measurementType" type="xs:string"/>
    <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:minInclusive value="distanceType"/>
      <xs:maxInclusive value="weightType"/>
    </xs:restriction>
  </xs:simpleType>
 </xs:element>
<xs:element name="disType" type="xs:string"/>
    <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:minInclusive value="imperial"/>
      <xs:maxInclusive value="metric"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>
<xs:element name="weiType" type="xs:string"/>
<xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:minInclusive value="troy"/>
      <xs:maxInclusive value="gram"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>
<xs:element name="measurement" typeOfMeasurement="measurementType">
  <xs:complexType>
    <xs:choice>
      <xs:element name="distance" type="disType"/>
      <xs:element name="weight" type="weiType"/>
    </xs:choice>
  </xs:complexType>
</xs:element>

A distance measurement using the metric scale is:

 

The length of distance is 25

Answers

(5)
Status NEW Posted 01 Nov 2017 06:11 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)