Using Notepad++ or an ordinary ASCII text editor such as nano or vi . You may no
ID: 3858009 • Letter: U
Question
Using Notepad++ or an ordinary ASCII text editor such as nano or vi. You may not use HTML or wysiwyg editors.
Part 1: Using an XML Schema You will find an XML Schema for a simple tool catalog here: http://weblab.kennesaw.edu/toolschema.xsd Read the schema to find out what XML elements are expected and what they contain. (Hint: The comments are your friend. )
Write an XML file containing information for at least three types of tools (chisel, saw, and pliers). To get you started
<?xml version="1.0" encoding="utf-8"?>
<toolCatalog xmlns="http://weblab.kennesaw.edu/toolSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://weblab.kennesaw.edu/toolSchema
http://weblab.kennesaw.edu/toolschema.xsd">
<toolPackage>
<!-- put the XML for the first kind of tool package here -->
</toolPackage>
<!-- You need at least two more toolPackage elements with contents -->
</toolCatalog>
Place your XML file on the server as l6p1.xml. Put a link to your XML file on your index page.To validate your XML, navigate to this address: https://devutilsonline.com/xml/validate Paste the URL of your XML file in the left-hand box, which is labeled XML URL.
Part 2; Validating form data: Make an order form from and name it l6p2.php. make the JavaScript code to calculate the total price. use a plain text box for quantities, the quantity inputs type="text". (The goal of this part of the assignment is for you to use regular expressions to validate text.)
Add JavaScript code to produce an error message and suppress submission of the form if any quantity field contains non-numeric data. (It's OK for a quantity to be empty, but if it's non-empty, it must have only numbers.) Add an action= attribute to your <form> tag to submit the form to http://weblab.kennesaw.edu/formtest.php. Test that the form is submitted correctly when the quantities are numeric or empty, and that an error message is produced otherwise. (Regular expressions are your friend. Anything that's not a digit is bad. (The goal is to learn to validate with JavaScript. The use of an input element with type "number". You must use JavaScript for the validation.)
Part 3; Using PHP to generate forms: To your order form from Part 2, add input elements for customer name and address if they're not already there. The "state" part of the address must be a select element(also called a "pulldown menu") to allow the person placing the order to choose his or her state. Don't type all fifty states, but supply at least Georgia, Alabama and Florida. Put the names of the states in an PHP array and use PHP code to create the drop-down dynamically. (This will still be named l6p2.php; you're just adding to something you've already tested.)
Explanation / Answer
<?xml version="1.0" encoding="utf-8"?>
<toolCatalog xmlns="http://weblab.kennesaw.edu/toolSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://weblab.kennesaw.edu/toolSchema
http://weblab.kennesaw.edu/toolschema.xsd">
<toolPackage>
<!-- put the XML for the first kind of tool package here -->
<type>Hoe</type>
<picLocation>http://blah.blah</picLocation>
<weight>1.1</weight>
<price>10.00</price>
</toolPackage>
<toolPackage>
<!-- put the XML for the second kind of tool package here -->
<type>CClamp</type>
<picLocation>http://blah.blah</picLocation>
<weight>3.5</weight>
<price>5.00</price>
</toolPackage>
<toolPackage>
<!-- put the XML for the third kind of tool package here -->
<type>HedgeClipper</type>
<picLocation>http://blah.blah</picLocation>
<weight>4.0</weight>
<price>40.50</price>
</toolPackage>
<!-- You need at least two more toolPackage elements with contents -->
</toolCatalog>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.