Package io.github.astrapi69.xml.to.xsd
Class XmlToXsdExtensions
- java.lang.Object
-
- io.github.astrapi69.xml.to.xsd.XmlToXsdExtensions
-
public final class XmlToXsdExtensions extends java.lang.Object
The classXmlToXsdExtensions
generates XML schema from XML files. It makes use of XMLBeans tools.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
xmlToXsd(java.io.File xmlFile)
Returns a xsd String from the given XML file that can used for several purposes.static void
xmlToXsd(java.io.File[] xmlFiles, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, java.io.File outDir, java.lang.String outPrefix)
Creates or update the given xsd output file from the given XML file.static void
xmlToXsd(java.io.File xmlInputFile, java.io.File xsdOutFile)
Creates or update the given xsd output file from the given XML file.static void
xmlToXsd(java.io.File xmlInputFile, java.io.File xsdOutFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions)
Creates or update the given xsd output file from the given XML file.static void
xmlToXsd(java.io.File xmlFile, java.io.File xsdOutFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, org.apache.xmlbeans.XmlOptions xmlOptions)
Creates or update the given xsd output file from the given XML file.static java.lang.String
xmlToXsd(java.io.File xmlFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions)
Returns a xsd String from the given XML file that can used for several purposes.static java.lang.String
xmlToXsd(java.io.File xmlFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, org.apache.xmlbeans.XmlOptions xmlOptions)
Returns a xsd String from the given XML file that can used for several purposes.static java.lang.String
xmlToXsd(java.lang.String xmlString)
Returns a xsd String from the given XML string that can used for several purposes.static java.lang.String
xmlToXsd(java.lang.String xmlFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions)
Returns a xsd String from the given XML file that can used for several purposes.static java.lang.String
xmlToXsd(java.lang.String xmlString, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, org.apache.xmlbeans.XmlOptions xmlOptions)
Creates or update the given xsd output file from the given XML String
-
-
-
Method Detail
-
xmlToXsd
public static java.lang.String xmlToXsd(java.io.File xmlFile) throws org.apache.xmlbeans.XmlException, java.io.IOException
Returns a xsd String from the given XML file that can used for several purposes.- Parameters:
xmlFile
- the XML file- Returns:
- the resulted xsd String
- Throws:
org.apache.xmlbeans.XmlException
- the xml exceptionjava.io.IOException
- Signals that an I/O exception has occurred.
-
xmlToXsd
public static java.lang.String xmlToXsd(java.lang.String xmlString) throws org.apache.xmlbeans.XmlException, java.io.IOException
Returns a xsd String from the given XML string that can used for several purposes.- Parameters:
xmlString
- the XML string- Returns:
- the resulted xsd String
- Throws:
org.apache.xmlbeans.XmlException
- the xml exceptionjava.io.IOException
- Signals that an I/O exception has occurred.
-
xmlToXsd
public static void xmlToXsd(java.io.File xmlInputFile, java.io.File xsdOutFile) throws org.apache.xmlbeans.XmlException, java.io.IOException
Creates or update the given xsd output file from the given XML file.- Parameters:
xmlInputFile
- the xml input filexsdOutFile
- the xsd out file- Throws:
org.apache.xmlbeans.XmlException
- the xml exceptionjava.io.IOException
- Signals that an I/O exception has occurred.
-
xmlToXsd
public static void xmlToXsd(java.io.File xmlInputFile, java.io.File xsdOutFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions) throws org.apache.xmlbeans.XmlException, java.io.IOException
Creates or update the given xsd output file from the given XML file.- Parameters:
xmlInputFile
- the xml input filexsdOutFile
- the xsd out fileinst2XsdOptions
- the inst2 xsd options- Throws:
org.apache.xmlbeans.XmlException
- occurs when a give xml file is invalid.java.io.IOException
- Signals that an I/O exception has occurred.
-
xmlToXsd
public static void xmlToXsd(java.io.File xmlFile, java.io.File xsdOutFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, org.apache.xmlbeans.XmlOptions xmlOptions) throws org.apache.xmlbeans.XmlException, java.io.IOException
Creates or update the given xsd output file from the given XML file.- Parameters:
xmlFile
- the xml filexsdOutFile
- the xsd out fileinst2XsdOptions
- the inst2 xsd optionsxmlOptions
- the xml options- Throws:
org.apache.xmlbeans.XmlException
- occurs when a give xml file is invalid.java.io.IOException
- Signals that an I/O exception has occurred.
-
xmlToXsd
public static java.lang.String xmlToXsd(java.io.File xmlFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions) throws org.apache.xmlbeans.XmlException, java.io.IOException
Returns a xsd String from the given XML file that can used for several purposes.- Parameters:
xmlFile
- the XML file.inst2XsdOptions
- the inst2 xsd options- Returns:
- the resulted xsd String
- Throws:
org.apache.xmlbeans.XmlException
- occurs when a give xml file is invalid.java.io.IOException
- Signals that an I/O exception has occurred.
-
xmlToXsd
public static java.lang.String xmlToXsd(java.lang.String xmlFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions) throws org.apache.xmlbeans.XmlException, java.io.IOException
Returns a xsd String from the given XML file that can used for several purposes.- Parameters:
xmlFile
- the XML file.inst2XsdOptions
- the inst2 xsd options- Returns:
- the resulted xsd String
- Throws:
org.apache.xmlbeans.XmlException
- occurs when a give xml file is invalid.java.io.IOException
- Signals that an I/O exception has occurred.
-
xmlToXsd
public static java.lang.String xmlToXsd(java.io.File xmlFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, org.apache.xmlbeans.XmlOptions xmlOptions) throws org.apache.xmlbeans.XmlException, java.io.IOException
Returns a xsd String from the given XML file that can used for several purposes.- Parameters:
xmlFile
- the xml fileinst2XsdOptions
- the inst2 xsd optionsxmlOptions
- the xml options- Returns:
- the resulted xsd String
- Throws:
org.apache.xmlbeans.XmlException
- occurs when a give xml file is invalid.java.io.IOException
- Signals that an I/O exception has occurred.
-
xmlToXsd
public static void xmlToXsd(java.io.File[] xmlFiles, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, java.io.File outDir, java.lang.String outPrefix) throws java.io.IOException
Creates or update the given xsd output file from the given XML file.- Parameters:
xmlFiles
- the XML filesinst2XsdOptions
- the inst2 xsd optionsoutDir
- The directory path for output files. Default is '.' (the current directory).outPrefix
- The prefix for output file names. Default is "schema".- Throws:
java.io.IOException
- Signals that an I/O exception has occurred.
-
xmlToXsd
public static java.lang.String xmlToXsd(java.lang.String xmlString, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, org.apache.xmlbeans.XmlOptions xmlOptions) throws org.apache.xmlbeans.XmlException, java.io.IOException
Creates or update the given xsd output file from the given XML String- Parameters:
xmlString
- the xml Stringinst2XsdOptions
- the inst2 xsd optionsxmlOptions
- the xml options- Throws:
org.apache.xmlbeans.XmlException
- occurs when a give xml file is invalid.java.io.IOException
- Signals that an I/O exception has occurred.
-
-