-
1. Re: [JS] Write XML file
absqua Oct 28, 2013 12:19 PM (in response to Philippe Ruelle)The XML object has some class properties ("prettyPrinting", "prettyIndent") that are probably relevant: http://jongware.mit.edu/idcs6js/pc_XML.html . But I think the defaults should give you what you want, so I don't know why you're seeing what you're seeing if you haven't changed them.
Jeff
-
2. Re: [JS] Write XML file
Philippe Ruelle Oct 28, 2013 12:45 PM (in response to absqua)Thanks, but do you have an example because I had already test but I can't get it to work. -
3. Re: [JS] Write XML file
absqua Oct 28, 2013 1:37 PM (in response to Philippe Ruelle)Are you setting those properties on the class or an instance? It's a class property.
var file = new File("~/Desktop/temp/sample.xml"), xml; file.open('r'); xml = new XML(file.read()); file.close(); XML.prettyPrinting = false; alert(xml.toXMLString());gives you the smushed-together output:
XML.prettyPrinting = true; alert(xml.toXMLString());
looks right:
-
4. Re: [JS] Write XML file
Philippe Ruelle Oct 28, 2013 1:43 PM (in response to Philippe Ruelle)OK, I have not too usual but the configuration of these deuxligne and this function:XML.prettyIndent = 5;
XML.prettyPrinting = true;
-
5. Re: [JS] Write XML file
Philippe Ruelle Oct 28, 2013 1:53 PM (in response to Philippe Ruelle)I would like to used the class "namespace".Currently I use it like this:
default xml namespace = 'http://www.idpf.org/2007/opf';
but I also have to put the two following
unique - identifier = "bookid" version = "2.0".
But my its too short deep.
Thank you
-
6. Re: [JS] Write XML file
Philippe Ruelle Oct 29, 2013 2:47 AM (in response to Philippe Ruelle)Thank you I went out with this
leFichierContentXML.@['xmlns'] = 'http://www.idpf.org/2007/opf';
leFichierContentXML.@['unique-identifier'] = 'bookid';
leFichierContentXML.@['version'] = '2.0';
Thank you




