Textframe Associated with Root element

Hi,
I want to add a Processing Instructions before the first character of any TextFrame. (This is pure xml workflow)
InterfacePtr<IIDXMLElement>  root_elt (Utils<IXMLUtils>()->QueryRootElement(doc));
From this 'root_elt' how can i find the Associated TextFrame?. I have planned to go iteratively using TextFrame threads.
Thanks in advance.
Saravanan.K

The root element of an InDesign document can't be associated with a text box. It represents the entire document, any story you tag will be a child of this element. Take a look at IXMLHandler. The other option you have it to post process the XML document after the InDesign export finishes, i.e re-parsing / re-writting it. 

Similar Messages

  • Finding the View associated with an Element

    Hi,
    Is there any way to find the javax.swing.text.View associated with an Element without iterating over every view and seeing if ( view.getElement() == element )?
    Thanks,
    Chris

    Don't know if this will help but you can use:
    TextUI ui = textComponent.getUI();
    View root = ui.getRootView( textComponent );
    View child = root.getView(???);
    So if you are iterating through each Element then I am guessing that child index of your Element would be the same index for the View.

  • COM: This key is already associated with an element of this collection

    Hello,
    Our system has been upgraded from CRM4.0 to CRM2007 and i have managed the collisions successfully.
    I already have fixed several errors (sometime with the help of this forum...), but i still have the following error which require adjustments.
    I've got this message after the generation of one of my tiles :
    "Generating UITile docactdocu2
    Error: Processing failed: COM: This key is already associated with an element of this collection"
    I found the note from microsoft but i am not sure to understand well :http://msdn.microsoft.com/en-us/library/aa232626(VS.60).aspx
    I do not have any add method in that code. This tile is linked to several other one. Can this error located into an other tile ?
    e, i have to keep the assigment for the Z segment.

    Hi,
    fyi: There are also other SAP owned prefixes e.g. TSR_ for specific enhancements for Mobile Service. So you don't need to care about that objects.
    Also you might notice that some of these event handler "twins" are commented out because the other is still active. And for those where both have a coding it is the same (like "Gate = 1") which doesn't make any problem.
    Probably the other SAP colleagues working for MSA development can explain more in detail but I guess that the red marked event handlers are fired by system events (like load/beforesave) where the user doesn't have any influence.
    The black ones are fired directly after an user action, like "button_onclicked" or "anchoronupdate".
    Regarding your issue you should open the tile in design mode and then open the list next to "custom popups". I guess there are some duplicates which you surely can delete.
    Regards,
    Wolfhard

  • Status associated with WBS element

    Hi,
    How can we get status associated with WBS element.
    thanks

    Hi,
    Couldn't find function module to get status associated with WBS element. I want the status description i.e if we run transaction code CN43.  the status column value 'TECO' then what's the description

  • Error - The key is already associated with an element of this collection

    Hi,
    After a fresh installation of BPC 5.1 SP3 in a dual-server environment we're getting an SAP error - "The key is already associated with an element of this collection"  after logging into BPC for Excel.
    Has anyone seen this error before or know what is causing it?
    Thanks,
    Glenn Van Der Werff

    We're using SQL Server 2005 Enterprise Edition with Service Pack 2.  We ended up doing the installation on a single server instead of a dual server environment.  The error is no longer happening in the single server environment.
    I'm still curious as to why we were getting the error in the dual server environment if you're seen this before.
    Thanks,
    Glenn

  • Intresting problem with JDOM and xmlns in root element.

    Hi all,
    I am trying to parse a xml file using a jdom java code.This code works fine if I remove xmlns attribute in the root element.Please tell me how to fix this issue.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Xml
    <process name="CreateKBEntryService" targetNamespace="http://serena.com/CreateKBEntryService" suppressJoinFailure="yes" xmlns:tns="http://serena.com/CreateKBEntryService" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:nsxml0="http://localhost:8080/axis/services/CreateKBEntryService" xmlns:nsxml1="http://DefaultNamespace" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    <partnerLinks>
              <partnerLink name="client" partnerLinkType="tns:CreateKBEntryService" myRole="CreateKBEntryServiceProvider"/>
              <partnerLink name="CreateKBEntryPartnerLink" partnerLinkType="nsxml0:CreateKBEntryLink" partnerRole="CreateKBEntryProvider"/>
         </partnerLinks>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
    Java:
    import java.io.*;
    import java.util.*;
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.input.SAXBuilder;
    public class sample1 {
    public static void main(String[] args) throws Exception {
    // create a XML parser and read the XML file
    SAXBuilder oBuilder = new SAXBuilder();
    Document oDoc = oBuilder.build(new File("file location "));
         Element root = oDoc.getRootElement();
         System.out.println(root.getName());
         String tgtns= root.getAttributeValue("targetNamespace");
         System.out.println("tgt ns "+ tgtns);
    List list= root.getChildren("partnerLinks");
         Iterator it1= list.iterator();
         System.out.println(list.size());
         while(it1.hasNext()){
              Element partnerlinks = (Element)it1.next();
              List list2= partnerlinks.getChildren("partnerLink");
              System.out.println(list2.size());
              Iterator it2= list2.iterator();
              String[][] partnerLinkval = new String [2][list2.size()];
              int i=0,j=0;
              while(it2.hasNext())
                   Element el2= (Element)it2.next();
              String ElementName = el2.getName();
              partnerLinkval[i][j]= ElementName;
              j++;
              String Attribute = el2.getAttributeValue("myRole");
              partnerLinkval[i][j]= Attribute;
              i++;
              j--;
              System.out.println("Saving in array "+el2.getName());
              System.out.println("Saving in array "+Attribute);
              System.out.println("array length"+partnerLinkval.length);
              for (int l=0;l<2;l++){
              for(int k=0;k<partnerLinkval.length;k++)
                   System.out.println(partnerLinkval[l][k]);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Result:
    Without Xmlns in xml file
    process
    tgt ns http://serena.com/buildserviceflow
    1
    2
    Saving in array partnerLink
    Saving in array BpelServiceFlowProvider
    Saving in array partnerLink
    Saving in array null
    array length2
    partnerLink
    BpelServiceFlowProvider
    partnerLink
    null
    Result with xmlns:
    process
    tgt ns http://serena.com/CreateKBEntryService
    0

    Hi,
    I am also having the same problem using jdom, my code works fine when there is no xmlns attribute but when i put the xmlns attribute back in doesn't work.
    Did you manage to find a way to solve this problem?

  • Validate xml with complextype schema without root element!

    Hi All!
    I have a problem that. I want to validate a xml data of complextype but the schema i want to validate is[b] not have root element.
    For example:
    The schema like that
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema targetNamespace="www.thachpn.test" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="www.thachpn.test" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:complexType name="Name">
              <xs:sequence>
                   <xs:element name="FirstName" type="xs:string"/>
                   <xs:element name="LastName" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>
    and the xml data i want to validate like this
    <?xml version="1.0" encoding="UTF-8"?>
    <Name xmlns="www.thachpn.test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <FirstName>Pham</FirstName>
         <LastName>Thach</LastName>
    </Name>
    My Algorithm is like that:
    I create a complextype object by above schema
    then i create new element with given name and namespace
    after that i use schema of this element to validate xml data.
    I use xmlparserv2 lib of oracle
    But i can not find how to create complextype from schema or create element with have complextype.
    Please help me.
    Thanks a lot!

    <?xml version="1.0" encoding="UTF-8"?>
    Modify the schema.
    Add a root element.
    <xs:schema targetNamespace="www.thachpn.test" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="www.thachpn.test" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xsd:element name="Name" type="Name"/>
    <xs:complexType name="Name">
    <xs:sequence>
    <xs:element name="FirstName" type="xs:string"/>
    <xs:element name="LastName" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>

  • Document type declaration for root element type "web-app" must end with ' '

    I am attempting to deploy an application (.war file) using the Sun Access Manager Agent installed, (Reference http://docs.sun.com/app/docs/doc/819-3201/6n5eht3k4?a=view -near the bottom) and I get this error:
    Error loading deployment descriptors for ajacs Line 3 Column 19 -- The document type declaration for root element type "web-app" must end with '>'.
    Here is the relavent code:
    <!DOCTYPE web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <web-app>
    <filter>
    <filter-name>Agent</filter-name>
    <filter-class> com.sun.identity.agents.filter.AmAgentFilter </filter-class>
    </filter>
    <filter-mapping>
    <filter-name>Agent</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    <display-name>AJACS</display-name>
    <welcome-file-list>
    <welcome-file>frameSet.jsp</welcome-file>
    </welcome-file-list>
    etc...
    Now, when I remove the parts that http://docs.sun.com/app/docs/doc/819-3201/6n5eht3k4?a=view said to add, it deploys just like it used to deploy- just fine with no errors. However, I add that code and it breaks.
    Note: The code was a straight copy/paste, so if there is any error in the code, it is because it's written incorrectly on the Sun doc website.
    Any help would be MUCH appreciated. Thanks!

    Well, if that was pasted on one line, it would be:
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    So it's supposed to be that way. I just tried it with the extra quotes, and no dice...

  • Recover cost element associated with internal orders. Tx KPF6

    Hi,
    I need to recover only the cost element associated with the internal orders listed in tx. KPF6. Can anyone please tell me how can I do this?, do I need to copy the entire tx to a Ztx?? or can i do this through an User Exit???
    Thanks, Fiorella

    Hi Fiorella,
    Try using table AUFK.
    It gives you the Responsible cost center as  well as the Cost center for basic Settlement for a particular internal Order.
    In case you need any other information, feel free to revert.
    Thanks,
    Sonal
    P.S. Would it be helpful if i tell you how to get Internal Orders from an Internal order Group??

  • Load xml - xls with OWB error "ORA-20011:....Start of root element expected

    Hi
    I need to load XML document into a table in Oracle warehouse builder.
    I've followed the steps as given in the user guide and I get the following error,
    ORA-20011: Error occurred while loading source XML document into the target database object PURCHASE_ORDERS.
    Base exception: Start of root element expected.
    ORA-06512: at "DC_DWH.WB_XML_LOAD_F", line 12
    ORA-06512: at "DC_DWH.WB_XML_LOAD", line 4
    ORA-06512: at line 7
    The steps are:
    DECLARE
    CONTROL_INFO VARCHAR2(200);
    BEGIN
    CONTROL_INFO := '<OWBXMLRuntime> <XMLSource> <file>c:\xml_test\y.xml</file> </XMLSource> <targets> <target XSLFile="c:\xml_test\y.xsl" dateFormat="yyyy.MM.dd">PURCHASE_ORDERS</target> </targets></OWBXMLRuntime>';
    DC_DWH.Wb_Xml_Load ( CONTROL_INFO );
    COMMIT;
    END;
    where:
    ------------- y.xml ----------------
    <purchaseOrder>
    <id>103123-4</id>
    <orderDate>2000-10-20</orderDate>
    <shipTo country="US">
    <name>Alice Smith</name>
    <street>123 Maple Street</street>
    <city>Mill Valley</city>
    <state>CA</state>
    <zip>90952</zip>
    </shipTo>
    <comment>Hurry, my lawn is going wild!</comment>
    <items>
    <item>
    <partNum>872-AA</partNum>
    <productName>Lawnmower</productName>
    <quantity>1</quantity>
    <USPrice>148.95</USPrice>
    <comment>Confirm this is electric</comment>
    </item>
    <item>
    <partNum>845-ED</partNum>
    <productName>Baby Monitor</productName>
    <quantity>1</quantity>
    <USPrice>39.98</USPrice>
    <shipDate>1999-05-21</shipDate>
    </item>
    </items>
    </purchaseOrder>
    -----------------y.xsl -------------------
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2004/07/xpath-functions" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes">
    <SHIPTO_NAME>
    <xsl:value-of select="purchaseOrder/shipTo/name"/>
    </SHIPTO_NAME>
    <SHIPTO_STREET>
    <xsl:value-of select="purchaseOrder/shipTo/street"/>
    </SHIPTO_STREET>
    <SHIPTO_CITY>
    <xsl:value-of select="purchaseOrder/shipTo/city"/>
    </SHIPTO_CITY>
    </xsl:stylesheet>
    Any help is appreciated

    Hello,
    The error occurs as far as your XSL file has incorrect structure. Your have to transform incoming XML in so-called (by Oracle) canonical form i.e.:
    <ROWSET>
    <ROW>
    <FIELD_1>value-for-field-1</FIELD_1>
    <FIELD_N>value-for-field-N</FIELD_N>
    </ROW>
    </ROWSET>
    So, assuming your table has three fields : SHIPTO_NAME, SHIPT_STREET, SHIPTO_CITY, - your XSL file should look like following:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:template match=”/”>
    <ROWSET>
    <xsl:apply-templates select=”purchaseOrder”/>
    </ROWSET>
    </xsl:template>
    <xsl:template match=”purchaseOrder”>
    <ROW>
    <SHIPTO_NAME><xsl:value-of select=”shipTo/name”/></SHIPTO_NAME>
    <SHIPTO_STREET><xsl:value-of select=”shipTo/street”/></SHIPTO_STREET>
    <SHIPTO_CITY><xsl:value-of select=”shipTo/city”/></SHIPTO_CITY>
    </ROW>
    </xsl:template>
    </xsl:stylesheet>
    Hope this will help.

  • Read XML response with multiple root elements

    Hi ,
    I am trying to achieve the below scenario but unable to do so.Please help urgently.
    I am getting a response from a service which has multiple root elements.these root elements can change at runtime..I need to read the different root elements and extract data from its sub elements.
    Regards...
    Hoping for an anwser..

    i assume on runtime the service just returns 1 rootnode, but this rootnode can change
    you could use a switch after the invoke
    if $response/myroot1
    assign $response/myroot to myroot1_var
    if $response/myroot2
    assign $response/myroot to myroot2_var
    etc
    so you check what's in the root node before you assign to you temp variable
    or if you have logic which is specific based on this root nod you can just implement all these branches in the switch and execute logic in there based on the selected rootnode
    several implementations are possible

  • Adding Root Element

    Hi
    I have an existing structure in XML
    <article>
    <text>
    </text>
    </article>
    Here the element article is holding the content and is associated with the text frame.
    I would like to modify the structure to
    <Root>
    <article>
    <text>
    </text>
    </article>
    </Root>
    But still the article element should only be holding the content and shud be associated with text frame is it possible to do that either manually or through scripting in ID CS3
    Thanks

    Hi Priya,
    assume you have an Xml File imported
    <?xml version="1.0" encoding="UTF-8"?>
    <article>
    <text>myText</text>
    </article>
    and you have dragged <article> from the InDesign xml structure onto a textframe on the layout.
    Now, run this script to apply the Root-Tag to your article.
    myDoc = app.activeDocument;
    myArticleXmlElement = myDoc.xmlElements.item(0);
    myArticleXmlTag = myDoc.xmlTags.item("article");
    myTextXmlElement = myArticleXmlElement.xmlElements.item("text");
    try{
    myRootXmlTag = myDoc.xmlTags.add("Root");
    catch(e){
    myRootXmlTag = myDoc.xmlTags.item("Root");
    myArticleXmlElement.markupTag = myRootXmlTag;
    myNewArticleXmlElement = myDoc.xmlElements.item(0).xmlElements.add(myArticleXmlTag);
    myTextXmlElement.move(LocationOptions.AT_BEGINNING, myNewArticleXmlElement);
    Hope this is what you were looking for. You can do all of this manuallly as well. In fact this is how I began before writing the script.
    Just for curiosity, what is that for ? And can you not just import an Xml that already contains the root element ?
    Stefan

  • CANNOT OPEN RAW FILES USING NEW CANON EOS 1D MKIII WITH PHOTOSHOP ELEMENTS 5

    Hi, I have recently taken a number of RAW shots with my new Canon EOS 1D MKIII and have found that I am unable to import them into Photoshop Elements version 5 (using Microsoft Windows). Comments generated are: "the file is a format that cannot be included in the organiser" and "cannot open because it is the wrong type of file". The RAW file extension is .CR2 and I have been able to open these type of files taken on my older, and much cheaper, Canon 350D. I have spent hours considering different options but to no effect and am completely baffled. Do the two cameras produce different types of RAW files? Notably, the files do import into the Canon software 'Digital Photo Professional' but I want to undertake the more versatile manipulation in Photoshop Elements. I have managed to become even more baffled about Digital Negative ('DNG') files and wonder if there is some kind of converter I need. Would the solution be to purchase a more advanced Photoshop package like CS2? OR .......... do I need an 'Adobe Camera RAW' update? I have struggled to find the latest version for Photoshop Elements 5 to suit my Canon EOS 1D MKIII. There appears to be a 4.3.1 update but this only applies to Version CS3. Help!

    You probably haven't had anyone respond to your question because it has been asked and answered so many times. However, I will try once again.
    Adobe Camera Raw must have a profile for every model of every camera for which it supports the camera's raw format. It is not a matter of just supporting a file type such as your CR2 files. ACR needs to know specifically what model you are using. This is a problem that has been created by the different camera makers. They are the ones who are creating these proprietary raw formats. No, they do not cooperate with Adobe. That is why Adobe has to wait for a camera to be available, then obtain a raw file from that camera, and then create the profile so that ACR will recognize that camera. That is also why ACR is updated about four times each year, to provide support for newly released cameras.
    In an attempt to create a "common" raw file format, Adobe has developed the DNG (Digital negative) file format. Adobe is providing a free DNG converter. You always want to download and use the latest version of the DNG converter because it will be the one that supports the most cameras. The DNG converter creates a digital negative copy of your raw image. It contains all of the original raw image data. The image data is precisely the same data that was in the original raw image. The difference is that the DNG file has a "standardized" file header that stores as much of the metadata as possible about the image. Metadata is the information that records the changes that you make to your image when you edit it. Some of the image data is proprietary, and is therefore not available to Adobe. Obviously, that information simply has to be ignored by ACR. There are no XMP files associated with the DNG files. The information is stored within the DNG file itself so the XMP sidecar file is not necessary.
    If you decide to go the DNG route you want to make sure you are using the latest version of the DNG converter. It will convert raw files from the largest number of cameras. Those DNG files can be opened by any version of Camera Raw from version 2.4 onward. Consequently, someone who is still using Photoshop CS still has the capability of working on their raw files even if they have the most recent up to date camera.
    Photoshop Elements will utilize ACR 4.3.1 and any subsequent updates to the ACR 4.x releases. Judging from past experience, there should be another release soon. No one knows for sure. These releases are never announced ahead of time. ACR is not as robust in Photoshop Elements as it is in Photoshop CS3. It is the same plug-in, but a number of options are not available. It will support the same cameras, however.
    You don't need to worry about matching the DNG converter version number to your working version of ACR. The only relationship is that matching version numbers will support the same set of cameras. But the DNG files that are created can be used in any version of ACR from 2.4 onward.
    Anyone who is involved with digital photography and shooting raw has become a victim of the arrogance of the camera makers. The camera makers want to protect their proprietary format, and they want to promote the use of their software. Some of that software has to be purchased, so it is another way for them to make money. Until such time as everyone agrees on a common raw format, the photographers are the ones who are at the mercy of the camera makers. And there will be a continual ongoing updating process that we will have to wait for.

  • E4X: What happens to the root element?

    I'm working with XML using the E4X notation. I'm used to the "old school" XML APIs that use DOM and I'm a bit confused.
    For example, let's consider the following XML
    <mx:XML id="myXML" >
      <top>
        <sub1 id="uno">
          <sub2>hello</sub2>
          <sub3>world</sub3>
        </sub1>
        <sub1 id="duo">
          <sub2>ok</sub2>
          <sub3>ko</sub3>
        </sub1>
      </top>
    </mx:XML>
    In my code I use the following traces. This is done with the De MonsterDebugger, but all others should work the same way. I have casted the traces to String only to make it easier to ask this question (no need post images)
    MonsterDebugger.trace(this, "myXML:" + myXML);
    MonsterDebugger.trace(this, "myXML.sub1: " + myXML.sub1);
    MonsterDebugger.trace(this, "myXML.sub1.sub2: " + myXML.sub1.sub2);
    What I get as output is
    (String) = myXML:<top>
      <sub1 id="uno">
        <sub2>hello</sub2>
        <sub3>world</sub3>
      </sub1>
      <sub1 id="duo">
        <sub2>ok</sub2>
        <sub3>ko</sub3>
      </sub1>
    </top>
    (String) = myXML.sub1: <sub1 id="uno">
      <sub2>hello</sub2>
      <sub3>world</sub3>
    </sub1>
    <sub1 id="duo">
      <sub2>ok</sub2>
      <sub3>ko</sub3>
    </sub1>
    (String) = myXML.sub1.sub2: <sub2>hello</sub2>
    <sub2>ok</sub2>
    All is fine above and this was a bit long abstract for my question. The question is what happens to the root element, in this case <top>? I was trying to access the data with the following notation
    myXML.top.sub1; // etc
    I spent quite a lot of time trying to get it to work, until I discovered that the root element is not used. Can anyone explain this?
    Or, I guess the simple explanation is that the root node is ignored and the sub nodes are created as properties of the object. The question also could be stated as: Why isn't this documented in the Flex API Reference?
    Thanks.
    P.S. I found this article on common E4X pitfalls which also has other interesting topics when working with E4X.

    its gone
    downgrading would kill the phone..

  • How can i change the ROOT ELEMENT name in my ADOBE Form

    Hello All,
    I need to change "data" the Root Element default name to another name.
    Is this possible? How do i do this?
    Thank you all in advance,
    Eran

    Hello Chintan and Otto,
    thank you for your replies...
    Chintan: There is Adobe livecycle designer CE and its a stand alone application :[ designer CE2|http://www.adobe.com/products/livecycle/]
    Otto: I know i can send the xml back and change it in my abap program but i'm talking about stand alone form in a computer with no sap on it.
    The user will fill it and submit it ...
    Thank you all in advance,
    Eran

Maybe you are looking for