[sword-cvs]
swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities
Test.java, 1.1, 1.2 XMLWriter.java, 1.1, 1.2
sword at www.crosswire.org
sword at www.crosswire.org
Sat Jun 5 10:09:00 MST 2004
Committed by: mgruner
Update of /cvs/core/swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities
In directory www:/tmp/cvs-serv28064/WLC2OSIS/Utilities
Modified Files:
Test.java XMLWriter.java
Log Message:
mgruner: converter generates something that looks like OSIS now.
Index: Test.java
===================================================================
RCS file: /cvs/core/swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities/Test.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Test.java 4 Jun 2004 09:14:52 -0000 1.1
+++ Test.java 5 Jun 2004 17:08:57 -0000 1.2
@@ -26,8 +26,7 @@
A.p = new Parser(A) ;
Translate T = new Translate(A, A.p) ;
String Word = T.translate(MC) ;
- A.w = new XMLWriter("C:\\kimball\\JavaProjects\\WLC2OSIS\\Tanach", "Test", "Test",
- "Test", "" ) ;
+ A.w = new XMLWriter("C:\\kimball\\JavaProjects\\WLC2OSIS\\Tanach", "Test") ;
A.w.writeString("mc", 1, MC) ;
A.p.w.writeWord(Word, "w") ;
A.w.close() ;
Index: XMLWriter.java
===================================================================
RCS file: /cvs/core/swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities/XMLWriter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- XMLWriter.java 4 Jun 2004 09:14:52 -0000 1.1
+++ XMLWriter.java 5 Jun 2004 17:08:57 -0000 1.2
@@ -18,24 +18,20 @@
OutputStreamWriter OSW ;
char[] CharBuffer ;
Fmt F = new Fmt() ;
-String XMLTag ;
+// String XMLTag ;
//-----------------------------------------------------------------------------
/**
* Writes an XML file.
*
* @param Directory String giving directory WITHOUT final \.
* @param Filename String giving file name WITHOUT extension.
- * @param XMLTag String giving XML tag.
- * @param XSLXSDName String giving .xsl and xsd file names WITHOUT extension.
- * @param ToXSL String giving route to .xsl file and .xsd file, i.e. "..\\"
- * or ".." + File.separator.
*
*/
-public XMLWriter(String Directory, String Filename, String XMLTag, String XSLXSDName, String ToXSL){
+public XMLWriter(String Directory, String Filename){
- this.Directory = Directory ;
- this.Filename = Filename ;
- this.XMLTag = XMLTag ;
+ this.Directory = Directory ;
+ this.Filename = Filename ;
+// this.XMLTag = XMLTag ;
try{
FOS = new FileOutputStream(Directory + File.separator + Filename + ".xml") ;
@@ -44,12 +40,10 @@
catch(IOException e){
System.out.println("XMLWriter: Error in opening output file.\n" + e) ;
}
- writeString("<?xml version = \"1.0\" encoding=\"UTF-8\"?>");
- writeString("\n<?xml-stylesheet type=\"text/xsl\" href=\"" + ToXSL + XSLXSDName + ".xsl.xml\"?>");
- writeString("\n<" + XMLTag
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
- + "xsi:noNamespaceSchemaLocation =\"" + ToXSL + XSLXSDName + ".xsd\">" ) ;
- writeString("\n<!-- Copyright C.V.Kimball 2004 -->" ) ;
+ writeString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+ writeString("<osis xmlns=\"http://www.bibletechnologies.net/2003/OSIS/namespace\" "+
+ "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "+
+ "xsi:schemaLocation=\"http://www.bibletechnologies.net/2003/OSIS/namespaceosisCore.2.0.xsd\">\n");
}
//-----------------------------------------------------------------------------
public void writeString(String Tag, int Level, String S){
@@ -62,6 +56,19 @@
s = s + "</" + Tag + ">" ;
writeString(s) ;
}
+
+//-----------------------------------------------------------------------------
+public void writeAttributedString(String Tag, int Level, String AttributeString, String S){
+ String s = "\n" ;
+ for (int k = 0; k < Level; k++){
+ s = s + IndentString ;
+ }
+ s = s + "<" + Tag + " " + AttributeString + ">" ;
+ s = s + S ;
+ s = s + "</" + Tag + ">" ;
+ writeString(s) ;
+ }
+
//-----------------------------------------------------------------------------
public void writeBoolean(String Tag, int Level, boolean B){
String s = "\n" ;
@@ -132,7 +139,8 @@
}
//-----------------------------------------------------------------------------
public void close(){
- writeString("\n</" + XMLTag + ">") ;
+// writeString("\n</" + XMLTag + ">") ;
+ closeTag("osis", 0);
try{
OSW.close() ;
}
More information about the sword-cvs
mailing list