![]() ![]() Generally, when someone asks this question, they're looking at one or two schemas they're using which define a relatively simple document structure. That makes for a rule that can determine that both of these elements are valid: Īt the same time, that rule gives you pretty much zero help in determining how to take a tuple of data items and create a foo element from it. A foo element can have either a bar or baz child, then either a baz or bat child, then a foo, bar, or bat child. Those aren't the same thing by a long shot.įor instance, it's trivial to create a complex type in XML Schema that consists of a sequence of optional choices. It doesn't tell you how to make a new document it tells you whether or not the document that you made is valid. XML Schema is a document validation language, not a document production language. ![]() This seems like something that would be easy to do, but it's not. Public void setListPerson(List listPerson) Ĭonsole.log(xml) converting csv to xml with an xsd People.java (root element of xml file) (XmlAccessType.FIELD) then marshal the list of objects to xml file New ByteArrayInputStream(yourByteArray))) Ĭonverting CSV File to Hierarchy XML in JAVA with JAXBįirstly read the csv file and collect the objects (person) from individual lines. So in your case, you may try using a bytes stream reader, as in: CSVReader reader = new CSVReader( Since CSVReader's constructor takes a Reader as parameter, you can pretty much pass anything that's readable to it. ![]() Using OpenCSV to convert CSV file to XML using byte array in input You can read CSV file with this tool and serialize it to XML. Java lib or app to convert CSV to XML file? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |