-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
m_japa
authored and
m_japa
committed
Jul 29, 2016
1 parent
d9511dd
commit abcf72f
Showing
5 changed files
with
49 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.concordia.soen6441.incarnation2; | ||
|
||
public class CheersXML_I2 { | ||
|
||
public static boolean generateXML(double radius, int precision, int precisionOutput, String output){ | ||
boolean x = false; | ||
try{ | ||
System.out.println("<?xml version="+"\"1.0\""+" encoding="+"\"UTF-8\""+"?>"); | ||
System.out.println("<!DOCTYPE cheers ["); | ||
System.out.println("<!ELEMENT cheers (input,output)>"); | ||
System.out.println("<!ELEMENT input (radius,intermediateprecision,lengthprecision)>"); | ||
System.out.println("<!ELEMENT output (length)>"); | ||
System.out.println("<!ELEMENT radius (#PCDATA)>"); | ||
System.out.println("<!ELEMENT intermediateprecision (#PCDATA)> "); | ||
System.out.println("<!ELEMENT lengthprecision (#PCDATA)> "); | ||
System.out.println("<!ELEMENT length (#PCDATA)>"); | ||
System.out.println("<!ATTLIST radius type CDATA #IMPLIED>"); | ||
System.out.println("<!ATTLIST intermediateprecision type CDATA #IMPLIED>"); | ||
System.out.println("<!ATTLIST lengthprecision type CDATA #IMPLIED>"); | ||
System.out.println("<!ATTLIST length type CDATA #IMPLIED>"); | ||
System.out.println("]>"); | ||
System.out.println("<cheers>"); | ||
System.out.println("\t<input>"); | ||
System.out.println("\t\t<radius type="+"\"double\""+">"+radius+"</radius>"); | ||
System.out.println("\t\t<intermediateprecision type="+"\"int\""+">"+precision+"</intermediateprecision>"); | ||
System.out.println("\t\t<lengthprecision type="+"\"int\""+">"+precisionOutput+"</lengthprecision>"); | ||
System.out.println("\t</input>"); | ||
System.out.println("\t<output>"); | ||
System.out.println("\t\t<length type="+"\"double\""+">"+output+"</length>"); | ||
System.out.println("\t</output>"); | ||
System.out.println("</cheers>"); | ||
x = true; | ||
} | ||
catch(Exception e){ | ||
System.out.println("XML cannot be generated. Please try again..!"); | ||
} | ||
return x; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters