Extended TextLayoutImporter (importing XML with InlineGraphicElements)

I received an email from someone asking a way to re - import TLF XML that contains InlineGraphicElements that do not use an external image file.

For example, an instance of MyBoxClass, or MySmileyElement. A user can add a bunch of them to a TextFlow, and when you export the XML code you get the standard toString() of this class in the source = "" attribute, for example: "

"< whiteSpaceCollapse flow: TextFlow ="preserve"xmlns:flow =" http://ns.adobe.com/textLayout/2008 "> "
< stream: p fontSize = "24" >
< flow: span > Lorem < / flow: span >
< flow: img height = "50" width = "50" source = "[object MySmileyElement]" / >
< flow: span > Ipsum < / flow: span >
< / flow: p >
< / flow: TextFlow >

If an idea is to simply override the toString() method in my custom graphic class to provide enough information to reconstruct my smiley as it was, but despite this, importer of the TLF Framework standard must know how instantiate these as custom graphical classes...

After delving into the code and by placing a few breakpoints, I see that we really need to extend the TextLayoutImporter class, because it is one of the classes that implements ITextImporter. But it is an inner class (I think?) and so we cannot. In addition to this, there should be a way to indicate the TextFilter class to use our ITextImporter custom.

Is this something that will be planned. I don't see how people can create publishers with graphic elements customized without being able to export/import their disc/DB TextFlow?

Thanks in advance for your suggestions.

Richard

I agree to give the users a mechanism to convert graphics to a string that is written in the source, and then this string to a DisplayObject.

TLF does not load graphics when importing. They get loaded the first time, they are composed. This prevents graphics on the Clipboard and copies that hang loading and memory loss, or if they have an audio track to make noise. In any case fixing brackets it through the client will do some work and will soon.

What I'd say is the following:
(1) do not know the source property
(2) tag each ILG with a custom style that describes your custom representation of the graph. It will be exported to.
(3) after importation, navigate and the value of the custom style to calculate a display (for the ILG.graphic value) object or source the property to (ILG.source).
(4) the paste operation will have something similar as a post-process to the pasted range.

Hope that helps,
Richard

Tags: Adobe Open Source

