14 Replies Latest reply on Jul 29, 2013 8:03 PM by bobhopfner

    Static text not cloning on XML import = fail


      I cannot get my static text to clone when I import my XML. I can make it work on a small test like this:

      City: Madison


      So I can get the labels to clone when the XML comes in and I am reasonably sure that my import settings are correct (merge, only match structure, no white space)


      In my real-world project, there are more elements, nesting, and some static text that is in-line like these labels.

      My XML elements actually come in OK and I can clean them up, but my static text is ALWAYS removed. The static items include a pipe between elements, commas after street, city, and inline labels.


      I'm going to try to put in some screen shots that show the placeholder version and what happens after import.


      placeholder with static.jpg


      flowed in and no static results.jpg


      If I can't get the static text to clone, I'm going to have to do a million GREP changes to put the static stuff in, and would have to reproduce that every time they send updated data. Boooo!  please help!

        • 1. Re: Static text not cloning on XML import = fail
          MW Design Level 5

          From the screen shots, it is difficult for me to see what is going wrong from you. If at all possible, it would be helpful to see the sample file you are using (both the ID and sample XML).



          • 2. Re: Static text not cloning on XML import = fail
            bracewell4213 Level 1

            When I click on the screen shots, they do get larger, but it's not ideal.

            Since I can't attach them, I'll try my public Dropbox folder.


            It may be annoying that you're missing the fonts.


            I made a little progress using an odd technique. I tagged the three locations of the "pipe" character | which I'm using as a divider. Those tags don't appear in the XML data, and when I import, for some reason the pipes are left alone, which is a major victory after hours of work, though I don't know why it occurs.


            However that exact same technique does not work for the two text headers "Special Releases" and "Real Ale Tent" They stay in place but they lose their styling and they lose their hard return. I've tried every way to make a hard return. Ironically, I get extra hard returns I don't want after the first three paragraphs, and no manner of Story Editor helps me delete them.


            This is so opaque what's actually going on during this parsing of XML!


            Thanks for any tips.

            • 3. Re: Static text not cloning on XML import = fail
              MW Design Level 5

              Yeah, the screen shots get larger--but they don't show anything wrong. So the sample is appreciated. I got it downloaded and will take a good look at it tomorrow afternoon. Just now looking at it, I don't see why it isn't cloning the pipe symbols, etc.


              I have a golf tournament early in the morning and so am headed off to sleep. I'll probably take a quick look with my morning coffee but if it isn't something really simple it will be sometime after I get back.



              • 4. Re: Static text not cloning on XML import = fail

                i have issue the same, please help me this case. Thanks

                • 5. Re: Static text not cloning on XML import = fail
                  bracewell4213 Level 1

                  Note that the samples are from a few hours later as I realized that if I cannot put the static text in ID for cloning, I'll have to put it into the XML using search/replace. So along that strategy, I added <pipe1> | </pipe1> to the XML and tagged the pipe in the placeholder text.


                  After playing with this and the other pipes, I realized that I don't have to tag the pipes in ID but it does help me style the character, so I left the tags in.


                  I took the pipes out of the XML data, and that's when I realized that tagged text that didn't match any incoming XML data got left alone. I thought YAY, this is how I will have my pipes!


                  I was so excited, but it refuses to work for the two subheads. I've tagged them, I've added a spacebar after them that's also tagged, and nothing seems to work, the resulting flowed text is always the subhead text run-in with the paragraphs that follow.


                  The CRITICAL static text is the labels inside the beer descriptions (OG, IBU, ABV, SRM) because they are inline and a lot harder to just add manually than pipes.


                  OK blah blah blah. If i can't figure this by Monday morning, I'm off to huge GREP search and replace crap, which kinda defeats the whole linked XML thing.



                  • 6. Re: Static text not cloning on XML import = fail
                    bobhopfner Level 1

                    Did you map your paragraph styles to the tags? That way they should format better. What I don't understand from your files is why the pipes and such disappear from your xml which is before that data ever gets to InDesign.


                    Perhaps your workflow is something like this:


                    Design document and create tags and pstyles

                    Assign tags to text and assign paragraph styles to tags.

                    Export the xml "template"

                    Modify the XML template

                    Import modified XML

                    Enjoy new text/images in your document.


                    I think something is wrong during the "modify the xml template" stage. Also,  you can add pstyle and cstyle tags to your text as attributes in the XML. Unfortunately there is no easy way to do that and I don't believe the attributes are created upon XML export, which you would hope for in CS6 or CC.




                    • 7. Re: Static text not cloning on XML import = fail
                      MW Design Level 5

                      Sorry for the delay in getting back to this.


                      There are a few issues in the XML for fitting your precise layout unless you add certain things manually or by search/replace. And that is what I would do to the XML in a text editor like NotePad++ (or, UltraEdit). Either could likely put in the seperators in a large text file by just a few S/R operations.


                      I can get part way there but it is a not quite thing. I ended up redoing parts of the XML and redoing the tagging. But the merge still fails in various places.


                      fwiw, QXP does this pretty quickly. There is a long-standing gotcha in that the frames are not threaded once the merge is done, but it simply works. I do most XML in Q.


                      I hate being beaten by an application so I will probably futz around on this--though I suspect that doesn't do you any good this iteration.


                      Courtesy of QXP:




                      • 8. Re: Static text not cloning on XML import = fail
                        bobhopfner Level 1

                        I just tried a quick test with my exported XML and I lost none of the static text. Pipes, etc. all there, so the workflow in my previous post seems to be valid. I am working in CS4 right now but I can test this in CS6 tomorrow just to see if there is any difference.




                        • 9. Re: Static text not cloning on XML import = fail
                          MW Design Level 5

                          Please feel free to upload a ZIP of the before and after. I suspect the OP would appreciate it and I certainly would.


                          Might just make it so I don't reinstall earlier versions--simply because then CS6 would have to be fully uninstalled, then the previous, then...it's a PITA.


                          Thanks, Mike

                          • 10. Re: Static text not cloning on XML import = fail
                            bobhopfner Level 1

                            Will do Mike, I want to test it CS6 before I get too far ahead of myself. I am pretty sure no one wants to make CS4 part of their workflow any more.




                            • 11. Re: Static text not cloning on XML import = fail
                              bracewell4213 Level 1

                              Well, it's working now and I don't know why. I cannot isolate what made the earlier versions fail and the recent ones work.


                              My "Almost There" files are shared here:




                              The database programmers are still fixing some things.


                              I think this is the best I can get without writing an XSLT to remove the empty data labels (specifically in the beer description, but also when address or contact info is missing).


                              I'm really frustrated that I don't know why it started working. When I can, I'll go back and find the files that weren't working and post them.


                              Thanks everyone for your help. Grateful but still a bit clueless!


                              • 12. Re: Static text not cloning on XML import = fail
                                bobhopfner Level 1

                                I exported the XML from the file in CS6, opened that XML in Notepad to edit. Saved and imported into InDesign. Everything came through perfectly as far as the text goes, including all the static text. I lost the Header treatment despite the paragraph style. I mapped "entry" to the specialHeader pstyle and it retained the correct formatting.


                                I remember mapping can be a pain but if you name the tags and the pstyles the same "map by name" will save you some time.


                                I tried using the attributes to include the paragraph styles but I can't seem to get that part to work. aid:pstyle="specialHeader" is giving me an UnBound namespace prefix error. I added in the Adobe names space and now it says something is not well formed. Not sure where to go from here:


                                <?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/”><flow><entry aid5:pstyle="specialsHeader">





                                • 13. Re: Static text not cloning on XML import = fail
                                  bracewell4213 Level 1

                                  I understand map by name, and that's helpful to a point, but I don't need a char style for every element because a lot of elements that are in-line are all under the same paragraph style, and map by name doesn't know that, so one ends up having to map a lot of things manually to the main paragraph style.


                                  I did all the mapping, but I didn't think I needed to map the XML tag "specialsHeader" because I stopped using it, that is untagged static text so nothing should come in with that tag. I tried tagging it, but then I could not check the setting "Delete unused" or whatever it's called.


                                  The InDesign import settings are pretty broad and capture a lot of different things. Removing white space should not be lumped with importing empty data fields, and I'd like to be able to tag text as the label for a field, such that if the field is empty of data, the label is not displayed.


                                  I know, that's all for XSLT, but that's another external file to manage.


                                  I eventually got pretty close, though I don't know what i did. Everyone says to export your own XML from InDesign and then reimport it as a test. That's fine, but really the XML is coming from a third party, so I can test all I want with my own stuff, but it's really whether it works with sample XML from the database guys.


                                  Thanks for banging on this. It still seems murky and vague to me, those settings, and what's tagged an untagged. I mean, commas betwee address fields may be "untagged" as elements, but they are still in the XML group for the address or contact, that's necessary for cloning. So the notion of being "untagged" is kind of fuzzy. Everything is tagged if it's in a parent like Story or Root, it seems to me.

                                  • 14. Re: Static text not cloning on XML import = fail
                                    bobhopfner Level 1

                                    Yes, mapping by name is only a starting point, it won't get you all the way. Actually it would be so much better if the XML import treated the data as just plain text and adopted the Pstyle of the text it was replacing. SO much more convenient. Also true that nothing is untagged as you must tag the text frame as well as any sub-objects of text. The good news is THAT tag, "Entry" in your case can be mapped to the "specialsHeader" and you can remove the XML tag specialsHeader because you don't need it any more.


                                    When I say "export your XML from InDesign" I say that meaning "give it to your developers", let them know what it is they are searching for and replacing in that file - and nothing else. I feel that is the safest route to identical static text and less errors. I think whatever your database guys are creating is wrong and I think rendering them some "clean" xml will save both of you a lot of time.


                                    They could then also concatenate the data headers with the data and give you a mechanism by which to remove empty data fields. This is a good project and I hope everything gets ironed out for you soon.