0

I need to extract Data from my XML file in to format (PDF or Doc). My Output in my programme Java is a XML file with this content: 1.Balise html to content Type of document,Name of Title,Creation-Date,And Name of creator(All information about each document that it create by default with Gate GUI developper in Application). 2.Annotation to Address,and P (Paragraphe). Here is part of my XML File.Now i dont have any idea for how to extract my data and convert it to PDF file! Are the CSS2XSLFO could help me or not ?if yes how i can integerate that in my programme ?

  <html gate:gateId="0" gate:annotMaxId="759">
  <head gate:gateId="1">
  <meta gate:gateId="2" content="1" name="xmpTPg:NPages">
.
.
.
<meta gate:gateId="10" content="Microsoft® Word 2010" name="creator">
<title gate:gateId="11"/>
</meta>
</meta>
</head>
<body gate:gateId="12">
<div gate:gateId="13" class="page">
<p gate:gateId="14"><p gate:gateId="15"> Alain Paquet Né le 21 02 1963 
</p>
<p gate:gateId="16"> </p>
<Address gate:gateId="691" rule1="IPaddress2" kind="ip" rule2="IpFinal">06 14 64 76 05</Address>
</p>      
</div>

Vampir
  • 31
  • 5

1 Answers1

0

You could to that with The Flying Saucer XHTML renderer project wich support XHTML to PDF output.

L. Quastana
  • 1,273
  • 1
  • 12
  • 34
  • Thanks for your reply.I use the XMLparser,But I have the Exception org.xml.sax.SAXParseException; Fatal Error] :1:1: Content is not allowed in prolog. Exception in thread "main" org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at NafisehPkg.NafisehMain.main(NafisehMain.java:148) – Vampir Nov 29 '13 at 16:12
  • DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); InputSource inStream = new InputSource(); inStream.setCharacterStream(new StringReader(filename)); org.w3c.dom.Document doc1= db.parse(inStream);//I have Exception here – Vampir Nov 29 '13 at 16:15