Hi
 
I don't know about how to create a custom output rule. But if you just want the output to be in a compact format  take a look in the quick start page at dom4j homepage. There is a example for how to do this!
http://www.dom4j.org/guide.html#Writing%20a%20document%20to%20a%20file
 
/Christian
-----Ursprungligt meddelande-----
Från: Benjamin Kopic [mailto:[EMAIL PROTECTED]]
Skickat: den 18 januari 2003 12:08
Till: [EMAIL PROTECTED]
Ämne: [dom4j-user] custom OutputFormat

Hi

I need to output large feed files in XML format. Using a standard OutputFormat I get the following structure:

<? xml version="1.0" ?>
<table>
  <row>
    <field/>
    <field/>
    <field/>
    <field/>
    <field/>
  </row>
</table>

For a large number of records with large-ish number of fields (say 20) the XML files become huge (say for 2 MB CSV file, and equivalent XML is closer to 10MB). I would like to reduce the number of whitespaces so that I would get:

<? xml version="1.0" ?>
<table>
  <row><field/><field/><field/><field/><field/></row>
</table>


How do I create a custom output rules, i.e. to instruct the output when to insert a whitespace after an element?

Best regards
-- 
benjamin kopic
m: +44 (0)780 154 7643
t: +44 (0)20 7794 3090
e: [EMAIL PROTECTED]
w: http://www.panContext.com/

Reply via email to