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, 1 Day 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 > Engineering Posted 25 Oct 2017 My Price 9.00

we will need to change the security settings on IE,

Here is part 3 of 4, i need 4 files:

 

· measurements3.html

· measurements3.xml

· measurements3.xsd

· measurements3.xslt

 

To setup IE for this part of the project, we will need to change the security settings on IE, but don't forget to change them back when you are done.

 

If you are using IE 7, click Tools->Internet Options

Click the Security tab.

Make sure Internet is selected in the zone box, click the Custom level... button.

Scroll down the list of Settings to the Miscellaneous section.

Find the Access data sources across domains option and select prompt.

Click OK.

You will be given the warning "Are you sure you want to change the settings for this zone?", click Yes.

Click OK.

You will now be able to use XMLHttpRequest object to access data across domains.

Now this part of the project will entail you modifying your measurements1.xslt file to enable it for an AJAX call to a google search. 

 

Copy your measurements1.xslt file to measurements3.xslt.

Copy your measurements1.xml file to measurements3.xml.

Copy your measurements1.xsd file to measurements3.xsd.

Edit the measurements3.xslt.

 

Change the template match for "measurement".

Add text that will identify each individual measurement that will be converted. For example, The distance XXX miles is YYY kilometers.

a. XXX will be the DOM call to get the value of the measurement.

b. YYY will be a call to a javascript function that we are about to define.

The call to the javascript should write the return value of the function to the screen.

a.This function should pass in a string that contains the original value you want converted, a space, and the original measurement type. For example, if you had an XML entry of 

<measurement typeOfMeasurement ="distanceType">

 <distance measureDistance="imperial">1.45</distance>

 </measurement>

your string would be "1.45 mile"

b. The second string should be the measurement type you want converted. So if you take the example from above, your second string would contain "kilometer".

Change the template match for "/"

Add a javascript block and add a function that takes 2 parameters, the original measurement that you want converted (call it originalMeasure) and the measurement that is the destination measurement (call it convertMeasure).

provide a XMLHttpRequest object (call it xmlRequest).

provide a requestString by replacing the spaces in originalMeasure with '+'.

Append the string "+in+" to the requestString.

Append the convertMeasure to the requestString.

Call the open function on xmlRequest passing in the values:

a. "GET"

b. '"https://www.google.com/search?q="+requestString'

c. "false'

 

Call the send function with no parameters.

Call the parseInt function and pass in the originalMeasure. Save the result to a variable "largerThanOne".

If largerThanOne is not equal to 1, find the index of the string originalMeasure + "s = " in the xmlRequest responseText and name this value whereIsIt.

If largerThanOne is equal to 1, find the index of the string originalMeasure + " = " in the xmlRequest responseText and name this value whereIsIt

If whereIsIt is greater than 0, search xmlRequest responseText for the index of convertMeasure.

You will now have the index locations of the beginning and end of the string that matters to you. 

Return only the converted value and measurement.

Now run the saxon transform on these. Your command line should be similar to:

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

View the measurements3.html .

Allow the ActiveX object to run by clicking "Yes", this is the XMLHttpRequest object.

Your measurements should output their values.

Answers

(5)
Status NEW Posted 25 Oct 2017 11:10 AM My Price 9.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)