Importing XML Tags in a document

Hello,
I've been trying to import XML Tags in a .indd i created, using the Java API but it does not seem to work (the tags content don't update when i export the document as PDF).  I did the same actions in the InDesign CS4 GUI and it worked like it's supposed to.
I ran the InDesign server using that command: InDesignServer -iorfile c:\ior.txt -pluginpath Server\Corba
I included the .indd file, XML tags file and the Java code I wrote.
EDIT:
Also, document.getModified() is FALSE, even after calling document.loadXMLTags(...).
When I exports the tags, all I get is this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Root colorindex="0"><Tag colorindex="35"/></Root>
document.countTextFrames() returns 4, which is what is expected.  However document.countXMLTags() returns 2, i'm guessing it's because all my tags are named <Tag...> (+ the <Root> element).  Could that be the cause of my problems?
any help will be appreciated, thanks

Import XML imports the entire XML file, including the tags and the content, into the document. In the UI, the result would be seen in the Structure View. You can then work with the imported tagged content.
Load XML tags simply loads the tags into the tag list. In the UI, the result would be seen in the tags panel. (This command is also available from the tags panel.) No XML content is imported; only the tag list is populated. This is used when you just want the tags from a document, and you don't want the content. You can then tag new content using the same tags as the XML file.

Similar Messages

  • Can't import xml file: "need translation document/template" - - help please

    Hi there,
    Someone edited a project with fcp 5.1. I have fcp 5.0. I've been asked to tweak the project (for no charge, which is fine with me; it's for a tiny 3rd-world charity organization).
    He sent me the project files as xml documents... but when I double click on them I get a window saying they "need translation document file", or translation template. Nothing in my fcp folder or app seems to do the trick.
    Can someone please advise me on this?
    I did a search before posting, and noticed that someone advised someone else that xml version 2 is the better xml file to work with. I don't know whether the xml files this guy sent me are v. 1 or 2.
    Any help would be very much appreciated!
    Malcolm

    Thank you Studio X. I've just sent off the request. I'll let you know if it works.
    IF it doesn't work... should I upgrade to FCStudio2, do you think? I didn't want to have to do that (I'm not being paid for this work, so I don't really want to go out of pocket), but if this XML2 thing doesnt' work, I'm not going to be able to do this project at all, it would seem. Which I would feel badly about.
    The other thing is, I've been sort of thinking that some day I'm going to have to get FCStudio2, so maybe I should just push that day up a bit.
    It would really bother me, though, if I go to the expense of getting FCStudio2, and then I still can't open these files.
    Cheers,
    Malcolm

  • Importing XML - white spaces before tags

    Hello,
    I'm importing XML into an inDesign document. Everything imports fine but I get extra spaces whenever there is a paragraph return. How could I get rid of those extra white spaces? I don't want to go and edit out all those white spaces by hand....
    Thanks for your help.

    Hello,
    Your issue looks like the one described in this page:
    http://www.xmlplease.com/normalized
    For reference purposes, here is the link for the supported schema and wsdl in PI 7.1
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00a9a425-1769-2a10-9196-bd8eeed72e4c
    As a temporary work around, you can try editing the xsd by removing the spaces before importing it into PI.
    Hope this helps,
    Mark

  • Attaching XML tags to paragraphs (CS2/VB)

    Hi everybody,
    I need to build an Indesign document from several Word documents, attach XML tags to those document parts and also to retain Word's paragraph styles.
    I use temporary textframes and copy & paste to put the Word stuff together into one large textframe. Works fine so far. Paragraph styles remain intact:
    InDesign.XMLElement xch = root.XMLElements.Add("XML_" + Convert.ToString(cnt), "");
    InDesign.InsertionPoint ip = (InDesign.InsertionPoint)txt.InsertionPoints.LastItem();
    ip.Select(InDesign.idSelectionOptions.idReplaceWith);
    id4.app.Paste();
    But as soon as I call Markup() to add the XML tag to this part of the document, all paragraph style information gets lost:
    ip.Markup(xch);
    This is most certainly some kind of RTFM error, but since there's no really detailed documentation for scripting (at least I couldn't find one yet - hints are welcome), I'm stuck.
    Thanks a lot.
    Hans

    Hi Hans,
    The InDesign CS2 Scripting Guide and Scripting Reference PDFs are on your InDesign CS2 installation CDs.
    Many things in scripting did not change between CS2 and CS3--and there are more XML examples in the CS3 version of the Guide (though you should note that CS2 does not have the XML rules feature at all). You can find the InDesign CS3 Scripting Guide: VBScript at:
    http://www.adobe.com/products/indesign/xml_scripting.html
    (you'll need to click the Scripting Resources tab to get to the relevant page)
    The Markup.vbs example script (a fragment is shown on page 119 of the Guide; you can find the full script in the associated Zip archive of scripts) shows you the general approach to marking up page items or text. The basic form is:
    Rem Where "myXMLElement" is a reference to an XML element
    Rem and "myText" is a reference to a text object...
    myXMLElement.markup myText
    Here's a more complete script (VBScript form):
    Rem MarkupText.vbs
    Rem An InDesign CS2/CS3 VBScript
    Rem
    main
    Function main()
    Rem Use "InDesign.Application.CS2" to target CS2
    Set myInDesign = CreateObject("InDesign.Application.CS3")
    mySetup myInDesign
    mySnippet myInDesign
    End Function
    Rem mySetup function creates an example document.
    Function mySetup(myInDesign)
    Set myDocument = myInDesign.Documents.Add
    Rem Create some paragraph styles.
    Set myBodyText = myDocument.ParagraphStyles.Add
    myBodyText.Name = "BodyText"
    Set myHeading = myDocument.ParagraphStyles.Add
    myHeading.Name = "Heading"
    myHeading.PointSize = 24
    Rem Add XML elements
    Set myRootXMLElement = myDocument.XMLElements.Item(1)
    Set myXMLTag = myDocument.XMLTags.Add("xml_element")
    Set myXMLElementA = myRootXMLElement.XMLElements.Add(myXMLTag)
    Rem Create a text frame
    Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
    myTextFrame.GeometricBounds = myGetBounds(myDocument,myDocument.Pages.Item(1))
    myString = "This is the first paragraph in a text frame." & vbCr
    myString = myString & "This is the second paragraph in a text frame." & vbCr
      myString = myString & "This is the third paragraph in a text frame." & vbCr
      myString = myString & "This is the fourth paragraph in a text frame." & vbCr
    myTextFrame.Contents = myString
    Rem Use ApplyParagraphStyle in CS3.
    myTextFrame.Texts.Item(1).ApplyStyle myBodyText
    myTextFrame.Paragraphs.Item(1).ApplyStyle myHeading
    End Function
    Rem mySnippet shows how to use the XMLElement.Markup method.
    Function mySnippet(myInDesign)
    Set myDocument = myInDesign.Documents.Item(1)
    Rem Have to associate the Root XML element with the story
    Rem before associating child elements.
    myDocument.XMLElements.Item(1).Markup myDocument.Pages.Item(1).TextFrames.Item(1)
    Rem Now we can associate XML elements with individual paragraphs.
    Set myXMLElement = myDocument.XMLElements.Item(1).XMLElements.Item(1)
    Set myText = myDocument.Pages.Item(1).TextFrames.Item(1).Paragraphs.Item(1)
    myXMLElement.Markup myText
    End Function
    Rem Utility function for getting the bounds of the "live" area
    Rem (the area inside the page margins) of a page.
    Function myGetBounds(myDocument, myPage)
    myPageWidth = myDocument.DocumentPreferences.PageWidth
    myPageHeight = myDocument.DocumentPreferences.PageHeight
    Rem Page.Side is a CS3 property. In CS2, use:
    Rem If myPage.DocumentOffset Mod 2 = 0 Then
    If myPage.Side = idPageSideOptions.idLeftHand Then
      myX2 = myPage.MarginPreferences.Left
      myX1 = myPage.MarginPreferences.Right
    Else
      myX1 = myPage.MarginPreferences.Left
      myX2 = myPage.MarginPreferences.Right
    End If
    myY1 = myPage.MarginPreferences.Top
    myX2 = myPageWidth - myX2
    myY2 = myPageHeight - myPage.MarginPreferences.Bottom
    myGetBounds = Array(myY1, myX1, myY2, myX2)
    End Function
    As to style information getting lost--it probably has to do with your Tag to Style/Style to Tag mapping. The above script demonstrates that it is possible to mark up text without losing the style.
    You might also consider using tag to style or style to tag mapping after pasting the text from Word.
    Hope this helps!
    Thanks,
    Ole

  • Xml attributes - importing and displaying in InDesign document to print

    Hello! I am importing XML into InDesign. I need to display the metadata within the attributes in the document that will be printed . For example, if I'm creating a lesson plan and the "Toady's Lesson" tag has the attributes of: "lesson 2", "Day 2", "Read pages 3-5". I want those attributes to display under "Today's Lesson."  Is it possible to this with InDesign? I did not write this code so there's nothing I can do on that end, I have to work with what was given to me. I've been looking into this for a couple of days and can't find anything on this topic. I would greatly appreciate your help with this!
    thanks!!

    Hi
    You are right each cell nee to be tagged in XML tables, if you are working with more than hundreds/thousands of cells, be careful in content tagging. adding/removing columns/rows would really affect the structure of the XML and if it need to extract/export the content the structure of XML will not be correct. It is better to avoid XML tables in case of adding/removing columns/rows.

  • How to import a XML file into the document?

    Hai,
    i had created a table using xml file....
    Now i want to import that xml file tabel into the document...
    Can any one tell me how to import the xml file into the document?
    thanks
    senthil

    Hai...
    this is senthil...
    i'm beginner for creating adobe indesign plugins..
    i want to import a html file in the document...
    i want to create a table by using html tags and
    that table will be imported into the document..
    How shall i do it?
    can any one plzz explain me?

  • I am not getting required output after importing xml file having HTML tags, MathML and Latex code

    I created well formatted xml having html tags, MathML code and Latex code inside
    XML with sample latex
    <question>
        <p> 8. In this problem, <Image  style="vertical-align: -9pt" title="5a\frac{7b}{3}" alt="5a\frac{7b}{3}" href="http://www.snapwiz.com/cgi-bin/mathtex.cgi?%205a%5Cfrac%7B7b%7D%7B3%7D%0A"></Image> and <Image href="http://www.snapwiz.com/cgi-bin/mathtex.cgi?%207b%5Cfrac%7B5a%7D%7B3%7D" style="vertical-align: -9pt" title="7b\frac{5a}{3}" alt="7b\frac{5a}{3}"> </Image>are both mixed numbers, like <Image src="http://www.snapwiz.com/cgi-bin/mathtex.cgi?%203%20%5Cfrac%7B1%7D%7B2%7D%20=%203.5" style="vertical-align: -9pt" title="3 \frac{1}{2} = 3.5" alt="3 \frac{1}{2} = 3.5"></Image>. The expression <Image style="vertical-align: -9pt" title="5a \frac{7b}{3} \ \times 7b \frac{5a}{3}" alt="5a \frac{7b}{3} \ \times 7b \frac{5a}{3}" href="http://www.snapwiz.com/cgi-bin/mathtex.cgi?%205a%20%5Cfrac%7B7b%7D%7B3%7D%20%5C%20%5Ctimes %207b%20%5Cfrac%7B5a%7D%7B3%7D"> </Image>is equal to which of the following choices? </p>
    </question>
    XML with sample html tags
    <p>4. Examine the expression 3<i>k</i><sup>2</sup> + 6<i>k</i> - 5 + 6<i>k</i><sup>2</sup> + 2.</p><p>When it is simplified, which of the following is the equivalent expression?</p>
    XML with sample MathML tags
    <p>5. Find the vertex of the parabola associated with the quadratic function <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>y</mi><mo> </mo><mo>=</mo><mo> </mo><mo>-</mo><msup><mi>x</mi><mn>2</mn></msup><mo> </mo><mo>+</mo><mo> </mo><mn>10</mn><mi>x</mi><mo> </mo><mo>+</mo><mo> </mo><mn>4</mn></math></p>
        <math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced><mrow><mo>-</mo><mn>5</mn><mo>,</mo><mo> </mo><mn>69</mn></mrow></mfenced></math><br>
        <math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced><mrow><mn>5</mn><mo>,</mo><mo> </mo><mn>29</mn></mrow></mfenced></math><br>
        <math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced><mrow><mn>5</mn><mo>,</mo><mo> </mo><mn>69</mn></mrow></mfenced></math><br>
        <math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced><mrow><mo>-</mo><mn>5</mn><mo>,</mo><mo> </mo><mn>29</mn></mrow></mfenced></math>
    None of the above works fine after importing xml to Indesign document/templete, it is not renderting equivalent out instead it is showing the same text inside tags in the Indesign document.
    I have lot of content in our database, I will export to XML, import to Indesign, Indesign should render required output like what we see in the browser and export the output to printed format.
    Import formated XML to indesign --> Export to Quality Print Format
    Can any one guide me and let me know whether it is posible to do with Indesign, if so let me know in case if I am missing anything in importing xml and get required output.
    Thanks in advance. Waiting for reply ASAP.

    Possibly your expectations are too high. ... Scratch that "possibly".
    XML, in general, cannot be "rendered". It's just an abstract data format. Compare it to common markup such as *asterisks* to indicate emphasized words -- e-mail clients will show this text in bold, but InDesign, and the vast majority of other software, does not.
    To "render" XML, HTML, MathML, or LaTeX -- you seem to freely mix these *very* different markup formats, unaware of the fact that they are vastly different from each other! -- in the format you "expect", you need to apply the appropriate software to each of  the original data files. None of these markup languages are supported natively by InDesign.

  • a tag is creating error in import XML in InDesign CS5.5

    Hi All,
    I am doing upgrade from InDesign CS2 to InDesign CS5.5.
    I have indt file. It has been designed using the CS2 and now converted that indt file into CS5.5 using InDesign CS5.5.
    But I am facing some serious issue while doing export to pdf in CS5.5 version.
    I am following below steps:
    1) Open indt file.
    2) File Menu --> Import XML... [This XML file contains <a href="website link"> html tag]
    3) XML Import Options [no change- defalut options selected]
    4) Ideally it should merge this XML data with the indt file but it is asking me for some input and showing me "Find:" dialog [Check below snapshot]
    I did some research and find out that I am getting this Find dialog because of the <a> tag in XML. when I removed the <a> tag from XML then it didn't give any dialog box and imported XML without any issue.
    I am getting that xml from system and I cant remove the <a> tag from xml manually.
    However I was not getting any error while doing import XML in CS2 version.
    Please can anybody help in this?

    When there is "http://" in anchor tag it will pop up this input window in manual export from indd/indt to pdf and it will failed in export through action script.
    I communicated with the Adobe and it was bug. Adobe has confirmed that they would realease the patch for same sometime later, but I have not heard of anything. I got work around by removing it "http://" using java.

  • Report for editing the word document with xml tags

    Hi all,
    My requirement is to edit the contents of the word document in the presentation server through report programming and save that document  in the presentation server.
    For eg if my word document contains many xml  tags with spaces < EDI_DS40 >, i would like to remove the spaces and i want it to be lyk <EDI_DS40>.Then say if i wanted to make some modification (addition, deletion,replacing with some text) in the text in some nth line of the document how can dis be dione.
    Is there any function module or bapi which serves this purpose.
    Can anyone pls guide me on dis.
    Thanks & Regards,
    Revathi.

    Hi,
    just to let you know I have sorted this.
    http://macintoshhowto.com/leopard/how-to-merge-pdf-files-with-preview-in-leopard .html
    Thanks.

  • Document contains too many nodes error when extracting xml tag name

    I Have a large xml file in which the tag contains ~: as the value.
    Now I am trying to extract all the tags which have ~: as the value and store that column using the following query and insert into a table.
    insert into space_md select distinct xmltype(extract(value(x), '/').getstringval()).getrootelement() COLUMN_NAME
    from gt_xmltype_tab gt, TABLE(XMLSequence(extract(gt.xmlfile1, '/ROWSET/ROW/*'))) x
    where instr(extract(value(x),'/').getstringval(),'~:') > 1;
    The xml file was generated using dbms_xmlgen.getxml. Table has 48 columns and around 4000 rows.
    My above insert query gave me an error of 31186 too many nodes error.
    I am using oracle version 10.2.0.3.
    Following are the set of commands I ran....
    SQL> insert into gt_xmltype_tab(xmlfile1)
    values(XMLType(bfilename('BKUP_RES','QC.xml'),nls_charset_id('AL32UTF8'))); 2
    1 row created.
    SQL> SQL>
    SQL> insert into restore_space_metadata select distinct 'QC', xmltype(extract(value(x), '/').getstringval()).getrootelement() COLUMN_NAME
    2 from gt_xmltype_tab gt, TABLE(XMLSequence(extract(gt.xmlfile1, '/ROWSET/ROW/*'))) x
    3 where instr(extract(value(x),'/').getstringval(),'~:') > 1;
    insert into restore_space_metadata select distinct 'QC', xmltype(extract(value(x), '/').getstringval()).getrootelement() COLUMN_NAME
    ERROR at line 1:
    ORA-31186: Document contains too many nodes
    Is there a better way of extracting the xml tag element name based on the xmltag content?
    There is one other table which has 172 columns but only 100 rows so it doesnt create any problem on that table.
    But this QC table has less columns but many many rows...
    Any suggestions

    There is a requiremnent of taking centain type of data backup and restore it.
    It was implemented on flat file approach which was giving errors.
    So it was implemented using XML approach.
    Read data, store in xml file and read from xml file and load it into table.
    Further, found that dbms_xmlstore is not able to handle tag only with whitespace
    and tried to use the loading xml file into xmltype table column and extract data.
    XMLTYPE column also has same problem of ignoring whitespace when used with extractvalue functions.
    So for the workaround I update xmlfile having only one more more whitespace in the tag to have ~: character once.
    After restoring data from xml to table I would run update qeury to update ~: to " ".
    Now instead of running blind update for all the tables and all the columns from ~: to " " I thouhgt whyy not create a xml file of tag having ~:
    along with its tablename.
    and thats where I found the problem of too many nodes...
    THe insert query you saw is populating table for table_name and column_name with tag having only ~: in it.
    I hope this gives you the fair idea of stuff I am doing.

  • DataWriter - removing attributes from xml tag at the start of document

    Hi,
    I'm using DataWriter for generating a large XML document, however I do not want the attributees of the starting xml tag to appear in the final file.
    Eg: <?xml version="1.0" {color:#ff0000}encoding="UTF-8" standalone="yes"{color}?>I do not want to output the part highlighted in red.
    What could be the possible ways to do it? I prefer if it can be removed in the begining itself instead of parsing the document and removing in the end.
    -TIA, saum
    Edited by: nkrust on Feb 15, 2010 4:29 PM

    try {
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();
                        Marshaller marshaller = new Marshaller(new OutputStreamWriter(
                                  baos));
                        marshaller.marshal(ResponseContents);
                        // Create an object of type Document from the XML document
                        // created.
                        DocumentBuilderFactory domFactory = DocumentBuilderFactory
                                  .newInstance();
                        domFactory.setNamespaceAware(false);
                        DocumentBuilder builder = domFactory.newDocumentBuilder();
                        responseDoc = builder.parse(new ByteArrayInputStream(
                                  ResponseUtils.formatXMLString(baos.toString())));
                   } catch (IOException e) {
                        e.printStackTrace();
                        System.out.println(e.getMessage());
                   }

  • Build XML Document in Servlet use JSTL xml tags in JSP

    Is it possible to build an XML document either org.w3c.dom.Document or preferably org.jdom.Document in a Servlet and pass it as a Bean or Bean property to a JSP and use it in the JSTL xml tags? If so how is it done? I don't want to write the document out to a file.
    Thanks
    Mark

    Both DOM and JDOM allow you to serialize XML to an output stream. Use the StringWriter as the output stream and when its finished you will have the XML in a String. Put the String in the Request scope and your JSP should be able to see it.

  • How to import images with path embedded in XML tag

    I have a website that has blogs with embedded images. I need to design an XML that can be imported in Indesign. I am able to import XML and lay it out in Indesign if I have only text. But I am not able to include or show the intermittent, embedded images in Indesign. Can this be done? -Thanks

    I can drag an image from, for example, the desktop, but if I delete that file on the desktop I won't be able to open that image in iPhoto, even if I've imported it
    That's an indication that you may have your library set up as a referenced library:
    Check the Advanced preferences in iPhoto to see if that checkbox is selected or not.  If it isn't checkec, check it and try importing agan. 
    To make sure all Photo Stream photos are automatically imported into your library set up iPhoto's PS preferences like this:
    You should read this User Tip by Terence Devlin which is the best treatise on how to access photos (for use outside of iPhoto):  How to Access Files in iPhoto
    OT

  • Generating target XML tag from a value in the Source XML document

    Hi there,
    I have a scenario where the following transformation needs to occur:
    Source Message...
    <Catalogue>
      <key>abc<\key>
      <value>123<\value>
      <key>def<\key>
      <value>456<\value>
    <\Catalogue>
    Target Message...
    <Catalogue>
      <abc>123<\abc>  --> Value of KEY becomes the XML tag and the VALUE gets assigned to it
      <def>456<\abc>
    <\Catalogue>
    The target message is written to an xml file using the receiver file adapter.
    I would like the target message generation to be dynamic so that when a new key-value pair is added, it would not require a change in the XI mapping layer.  Is there a way to accomplish this without having to code or enhance the adapter.  I am trying to avoid doing this in the mapping because that would mean changing the mapping every time a new key-value pair needs to be added.
    Any suggestions to accomplish this are welcome.
    Thanks all.

    Hi,
    I doubt if it will work for you. you can generate dynamic values using this but not tags dynamically. You need to see if there are any methods to generate tags dynamically.
    One way of doing this is by using Java Mapping and playing around with InputStream and OutputStream.It will work for sure with this.
    Thanks
    Amit

  • Applescript - Untag all XML tags after importing.

    Have the following which works to untag 1 xml tag at a time but we'd like to untag everything if possible.  We could loop through if needed but don't know how to get total number of elements so we know how many times to loop.  We currently just put value greater than will ever be with try so it works but wondering if there is an easier way?    Is there a tell every or something like that?   Thanks, Joe
    set myXMLElement to XML element 1 of XML element 1 of myDocument
    tell myXMLElement to untag

    Found something that should work.
    untag (every XML element of XML element 1 if myDocument)

Maybe you are looking for

  • My Macbook Pro now 10GB RAM is this Flex mode?

    Hey everyone, I just upgrade my Macbook Pro Ram. So the default is 2GB + 2GB = 4GB RAM now I took one 2GB stick out and install 8GB RAM in the slot. Now my MAC is 10GB RAM. It run so smooth, but I don't know if this Dual Channel, Single Channel or Fl

  • Datasocket and FP2000

    Hi, I'm develpoing a RT acquisition/control system using FP2000. On FP 2000 I've wrote two main VI: - TC.vi: time critical VI for acquisition and control of my system - NP.vi: normal priority VI for data exchange with a host PC. Host and FP comunicat

  • Iam getting a new phone

    And right now am on my moms iTunes account and when I get the new phone I will be making a new iTunes account. But I do not want to make a new Game Center because I have been playing games for a couple years now and dont really wanna start from new o

  • How do I get my playlist from my computer to my iPhone, it doesn't move over when I sync.

    How do I get my playlist from my computer to my IPhone? Syncing doesn't seem to do it?

  • Volume creeps up gradually to the max for no apparent rea

    Help. I have a Dell Dimension 8400 PC with Soundblaster Audigy. After 3 years with no problems, a few days ago for no apparent reason, the volume started creeping up on its own slowly over a few minutes (about 0 minutes) to maximum volume. Can someon