Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdate xml file node attribute in actionscript
    primarykey
    data
    text
    <p>We need to modify/update the xml attribute of .idms file. using actionscript. I'm using below approach to do that.</p> <pre><code>protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void { var file:File = File.desktopDirectory.resolvePath('myInputFile.xml'); var fileStream:FileStream = new FileStream(); fileStream.open(file, FileMode.READ);// doesn't read processing instrunction var xml:XML = new XML(fileStream.readUTFBytes(fileStream.bytesAvailable)); fileStream.close(); var writeStream:FileStream = new FileStream(); writeStream.open(file, FileMode.WRITE); for each(var node:XML in xml.descendants("*")) { if(node.localName() == "Link") { var linkfile:String=node.@LinkResourceURI = "file:/Shared/Logos/Bk.ai"; } } writeStream.writeUTFBytes(String(xml)); writeStream.close(); } </code></pre> <p>In above code problem is that it does not read processing instruction on top of xml file. in result after writing the xml file, it won't read the file as InDesign snippet file anymore. Processing instrunctions are:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt; </code></pre> <p>Can anyone help me in figure out how I can I read the processing instrunction as well in new file ?</p> <p>Thanks for quick reply but Even though I've made this property as flase it's keep ignoring the processing instuction.</p> <pre><code>var file:File = File.desktopDirectory.resolvePath('031413115849909.idms'); var fileStream:FileStream = new FileStream(); XML.ignoreProcessingInstructions = false; //newly added fileStream.open(file, FileMode.READ); var xml:XML = new XML(fileStream.readUTFBytes(fileStream.bytesAvailable)); fileStream.close(); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload