Class XMLSchemaBasedWriter
- java.lang.Object
-
- de.uni_trier.wi2.procake.utils.io.xerces.XMLSchemaBasedWriter
-
public class XMLSchemaBasedWriter extends Object
A XMLWriter for XML content based on a XML Schema grammar. The XML Schema location can be defined withaddSchemaLocation(String, String), the target namespace can be defined withsetTargetNamespace(String), and namespace imports can be added withaddImport(String, String).- Author:
- Rainer Maximini, Maximilian Hoffmann
-
-
Field Summary
Fields Modifier and Type Field Description static StringHTTP_WWW_W_3_ORG_2001_XMLSCHEMA_INSTANCE
-
Constructor Summary
Constructors Constructor Description XMLSchemaBasedWriter(OutputStream out, String encoding)XMLSchemaBasedWriter(String filename, String encoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(String name, String value)voidaddImport(String prefix, String uri)The prefix should not contain any ":"voidaddSchemaLocation(String uri, String location)voidaddText(String text)voidappendElement(String prefix, String tagName)voidclose()voidfinishElement()voidsetTargetNamespace(String targetNamespace)
-
-
-
Field Detail
-
HTTP_WWW_W_3_ORG_2001_XMLSCHEMA_INSTANCE
public static final String HTTP_WWW_W_3_ORG_2001_XMLSCHEMA_INSTANCE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XMLSchemaBasedWriter
public XMLSchemaBasedWriter(OutputStream out, String encoding)
-
XMLSchemaBasedWriter
public XMLSchemaBasedWriter(String filename, String encoding) throws IOException
- Throws:
IOException
-
-
Method Detail
-
addImport
public void addImport(String prefix, String uri)
The prefix should not contain any ":"- Parameters:
prefix- The prefix of the importuri- The URI of the import
-
appendElement
public void appendElement(String prefix, String tagName) throws IOException
- Throws:
IOException
-
setTargetNamespace
public void setTargetNamespace(String targetNamespace)
-
close
public void close() throws IOException- Throws:
IOException
-
addAttribute
public void addAttribute(String name, String value) throws IOException
- Throws:
IOException
-
finishElement
public void finishElement() throws IOException- Throws:
IOException
-
addText
public void addText(String text) throws IOException
- Throws:
IOException
-
-