Similar Questions

  • Import xml with attributes how to apply the pagination, property

    I have xml files in which paging is set using an attribute. The value of this attribute must be read and applied to the paragraph format in FrameMaker when importing xml files. I guess it must be educated according to the rules of reading writing. But how?

    Arnor,

    To control the format paragraph with an attribute, apply format rules in ESD rather than read/write rules. You cannot copy a value to attribute to a property value, but can test specific attribute values and set a property accordingly. For example, if you have a widow named attribute and know sure that value never exceeds 10, laboriously have a rule such as:

    1. If the context is: [widow = "1"]

    Paging properties

    Widows and orphans lines: 1

    Otherwise, if the context is [widow = '2']

    Paging properties

    Widows and orphans lines: 2

    ...

    Otherwise, if the context is [widow = "10"]

    Paging properties

    Widows and orphans lines: 10

    For other paragraph pagination properties, your ESD must also test values, for example:

    2. If the context is [Placement = 'RunIn']

    Paging properties

    Placement: Top of break-in

    By default the punctuation:

    Otherwise, if [Placement = 'Coast']

    Placement: Head to one side

    Of course, attribute names may be different from the names of properties of FrameMaker or value keywords.

    -Lynne

  • Importing XML with graphics issues

    I am importing an xml document in FrameMaker 11. I have a DTD, model, read/write rules and an installer of the XSL stylesheet in the structapps file. I have problems referencing the graphics. My XML is:

    < m ultisheet > < chart boardno = "FileName" / > < /multifeuille >

    I need is:

    < multifeuille >< boardno graphic "figures/FileName.cgm" = ></multifeuille >

    My XSL is:

    <? xml version = "1.0" encoding = "UTF-8"? >

    " < xsl: stylesheet xmlns: xsl ="http://www.w3.org/1999/XSL/Transform"version ="1.0"> "

    < xsl: strip-space elements = "*" / >

    < xsl: template match = "node () | @*" >

            < xsl:copy >

    < xsl: apply-templates select = "node () | @*" / >

            < / xsl:copy >

    < / xsl: template >

    " < xsl: template match="multisheet/graphic/@boardno ">

    < xsl: attribute name = "boardno" >

    < xsl: value-of select = "concat ('figures\',., '.cgm')" / >

    < / xsl: attribute >

    < / xsl: template >

    < / xsl: stylesheet >

    My read/write rules:

    "widget"

    {

    FM widget 'graphic';

    'boardno' attribute is the property of fm; file

    'content' attribute is "content of attribute"; fm

    }

    With this configuration, I am not able to see my drawings in FrameMaker, any help would be appreciated.

    Halfeye,

    With a quick look, as well your rules of r/w and your XSLT code look OK to me. What error messages do you get when you open the file? I guess that there are messages on the graphics. Did give any useful information? For example, can you tell if FM is looking for them in the right directory?

    The first thing I would do to debug an application such as this is to confirm that both the rules of r/w and pre process are treated. Try to rename the two files and try the import again. If you receive no error messages not being able to open these files, or FM is not using the appropriate application or the application is not set correctly.

    Once you have verified that the two files are used, I suggest running the XSLT regardless of the import. You can do this in XML mode or in another XSLT processor. The output looks similar to the way that you expect? Otherwise, use a XSLT debugger or put in some debugging statements.

    -Lynne

  • Problem with InDesign startup script does not import XML images

    I'm doing an XML import automatically from a startup script when a document is loaded. I managed to get most of the content to fill, but the images are ignored. Everything works, including images, when I do a manual 'Import XML' through the user interface or a manual script.

    Here's my manual script:

    var myDocument = app.activeDocument;
    var xmlFile = File('/c/Full/Path/To/data.xml');
    
    myDocument.importXML(xmlFile);

    But the goal is to do at startup. Here's my startup script:

    #targetengine "session"
    
    app.addEventListener('afterOpen', function(myEvent) {
       if (myEvent.target.constructor.name !== 'Document') {
       return;
       }
    
       var myDocument = myEvent.target;
       var xmlFile = File('/c/Full/Path/To/data.xml');
    
      myDocument.importXML(xmlFile);
    });

    Here is the XML tag for the image:

    <Image href="file:///C:/Full/Path/To/Image/02.png" />

    I wonder there is a problem with the 'afterOpen' event reminder, and it is the reason why it works manually using the same method, but not in the startup script.

    I solved it by avoiding the event quite listener:

    main();
    
    function main () {
    
        // create a path for a file object
        var curFile = File('/c/Path/To/file.indd);
        var xmlFile = File('/c/Path/To/data.xml');
    
        // close app if files don't exist
        if (!curFile.exists || !xmlFile.exists) {
            app.quit(SaveOptions.NO);
        }
    
        // open the file
        var curDoc = app.open(curFile);
    
        // import the xml
        curDoc.importXML(xmlFile);
    
        // create a new file object
        var pdfFile = new File(curFile.parent + '/' + curFile.name + '.pdf');
    
        // export to pdf
        curDoc.exportFile(ExportFormat.PDF_TYPE, pdfFile);
    
        // close app
        app.quit(SaveOptions.NO);
    
    }
    
  • problem with import XML CALS table

    HII all

    After you import this xml file, any of the styles are getting applied. What is the problem can anyone please suggest me?

    How can I keep the formatting of the array of client access licenses?

    <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? >

    " < root xmlns:aid =" http://ns.Adobe.com/AdobeInDesign/4.0/ "xmlns:aid5 =" " http://ns.Adobe.com/AdobeInDesign/5.0/ ">

    " < table reference to the line xmlns:aid5 = ' http://ns.Adobe.com/AdobeInDesign/5.0/ "aid5:tablestyle ="Table Style 1"id ="data-uuid-85c64ce474f44dd29d9a3fa865f904cc"class =" fonts color5 table-b-without personal-tbl-1 "> < legend > < div id ="data-uuid-4298179eea2d4f2d82a32c67b4c9fa0e"class ="enumeration"> table 14.1 < / div > < id p ="data-uuid-d0268f391343450cbab368b1831ff025"class ="caption text-upper case"" > isolating mechanisms < /p > < / legend > < table xmlns:aid = " " http://ns.Adobe.com/AdobeInDesign/4.0/ "xmlns:aid5 =" " http://ns.Adobe.com/AdobeInDesign/5.0/ ' > < tgroup cols = "3" > < colspec colname = "col1" align = "left" / > < colspec colname = "col2" align = "left" / > < colspec colname = "col3" align = "left" / > < tbody > .

    < class rank = "sans-bordure" aid5:cellstyle = "Cell Style 1" > < input id = "data-uuid-ede057eb285543d8a4cbc4d3b565d7ff" colspan = "2" = "col1", "col2" = nameend namest > mechanism < / entry > < input aid5:cellstyle = 'Cell Style 1' id = "data-uuid-e016edb506ee49aea209f19478f4d824" > Description < / entry > < / row >

    < row > < entry class = 'coinciding stripe_light' aid5:cellstyle = 'Cell Style 1' id = "data-uuid-506493f60a084106ae6296aff9216574" colspan = "3" = "col1" = "col3" nameend namest > < b aid: cstyle = "Bold" > < i > pre-Zygotic isolating mechanisms < /i > < / b > < / entry > < / row >

    "< class rank ="coinciding stripe_light"> < input aid5:cellstyle = 'Cell Style 1' id = 'data-uuid-8145412fdb39438095a7197ada7f2115' > < id p 'data-uuid-70e60bc9ad3a4ac291fb620caf081d1d' = > geographic isolation < /p > < / entry > < entry aid5:cellstyle = 'Cell Style 1' id ="data-uuid-9ed825cf49c04082a20168440f46201a"class ="top-align"> < img src =".. /.. "/ img/chapter14/joh24218_ta1419a.png" id = "data-uuid-e6a1f66608b04b26b14692423a7e359f" class = "icon" alt = "" / > < / entry > < entry aid5:cellstyle = "cell Style 1" id = 'data-uuid-0f7976f59c5049b9bacc944ad602e341' > < id p 'data-uuid-0e5db85451dd4885a23c605db00311c5' = > species meet in different areas, which are often separated by a physical barrier such as a river or a mountain. "." < /p > < / entry > < / row >

    "< class rank ="coinciding stripe_light"> < input aid5:cellstyle = 'Cell Style 1' id = 'data-uuid-f5f1fc6665c849a6beebebc2dcca0451' > < id p 'data-uuid-2af394a0735e40d9ab4443e73def9cd1' = > ecological isolation < /p > < / entry > < entry aid5:cellstyle = 'Cell Style 1' id ="data-uuid-fcb4f22194854f2fbde9f015ab979afc"class ="top-align"> < img src =".. /.. «/ img/chapter14/joh24218_ta1419b.png "id ="data-uuid-67b213f9d25a4aa9b6c485a29f7adbc5"class ="icon"alt =" "/ > < / entry > < entry aid5:cellstyle =" cell Style 1 "id = 'data-uuid-026ecfe721b3486b8297cb8488a61aa1' > < id p ="data-uuid-ec1a4beee213488db3355a6533414bbd"> species are found in the same area, but they occupy different habitats."» Survival of the hybrids is low because they are not suited to every environment of their parents. < /p > < / entry > < / row >

    "< class rank ="coinciding stripe_light"> < input aid5:cellstyle = 'Cell Style 1' id = 'data-uuid-42178dda8c6a439cb1be19973c9b4aff' > < id p 'data-uuid-1a5d7da421694a03b0be2a377675b365' = > temporal isolation < /p > < / entry > < entry aid5:cellstyle = 'Cell Style 1' id ="data-uuid-8eff236da2844032bb69976f45b64ae1"class ="top-align"> < img src =".. /.. «/ img/chapter14/joh24218_ta1419c.png "id ="data-uuid-e6a36506d48a47bd9534fc4781a94432"class ="icon"alt =" "/ > < / entry > < entry aid5:cellstyle =" cell Style 1 "id = 'data-uuid-5bd683b850434384bb97c205230977fc' > < id p = 'data-uuid-ccff8d5b8bbd46e9a5e70f3eb107dac6' > species breed throughout the seasons or at different times of the day."» < /p > < / entry > < / row >

    "< class rank ="coinciding stripe_light"> < input aid5:cellstyle = 'Cell Style 1' id = 'data-uuid-bcb00d31536b42d58dbc1abeb721dd8d' > < id p 'data-uuid-8086b5add322409b91f267d79c7c74d9' = > behavioral isolation < /p > < / entry > < entry aid5:cellstyle = 'Cell Style 1' id ="data-uuid-0c5a2a11119a47aa96d47e956ba45f52"class ="top-align"> < img src =".. /.. «/ img/chapter14/joh24218_ta1419d.png "id ="data-uuid-c1c60e0a6ecc477389c3a96ccab64552"class ="icon"alt =" "/ > < / entry > < entry aid5:cellstyle =" cell Style 1 "id = 'data-uuid-54254e285d4e44299937d69b1868a1f1' > < id p ="data-uuid-e5274b4e29544b658fe7aaa6d39da9cb"> species differ in their mating rituals."» < /p > < / entry > < / row >

    "< class rank ="coinciding stripe_light"> < input aid5:cellstyle = 'Cell Style 1' id = 'data-uuid-62aa183214524825a376afc55f5490c7' > < id p 'data-uuid-3a10962b672c4fa4b896e6bee387f3cd' = > mechanical insulation < /p > < / entry > < entry aid5:cellstyle = 'Cell Style 1' id ="data-uuid-5c977123e6214b1bb10373e47860bc96"class ="top-align"> < img src =".. /.. "/ img/chapter14/joh24218_ta1419e.png" id = "data-uuid-822bea6dd64d4badb5bca8cdd51343ec" class = "icon" alt = "" / > < / entry > < entry aid5:cellstyle = "cell Style 1" id = "data-uuid-3a48404d0ccf4231b05bacb311a0bfac" > < id p = "data-uuid-f5f1276a7f8341feb43d3d7d26c03f8a" > prevent the structural differences between the mating species. ". < /p > < / entry > < / row >

    "< class rank ="coinciding stripe_light"> < input aid5:cellstyle = 'Cell Style 1' id = 'data-uuid-488c3da229c44bbcbd251f4a192e0c5c' > < id p 'data-uuid-e141a87c287148bc99e9bfb2879865fd' = > prevention from the fusion of gametes < /p > < / entry > < entry aid5:cellstyle = 'Cell Style 1' id ="data-uuid-b08134eaff11491cbdcd00b25adebc73"class ="top-align"> < img src =".. /.. "/ img/chapter14/joh24218_ta1419f.png" id = "data-uuid-e400f7983e7d4d2591fb84f56214034e" class = "icon" alt = "" / > < / entry > < entry aid5:cellstyle = "cell Style 1" id = 'data-uuid-0148f03041554bc880da2f1c994954b0' > < id p 'data-uuid-378da9e575e146348707abba6e4ea619' = > gamete of a species work poorly with the gametes of another species or within the genitalia of another species. ". < /p > < / entry > < / row >

    < class rank = 'coinciding stripe_light' > < input aid5:cellstyle = 'Cell Style 1' id = "data-uuid-d9873c4599f84de9ac19da0fc440b2a8" colspan = "3" = "col1" = "col3" nameend namest > < b aid: cstyle = "Bold" > < i > mechanisms of isolation postzygotique < /i > < / b > < / entry > < / row >

    "< class rank ="coinciding stripe_light"> < input aid5:cellstyle = 'Cell Style 1' id = 'data-uuid-d4aaddfcdd4c4c67b250d0a2cc9153d1' > < id p 'data-uuid-c6e23322167c4313bd6be5acf1de40a3' = > unsustainability of the hybrids or infertility < /p > < / entry > < entry aid5:cellstyle = 'Cell Style 1' id ="data-uuid-f3362efbf437435e99f1632b5c2b7d8e"class ="top-align"> < img src =".. /.. «/ img/chapter14/joh24218_ta1419g.png "id ="data-uuid-e1ab32a551494b97acceb87a68831f60"class ="icon"alt =" "/ > < / entry > < entry aid5:cellstyle =" cell Style 1 "id = 'data-uuid-bdcd5b643e6d42d59255fa3195ee6107' > < id p = 'data-uuid-f1fdfcd406a844bdb00f16de9a81b270' > hybrid embryos do not develop properly, hybrid adults do not survive in the wild, or hybrid adults are infertile or have reduced fertility."» < /p > < / entry > < / row > < / tbody > < / tgroup > < / table > < / purchase online table > < / root >

    You try to call attributes on a table of client access licenses. As a cal, Indesign tries to draw as a result to the specification of CLIENT access licenses. Do not know a thing about aid attributes: cellstyle.

    So if you want to use these styles in a tahnks tbal of importing xml, you must use a more user-friendly table InDesign XML syntax.

    More details here:

    http://carijansen.com/InDesign-XML-part-2/

    HTH

    Loïc

    http://www.ozalto.com/

  • Animate CC import &amp; xml

    I recently changed my CS4 to animate centuries previously, I imported xml data in to dynamic text fields using the following steps:

    var xmlData:XML = new XML();

    var theURL_ur:URLRequest = new URLRequest ("affiche.xml");

    var loader_ul:URLLoader = new URLLoader (theURL_ur);

    loader_ul.addEventListener ("complete", fileLoaded);

    function fileLoaded(e:Event):void

    {

    xmlData = XML (loader_ul.data);

    CAM_txt. Text = xmlData.CAM;

    CAL_txt. Text = xmlData.CAL;

    CPM_txt. Text = xmlData.CPM;

    CPL_txt. Text = xmlData.CPL;

    DAM_txt. Text = xmlData.Double_AM;

    DAL_txt. Text = xmlData.Double_AM_limite;

    DPM_txt. Text = xmlData.Double_PM;

    DPL_txt. Text = xmlData.Double_PM_limite;

    }

    I created a HTML5 canvas using the same script and the web page does not appear anything (a blank page). Can I import xml into an HTML5 canvas? If Yes, can someone help me with the coding?

    Thank you

    Jody S

    found this on another forum from adobe:

    How can I load external XML content to my HTML5 doc?

  • XML with XSD validation when there is more than one XSD.

    Hello

    I need to validate an XML against a set of xsd.

    I am aware that, when there is a single XSD to compare, it is possible to compare using xmlDoc.schemaValidate () with xmlDoc and xmlSchema.

    But in my case, there is more than one XSD against which I need to compare the XML code.

    My main XSD has the statement as mentioned below.

    " < xs: import namespace = ' http://www.w3.org/1999/xxxx "schemaLocation ="xxxx.xsd"/ > "

    " < xs: import namespace = ' http://www.w3.org/1999/02/yyyy "schemaLocation ="yyyy.xsd"/ > "

    I don't know how to handle this situation.

    Please, help me!

    Thank you

    Vicky

    Hi Vicky,

    This situation is not different, just validate the main schema.

    But, to use the XMLType schemaValidate method, you must save the schema in the database (via the DBMS_XMLSCHEMA API).

    If the main schema contains imports then these referenced schemas must be saved too.

    To sum up: register all 3 patterns in their order of dependency, then you will be able to validate your XML with the main XSD code.

    () dbms_xmlschema.registerSchema

    schemaURL-online , for example 'xxxx.xsd'

    schemaDoc =>

    local-online true

    genTypes-online fake

    genTables-online fake

    enableHierarchy-online dbms_xmlschema. ENABLE_HIERARCHY_NONE

    ) ;

  • Avoid duplicates when you import XMLs?

    There are a few versions, we have fixed the problem to get the duplicate items when you import new projects in another.  This was very helpful.

    However, I have noticed that when you import XMLs, first does not apply the same level of... discretion

    Is it possible to get XMLs for import without creating duplicate items?  I found a workaround by first import the XML file into a new project and then import this project first to my main project... but when I'm in a great documentary film which takes 3-4 minutes to open each time, it's not ideal.

    This is particularly important for people using the Pluraleyes because organize us images in first and then export to the EP, and then must bring with XMLs, and it would be great if we didn't have to do a bunch of media management manual to avoid duplicates in the project file.


    Thank you!

    R

    Hi Ryan,

    Get your feature to the appropriate string request by filling out this form: http://adobe.ly/feature_request

    Thank you

    Kevin

  • Still won't import markers with exit vid first through Media Encoder bluray

    I have a significant video project, just completed, that needs to be taken out DVD and BluRay.  DVDs are made, no problem - three deadlines are each exported queues them in Media Encoder was created. .Xmp sidecar files are produced containing chapter markers and all this matter again without problem, are there chapter markers, DVD burning properly, works on a DVD player, all is good.

    Now for the Blurays... Same process that before, queue the same timelines in Media Encoder, this time only export using the BluRay H264 HD1080i 25, export preset works great, no issues or error messages, but mporting in again (using import as asset, Import Timeline, etc.), I get the error:

    «The metadata. MPEG file parse error» Delete or rename 'E:\YourVid\test.m4v.xmpses' will allow you to import, but markers will be lost. »

    In other words, the markers file is either lack of export crrectly Media Encoder, or the absence of import correctly, or both.

    I've never had this problem before, but this is the first export that I did with the latest versions of first and Media Encoder, IE versions:

    First CC: build a 20141 8.1.0 (81)

    Media Encoder CC: 20141 build 8.1.0.122

    Still, CS6: Version 6.0.2.004

    ... on Win 7 Pro 64-bit

    Can anyone help?  Other people have this problem?  Is this a bug with the latest version of Media Encoder and/or first, or is it just a coincidence and something else is the problem?  And most importantly, is there a reasonable solution (IE other than simply re-do all Chapter markers in Encore?) Can I export first chapter markers in yet another way?

    Help, please!

    As SOUL 8.1.0 submitted bug report.

    Export of H.264 - bluray TEA (and PR 8.1.0) creates a xmpses file that contains an xml error. This translates to an import failed in yet.

    The error is after the marker section in the xmpses file:
    Length > 0

    The tag must be , and the rest of the production which I assume must be in the file is missing.

    One solution is to edit the xml code in the file xmpses. be sure to use Notepad or similar and not words to make changes.

    The affected code is at the end of the file. (It should not be the end, the output to the file is obviously truncated compared to the output of the previous versions.)

    The code ends with this, where, I guess, the number of streamsize is specific for the exported file:

    Length > 0
    94971497

    Remove "length > 0".

    It therefore appears as:

    94971497

    This allows the import still with intact chapter markers.

    I don't know if this will create other problems.

  • Change the 'src' in 'href' attribute, before you import XML

    I need to change the 'src' in 'href' attribute (< img scr = "...) (' >) before importing an XML document. I think that you could do with XSLT, you can add a script to import XML documents. But I don't know much about XSLT...

    Could someone give me an idea?

    Thanks in advance...!

    Piece of cake. This is a transformation of identity, except that it filters the attributes 'src ':

    
    
    
      
        
      
    
    
      
          
       
    
    
    

    See http://stackoverflow.com/questions/2679443/how-do-i-rename-an-attribute-using-xslt

  • Trying to import XML into PDF subform

    I have a very big form where the first page is pre-filled with data in livecycle service, but then users want to import an xml file to populate the data in the rest of the form.  If I use the xfa.host.importData () it is the xml but overwrites all pre-populated data.  If there is a default value that is specified for a field, it it resets the default value.

    Is there a way to control which part of the form is updated by the import?  Or is there a way to protect the pre-filled data so that it is not replaced?  I tried to set readOnly, non-interactive, protected areas, etc., but it seems not to matter.  I also thought trying to dynamically set the defaultValue properties, but this does not seem to be supported.

    I looked the loadXML method as well, but don't know how to implement - or if it's even feasible option with this use case.

    I don't know that it can be accomplished if write us a script to parse the XML manually in each field, but there are several hundred fields so I hope that there is a better way... Any suggestions?

    Thank you!

    I remember a client asks me something like that once but being too busy and give it a low priority, I decided to shelf it.

    Now that I'm not busy, I'm happy I came across your question and took a few hours to concoct it. Here's how the script works:

    (1) the form saves the current xml of the form all data in a global variable

    (2) it then prompts the user for the xml file to import into the form. Replace all data in the form

    (3) form saves the xml data for just the subform to which the newly imported data applies to in another variable

    (4) charging the xml saved from the first variable just before importation took place

    (5) then uses the second variable with the data in the subform and crushes the subform

    The following code is also a few assumptions:

    (1) your form is bound to a schema

    (2) subforms can be used as a parameter to the mergeData function no fields

    (3) the used subform must itself be bound to a data node. Not only the areas that it contains.

    Put this button even your "import":

    //Save the current state of the form in a global Acrobat variable
    global.formXML = sanitizeData(xfa.datasets.data.saveXML('pretty'));
    //Show the import XML dialog
    xfa.host.importData();
    //Removes the xml header
    function sanitizeData(xfaData) {
     xfaData = xfaData.replace(/<\?xml\sversion="1.0"\sencoding="UTF-8"\?>/,"");
        return xfaData;
    }
    

    Because the form asking for a time to merge the data before execution is continued, the following must stay in the case of the form: ready:

    if (typeof(global.formXML)!='undefined')
     mergeData(YourSubformHere);//Enter the SOM expression of the subform you want to import
    function mergeData(oSubform){
     //Save the subforms data
     var subformXML = sanitizeData(xfa.datasets.data.resolveNode(oSubform.dataNode.somExpression).saveXML('pretty'));
     //reload the entire forms data from the xml import in the click event
     xfa.datasets.data.loadXML(global.formXML,1,1);
     //global variable no longer needed
     delete global.formXML;
     //Load the new subform data stored in variable subformXML
     xfa.datasets.data.resolveNode(oSubform.dataNode.somExpression).loadXML(subformXML,1,1);
     xfa.form.remerge();
    }
    //Removes the xml header
    function sanitizeData(xfaData) {
     xfaData = xfaData.replace(/<\?xml\sversion="1.0"\sencoding="UTF-8"\?>/,"");
        return xfaData;
    }
    

    A lot of things to take, but I hope it solves your problem.

    Let me know.

    Kyle

  • documentPreferences of an imported XML

    Hello

    I'm putting my documentPreferences of an imported XML as below and I get - "No data of the requested type" for mytrimh, could you let me know what am I doing wrong please.

    < code > snippet

    function mySnippet() {}

    fragment of <>

    Opens an existing document. You will need to enter your own file path

    var app.open (File("C:/OpenDocument.indd"));) = myDocument

    myDocument.xmlElements.item (0) .importXML (File("C:/adlib.xml"));)

    var myXMLViewPreferences = myDocument.xmlViewPreferences;

    myXMLViewPreferences.showAttributes = true;

    myXMLViewPreferences.showStructure = true;

    myXMLViewPreferences.showTaggedFrames = true;

    myXMLViewPreferences.showTagMarkers = true;

    myXMLViewPreferences.showTextSnippets = true;

    }

    < prefs >

    function myPrefs() {}

    myDoc = app.activeDocument var

    var mytrimh = myDoc.xmlElements.item (0).xmlElements.item (0).xmlElements.item (-9);

    var mytrimw = myDoc.xmlElements.item (0).xmlElements.item (0).xmlElements.item (10);

    myDoc.documentPreferences.pageWidth = "mytrimh";

    myDoc.documentPreferences.pageWidth = "mytrimw";

    Oh, thank you very much for your help. ITI works if it is still an XML element or not, as I have tried

    var mytrimh = myDocument.xmlElements.item (0).xmlElements.item (0).xmlElements.item (9) .xmlContent;

    This changed to text, but all two worked with = Number (mytrimh.contents).

  • File in the import XML dialog box?

    Question fast and easy if all goes well:

    What is the javascript format to select an XML file manually? I know that's not it:

    / * Import XML manually

    myDocument.importXML is File.openDialog ("choose the current XML file");.

    */

    I have my project works well, but I decided to get the user to manually select the XML in case they have uploaded a second version, named (for example) data - 1.xml and not "Data.xml". It is up to them to choose the most up-to-date XML, then we can also name the XML with a datastamp.

    Thanks for this any any other help on this forum - I have pretty little hair out because it is...

    Simon.

    Hi Simon,.

    Can you please try the JS code below and let me know if you have any questions all.

    var myDoc = app.activeDocument;
    var myXMLFile=File.openDialog("Choose the current XML file");
    myDoc.importXML(File(myXMLFile));
    myDoc.xmlElements[0].placeXML(myDoc.pages[0].textFrames[0]);
    

    THX

    csm_phil

  • Import XML removes a space after the xref element

    Hello

    FM10 is not patched, WinXP SP3

    I stumbled on a very serious problem that I am unable to replicate, but not solve. When I import XML (custom), no spaces < xref > following is deleted. I don't know if it's exclusive to elements of reference or any element without content... but for sure, it happens with xrefs.

    Here's a zip with the example files with which I am able to reproduce this. The XML file has two < xref > s, separated by 'and '. When you import the XML (using the DTD, the rules and template provided), the space before the "and" is deleted.

    http://www.weststreetconsulting.com/downloads/test.zip

    I disabled all my personal plugins and all DITA plugins I could find, same thing.

    I don't know if anyone has the time to watch it, but I would be very grateful if someone could confirm the problem. This caused a real mess in my source files I can't correct using nonbreaking spaces, but it's really a pain and very suboptimal.

    Thank you

    Russ

    Hi Russ...

    This is a known issue for the DITA files and can also be the cause of the problem that you see. This has been fixed in the latest patch, as long as you use a client of import and export which was rebuilt with latest libraries FDK. (No doubt if you use the client by default, it should "work" once you install the update.) I posted this to the framemaker-dita some time ago Yahoo Group...

    ----------------------

    If you use a FM10 DITA (with DITA-FMx or not), you may have noticed that after conrefs inline spaces are missing. Apparently the FM10 introduced certain areas of standardization, which was a little too aggressive.

    This can be corrected in a future update, but until you can fix it by doing the following change to the maker.ini file. In the Preferences section, you can change that...

    RemoveExtraWhiteSpacesOnXMLImport = we

    for this...

    RemoveExtraWhiteSpacesOnXMLImport = Off

    And all is right with the world once more.

    ---------------------

    I hope this will fix your problems... but I would install the update anyway, since it solves a number of other bugs.

    See you soon,.

    .. .Scott

  • InDesign, Import XML, switching to and from possible design multi-column?

    I have a question that may or may not require a script solution. I have a data source external generation text referenced XML file that I will not flow into a book. Normally, the book is a two-column layout, but there are illustrations (and sometimes pieces of explanatory text) which should cover both columns. I've built examples of use of reflow smart text for simple and updated column in multi-column page layout. Using one of these with the active smart text reflow works beautifully.

    Ideally, I would like to a XML tag that says "start spanning two columns now", inserts a large illustration (could also be a piece of text however) and another that says "return to normal 2 columns. I did a number of experiments (all unsuccessful) I can't seem to get a working solution. I really like the XML import, but if this is not possible, I'm willing to look at other approaches.

    Has anyone had a similar problem?

    As a gross illustration...

    Lorem ipsum dolor sit amet, adipiscing elit computer.

    CRAs quis ligula EST. SED dictum erat an EST porta in

    dignissim nisl ultrices. In and convallis elit. Curabitur pretium

    < HYPOTHETICAL_SPAN > magna EU ornare, tellus faucibus total, placerat vitae arcu fringilla

    Nulla non sapien ligula. Vestibule vel mauris and pellentesque erat

    Nunc. Vestibule total ac nulla ornare EU ultricies sapien tincidunt < / HYPOTHETICAL_SPAN >

    so. In metus, id erat auctor gravida dignissim

    eget dignissim erat dictum nisl eleifend porta an EST in

    Harold

    Just to be clear, when you say:

    I have a data source external generation text referenced XML file that I will not flow into a book.

    you mean import XML, not the import of text containing the tag of InDesign, correct?

    Ideally, I would like to a XML tag that says "start spanning two columns now", inserts a large illustration (could also be a piece of text however) and another that says "return to normal 2 columns. I did a number of experiments (all unsuccessful) I can't seem to get a working solution. I really like the XML import, but if this is not possible, I'm willing to look at other approaches.

    Can't you just a tag that maps to a paragraph style that allows to span columns?

Maybe you are looking for

  • How "Unforget" a site I accidentally "forgot?"

    I have changed my bookmark names in 'Properties' and I normally 'Right click' on the bookmark and press the "arrow" once to get the properties. But, when you do that on "Personal bar", "Most visited" sites, you select "Forget about this site", that I

  • Oops - remove icons for default applications

    I deleted icons for the default applications on my homescreen. Can open applications using Siri, I would like to get back them on my home screen.  Is this possible? Thanks for any help.

  • How to unlock a site?

    I was on Facebook, trying to remove a photo from my favorite sport teams. I have chosen and right click 'block pictures of static.ak.f... '. "When I did, I could not see pictures of the size of the thumbnails on FB. How to unlock the site? It seems t

  • Can't open the images in Windows Live Photo Gallery

    I had windows live photos with all my photos for some reason, I can't open it and receive an error code. tried HP for help, but they do not solve the problem I open the photo gallery simple but really like the format of the live Photo Gallery windows

  • OfficeJet J3680 how print backup mode?

    Hello I'm having some problems with my printer and the process of solving problems, it's a recommendation that I print from the backup of the mode.  I don't know how someone can give me some instructions on how to do?