How to generate xml file with an existing dtd for sample of data using Java
问题 I have some data stored in : HashMap<Position, Double> listOfPoints = new HashMap<>(); Where key contains pair (x,y). I have defined also my dtd file called generated.dtd which contains my structure : <!ELEMENT table (point*,id,position,x,y,value)> <!ELEMENT point (id,position,value)> <!ELEMENT id (ID)> <!ELEMENT position (x,y)> <!ELEMENT value (#PCDATA)> <!ELEMENT x (#PCDATA)> <!ELEMENT y (#PCDATA)> Using that file and sample of data stored in listOfPoints , I would like to generate an xml