XML declaration

When you write an object XML in the file is possible to include the XML? statement


I tried the toXMLString() function, and that doesn't seem to work, I get the contents of the XML file fine but no statement.


So I tried adding it as a literal string (the book object is simple a XML object that contains all the content of the book):

var xmlFile = File(chapterFolder+app.activeDocument.name.replace(".indd","")+".xml");
xmlFile.open('w');
xmlFile.encoding = 'UTF-8';
xmlFile.write("""<?xml version="1.0" encoding="UTF-8"?>"""+"\r"+book.toXMLString());
xmlFile.close();

Is there a property I'm missing that would allow me to have the declaration included automatically?

See you soon,.

Kurtis

Hi Kurtis,

What is an ExtendScript XML object? I am able to do it in one of my scripts and get the statement:

var settingsXML = Element text;
saveSettingsFile (settingsXML);

function saveSettingsFile (settingsXML) {

    var settingsFile = File ($.fileName.replace (/\.jsx(?:bin)?$/i , ".xml"));
    settingsFile.open ("w");
    settingsFile.write ("\r" + settingsXML);
    settingsFile.close ();

}

This script give me this result:



  Element text

-Rick

Tags: InDesign

Similar Questions

  • "XML load error: invalid xml declaration ', SV Version 11.1.2.2.300 (Build 070)"

    Hello

    One of our users of Smart View has a new problem with their link of SV.  Woking in an ad hoc network, they changed some descriptions/names defined around Member and then all of a sudden received the error "XML load error: invalid xml declaration" so they were unable to overcome this error - even after completely logging on the company portal and record then back in.  They would get to the point of choosing an application workspace to connect under the table of connections shared for establishing a new ad hoc connection, but then this error still appears.

    Any ideas/suggestions on a solution?

    Thank you!

    Classic mistake with SmartView. The problem is that one last refreshed point of view users are stored in tables. It is a double-edged sword (part Nice is that's effective/downside, it's that sometimes breaks).

    The solution to this problem is remote in the SQL database behind HFM. Expand Databases ""-> HYPHFM (or similar)-> Tables-> find your application_USERPARAMS-> right click and edit top 200 rows. Find that users "USERMBRSEL" and delete the record.

    This should reset the stored view and allow the user to continue normal.

    Confirm this that my diagnosis is correct is to check if this user can access another application with the smartview, because this error is application specific.

  • How to exclude the each row of the result set XML declaration?

    Hello

    I have a table with an XMLTYPE column and would like to SELECT a set of rows. How can I exclude the each row of the result set XML declaration? My query currently looks like this, I am running through Spring JDBC:
    SELECT XMLSerialize FROM t1 WHERE XMLEXISTS('$e/Event' PASSING XMLTEXT AS "e") ORDER BY t1.time DESC myschema.event (HAPPY t1.xmltext)

    After selecting, in my application I convert each line in a string and concatenate all the rows in a large chain to analyze in a DOM model. I get a parser exception (org.xml.sax.SAXParseException: the target of the processing instruction corresponding to "[xX] [mM] [he's]" is not allowed) because there are several XML statements in my large chain. Of course, I could manually check the string on each line if it starts with the XML declaration, but it would be nicer if I could load the DB does not add it in the first place. Is there a way?

    Thank you!
    -Daniela

    Hello

    Some options that I can think of:

    SELECT XMLSerialize(CONTENT
     XMLtransform(t1.xmltext,
      xmltype('
     
     
    ')
     )
    )
    FROM myschema.event t1
    WHERE XMLEXISTS('$e/Event' PASSING XMLTEXT AS "e")
    ORDER BY t1.time DESC
    ;
    

    or quite simply,.

    SELECT XMLSerialize(CONTENT
      extract(t1.xmltext,'/')
    )
    FROM myschema.event t1
    WHERE XMLEXISTS('$e/Event' PASSING XMLTEXT AS "e")
    ORDER BY t1.time DESC
    ;
    
  • Downsaving to CS2 to CS4 - how to change the XML declaration

    I am under CS4 and am trying to downsave a CS4 CS2 file.  After a Google search, I found this page http://indesignsecrets.com/double-downsave.php that recommend this following:

    "I open the INX file and changed the XML declaration: .

    <? using style = "33″ type is 'document' DOMVersion is" 6.0 readerVersion = "5.0″ featureSet =" product = 257″ "6.0 (352)" "?" >

    TO:

    <? using style = "33″ type is 'document' DOMVersion is" 5.0″ readerVersion = "4.0″ featureSet =" product = 257″ "5.0 (662)" "?" >

    In other words, I have said my file from version 5 (aka CS3) CS2 and that can be read by version 4 (CS2). I changed the attribute 'product' to start, just in case CS2 sought also to this. »

    If I understand his instructions, I am to export the CS4 document in INX CS3 document, and then open that INX doc with a text editing program and edit the text as shown above.  After exporting to INX, I opened in Word and looked for ' <? aid' and it is nowhere in the many pages of text.

    I have also exported the CS4 one doc XML, but have had no success in finding this specific line.  What mistake I have done?


    Thanks in advance for helping this newbie!

    -Laura

    Word is not a text editor, it is processing. Open it in Notepad.

    Bob

  • Invalid xml declaration in MS word to xml loading

    Hello
    I want to develop relationships of eBusinessSuite with the XML editor. I build a competitor and I'm running to get the XML output. This output that I saved locally for use with MS Word to create model *.rtf. I'll show you the header of this file

    <? XML version = "1.0" encoding = "UTF-8"? >
    -<!
    Generated by the Oracle version 10.1.2.0.2 reports
    ->
    -< AR_TEST >
    -< LIST_G_1 >
    -< G_1 >
    < PERIOD_NAME > dec-95 < / PERIOD_NAME >
    < START_DATE > 1 December 95 < / START_DATE >
    < end_date > 31 December 95 < / end_date >
    < PERIOD_SET_NAME > accounting < / PERIOD_SET_NAME >
    Month < PERIOD_TYPE > < / PERIOD_TYPE >
    < NEW_PERIOD_NUM > 1 < / NEW_PERIOD_NUM >
    < / G_1 >
    -< G_1 >
    < PERIOD_NAME > Jan-96 < / PERIOD_NAME >
    < START_DATE > January 1, 96 < / START_DATE >

    When I use the utility add-in Office XML Publisher from MS Word 5.6.2 I get the following: xml declaration invalid (which seems to be in line 1 error)
    Can you tell me why?
    TIA,
    Aurel

    A fixed gaze and compare. The excerpt you posted looks like it's from XML in a browser rather than XML in a text file. If you have a good XML file, similar to what you're trying to use right now, do you see the extra dashes/hyphens before tags? Probably not.

  • problem with getting some xml UTF-8 characters

    Hello

    Please help me solve the following problem. I need to parse the XML string that contains the currency symbol (for example pound sign, see the code example). In the result of the variable currSign contains '? What's wrong?

    {} public static Sub test()

    try {}

    String data ="" +

    "0.00";

    ByteArrayInputStream is = new ByteArrayInputStream (data.getBytes ());

    DocumentBuilderFactory plant = DocumentBuilderFactory.newInstance ();

    DocumentBuilder builder = factory.newDocumentBuilder ();

    Doc document = builder.parse (is);

    Root element = doc.getDocumentElement ();

    String currSign = root.getAttributes () .getNamedItem ("unit"). getNodeValue();

    }

    catch (Exception e) {}

    }

    }

    Ah. I think I see the problem. You want to convert the string into a byte array data using the version without getBytes() argument. Which uses the default encoding (which is ISO-8859-1). You must call getBytes ("UTF-8") or specify ISO-8859-1 for the xml declaration.

  • Insert bfilename file.xml changes feature to windows-1252 encoding

    Hi, I'm under Oracle 11.2.0.1 and I'm trying to insert xml to an .xml file in a windows directory in a table with a field new_xmldata unique xmltype. The characters of database are set to AL32UTF8. The xml encoding is ' UTF - 8', and it's in the header entity. " I checked the encoding by opening the file in XMLSpy and also if I open the file and "save under", once again the encoding is listed as UTF - 8. Then I run the code

    insert into new_xmldata values (XMLTYPE(bfilename('IMPORT_DIRECTORY', 'file.xml'), nls_charset_id ('AL32UTF8')));
    
    

    Now when I select data in the recording of the encoding entity XML declares a WINDOWS-1252 encoding.

    Why the change in coding and what can be done to prevent this? (Sorry, I want to provide the data for example but I am working on a secure site and cannot download this?)

    Thank you in advance to those who can help.

    The encoding is adjusted to reflect your customer environment (NLS_LANG).

    This is the expected behavior.

    See: we did using Oracle XML DB

    You don't have to update anything, the XML is still stored in the encoding in UTF-8 data.

    To keep the original coding in the prologue, whatever your NLS client, use explicit serialization:

    Select xmlserialize (xmldata document)

    of new_xmldata;

  • problems with the XML that is returned when you call a web service with CF11

    Hi, I ran into an unusual behavior when calling web services.

    I call a web service that returns an XML like this:

    < children >

    < child >

    John < firstname > < / name >

    DOE < name > < / lastname >

    < / child >

    < / children >

    during the call to the web service of CF10, it works fine. However, when the CF11, I don't get this:

    < child >

    John < firstname > < / name >

    DOE < name > < / lastname >

    < / child >


    no < child >? for some reason, CF11 ignores / hides the highest level XML. This does not happen on previous versions. Why? the server that hosts the web service's CF11 too.

    Report it as a bug in Coldfusion. In any case, I recommend making sure your web service returns a string, not an XML object.

    This is because a web service must be universal. Appellants to .NET, Java, PHP, ASP and so on, will interpret a chain exactly the same way. Whereas an object XML Coldfusion is a construction that is heard only in CFML.

    Your return string should also start with the XML declaration, like this

    John

    DOE

    So it is clear to the appellant in which brought the cat.

  • Is it possible to modify the XML mapped schema that is generated by the action of submit before submitting?

    I have a form created in LiveCycle ES2. I have a few fields mapped to a schema which causes LC to generate XML data that follow the format for importing one of the internal databases of my company.

    There is a problem: the system import feature seeks a DOCTYPE DTD declaration between the XML declaration and root element. I tried including the declaration in the schema, but LC does not include it in the values mapped or export. I spoke with the seller on the declaration of the DTD as part of the import function and they gave a firm "no."

    Is there a way to insert a single line of markup in the XML that LC generates in the action to submit before the XML code is attached to the email?

    Hello

    You can use XSLT to transform the outbound data.

    I have never done this for the addition of a DTD, but Google finds solutions for the term "xslt adds dtd" it should be possible.

    Adding a DOCTYPE statement on the output XSL - Scriptorium Publishing

    Set the DOCTYPE in XSL, Bernie Zimmermann

  • Why is there no no &lt;? XML

    I am as well as my RDF/XML to PDF and have almost finished what I decided to do. The only thing that intrigues me... Why a RDF/XML to start with <? XML... but with <? xpacket...?

    If I analyze and regenerate the RDF/XML using a regular XML parser that works very well, it adds that the <? XML. but the documentation does not have this tag.

    There are 2 parts to the answer.

    First, the XML declaration is optional.

    Second, a XMP packet not are by force to be considered as a standalone XML document. This allows us to avoid making a special case for multiple XMP packets incorporated within a 'real' XML document (as a SVG file).

    hope this helps,

    Alan Lillich

    Adobe Systems

  • Analysis of the inline XML

    Greetings,

    I am running CF MX7 and uses XMLparse to parse the following XML code.

    XMLparse works very well and returns the appropriate structure (or so I thought). The description tag starts by "trout ('and then the tag strong inline surrounds 2 sets of text." with 'and' between the two, followed by a ")" at the end.

    Structure description of the Tufts all text not with the strong tags in a single XMLtext ("trout (and) '") and has two child nodes for each of the brands. I can analyse everything but can not output the text in appropriate order. I analyzed this XML with stylusStudio and it creates correctly 3 fields of description with the appropriate text in the 2 fields strong and them.

    Shouldn't XMLparse also return 3 both description elements?

    Thanks for any information...

    You must the content of the description element ToString() and then remove any XML declaration extrinsic which adds the function. Unless you're using CF6.1, in which case you can use Java toString() as a shortcut... it won't turn on the statement.

  • ATML Reporting: "an invalid character was found in text content."

    When you use ATML and including non-ASCII characters (code decimal 128 and more), the generated report is not viewable in Internet Explorer (or Firefox, in fact), producing the error "an invalid character was found in text content." I think it's because TestStand isn't actually encoding the content of the report to the UTF-8 format. The same sequence produces a clickthrough report XML declaration. It seems that this issue has been found (and fixed) for the XML declaration but many years back.

    If you open the attached XML file in UTF-8 compatible text editor (I used the Notepad) and re-save specifically in UTF-8 format, IE will happily consider subsequently report. The part that really confuses me is that TestStand generates successfully the temporary HTML version of the report for the integrated report viewer (also attached), the parser used internally by TestStand must be a bit more lenient than IE.

    I've included an example with a VI sequence, which returns only a string of ReportText of these problematic characters.

    ASBO-

    Thank you for bringing This problem to our attention. This will be fixed in a future version of TestStand. In the meantime, you can fix this problem with your current version of TestStand by editing the reportgen_atml.seq file. I've attached an example of how you could modify the reportgen_atml.seq file to fix it in this position. Please, note that this is simply an example of correct behaviour and may not be the final implementation included in future versions of TestStand. I recommend that you do not replace or delete your reportgen_atml.seq file and save the version annexed to your \Components\Models directory.

    I hope this helps. Thanks again for this bring to our attention.

  • LabVIEW FPGA CLIP node compilation error

    Hello NO,.

    I work on an application for my Single-Board RIO (sbRIO-9601) and faced with a compile error when I try to compile my FPGA personality via the ELEMENT node.  I have two .vhd files that I declare in my .xml file and all at this point works great.  I add the IP-level component to my project and then drag it to the VI I created under my FPGA.

    Within the FPGA personality, I essentially have to add some constants on the indicators and entries CLIP to my CLIP out and attempt to save/compile.  With this simple configuration, I met a compilation error (ERROR: MapLib:820 - symbol LUT4... see report filling for details on which signals were cut).  If I go back to my VI and delete indicators on the output (making the output pin of the CLIP connected to nothing), compiles fine.

    I've included screenshots, VHDL and LV project files.  What could be causing an indicator of the output of my VI to force compilation errors?

    Otherwise that it is attached to the output ELEMENT, a successful compilation...

    After that the output indicator comes with CLIP, compilation to fail...

    NEITHER sbRIO-9601
    LabVIEW 8.6.0
    LabVIEW FPGA
    Windows XP (32-bit, English)
    No conflicting background process (not Google desktop, etc.).

    Usually a "trimming" error gives to think that there are a few missing IP.  Often, a CLIP source file is missing or the path specified in the XML file is incorrect.

    In your case I believe that there is an error in the XML declaration:


      1.0
      RandomNumberGenerator
     
        urng_n11213_w36dp_t4_p89.vhd
        fifo2.vhd
     

    This indicates LV FPGA to expect a higher level entity called "RandomNumberGenerator" defined in one of two VHDL files.  However, I couldn't see this entity in one of two files.  If urng_n11213_w36dp_t4_p89 is the top-level entity, edit the XML to instead set the HDLName tag as follows:

    urng_n11213_w36dp_t4_p89

    Also - in your XML, you set the 'oBits' music VIDEO for output as a U32, however the VHDL port is defined as a vector of bits 89:

    oBits: out std_logic_vector (89-1 downto 0)

    These definitions must match and the maximum size of the vector CLIP IO is 32, so you have to break your oBits in three exits U32 output.  I have added the ports and changed your logic of assignment as follows:

    oBits1(31 downto 0)<= srcs(31="" downto="">
    oBits2(31 downto 0)<= srcs(63="" downto="">
    oBits3(31 downto 0)<= "0000000"="" &="" srcs(88="" downto="">

    Both of these changes resulted in a successful compilation.

    Note: The only compiler errors when you add the flag because otherwise your CUTTING code is optimized design.  If the IP is instantiated in a design, but nothing is connected to its output, it consumes all logic?  Most of the time the FPGA compiler is smart enough to get it out.

  • How can you add totaltime to test everything not in the report

    We use with the xml declaration horizontal.xsl.  I see the totaltime property in the xml file.  I have a comment to the code in the style sheet to display the time of module for the steps of success/failure.  I'd rather see totaltime for each step.

    Alternative is to write Labview code to extract the name of the test step and Associates time from xml code.

    Problem solved.  I wrote my own little style sheet for just the time to display in a table. Works better than treatment in Labview.  LabVIEW used to take hours to process the xml file and give me the same result.  Internet Explorer takes approximately 15 seconds.

  • Include the results in "Batch report" instead of "report USE".

    Hi all

    I modified the ProcessSetup TS 4.0 reminder to perform a test of the preliminary material before testing 8 DUT using batch processing model. Since this is a reminder, the results are not registered by default, so I store it in a global table of results. Then I copy this table of results into my results MainSequence table.

    The problem is that this means that these preliminary results will be saved for UUT0 (if I use "A thread only" synchronization") or to the DUT (if I use the synchronization of batch processing model). How can I add my ProcessSetup test results to the "Results of the batch" section of the results page rather than the sections "USE results? The test checks the shared material and is thus applied to the DUT. I prefer not repeated it for each USE or make it look like, it applies only to WEAR it first.

    Thank you

    Chris

    Tomahawk,

    Al is correct that is whether you use HTML or ASCII report formats, you can override the ModifyReport... Reminders to get what you want. Unfortunately, with the XML declaration, you can use the ModifyReport... Reminders. In order to accomplish the functionality that you want to see everything and still use the report XML form, you will need to change the BatchReport reminder, as well as the XML style sheet you use.

    TestStand 4.2, we have created tutorials and provided better material for our XML Style sheets. With a little effort, I am convinced that with TestStand 4.2, you would be able to reach your goal.

    I suggest to take a look at customization of Style TestStand sheets of TestStand 4.2 help (available online). Unfortunately, Style XML TestStand 4.0 sheets do not have the same quality of literature as the TestStand 4.2 Style sheets, so you don't will not commented sections in the leaves of Style 4.0 as explained in the help.

    For this particular case, you do not want to change the reminder of BatchReport to store the data that you want to place in your report batch section. Then, you change the section batch report of the Style XML with XPath map appropriate to display these data in the batch report.

Maybe you are looking for

  • 9.3.5 IOS Iphone 6

    IPhone 6s system build 13G 36, kernel, kernel Darwin 15.6.0 build 199506. ID device Iphone8, 1 Type N71Ap Bluetooth, autonomy, random reboots, Wi - Fi problems with Apple music, problems with Touch ID, photo albums, installation problems sync problem

  • file sharing strange behavior

    Hello Im having a macmini with 10.11.4 / Server 5.1 running. In principle, all right. The exception file sharing is strange. In the Finder on my MacBook (also 10.11.4) I can see the macmini in the sharing section. Once I click on the macmini, told me

  • If you delete something in the cloud disappears from Apple device?

    f you delete something in the cloud disappears from Apple device?

  • Satellite Pro A200 - peripheral display Hotkey Utility for XP is not available

    I just got 6 x A200s (PSAE1E-00Q002EN). These have been pre-installed with Vista, however, because of the software platform in place in my institution, I've restored the operating system to Windows XP. All the drivers installed fine form the Toshiba

  • Google TV does not work with Chrome

    I have a Sony NSX-46GT1. I tried to go to abc.com to watch a prior issue of a TV program that I had missed. I could find the episode that I had missed and he was preparing to play. As soon as I scored to start I received a message 'Error' that my sys