How to get the xml element and comment name in a page?

I need to list all element and comment name in a page

Hi,
do
  //K2Vector<XMLReference> allXMLRefs;
                    std::vector<XMLReference> allXMLRefs;
  IActiveContext* context = GetExecutionContextSession()->GetActiveContext();
                    UIDRef documentUIDRef = ::GetUIDRef(context->GetContextDocument());
                    XMLReference rootXMLRef = GetRootXMLReference(documentUIDRef);
                    GetFlattenedElementList(documentUIDRef,allXMLRefs);
                    std::ostringstream os;
                    for(std::vector<XMLReference>::iterator it = allXMLRefs.begin(); it != allXMLRefs.end(); ++it)
                              XMLReference nextref = *it;
                              PMString tag_name;
                              os.str("");
                              os <<  AsString(nextref,tag_name).GetPlatformString().c_str();
  CAlert::WarningAlert(os.str().c_str());
          }while(kFalse);
I use above code to get tag name.
Any one help me to get the comment tag in XML

Similar Messages

  • [JS-CS4] - How to read the XML Element and its Attributes

    Dear All,
      I have the doubt regarding: reading the xmlElement and its attributes.
    Here I droping the xml script
    //============= Start ======================//
    var myDoc = app.activeDocument;
    var Fpath = File("../Projects/Entity_map.xml");
      if (Fpath.exists)
       Fpath.open("r");
       var Cont= Fpath.read();
      var roots = new XML(Cont);
      var myEveryName = new Array();
      var myEveryContent = new Array();
      var myEveryAttributes = new Array();
      traverse(roots);
    //$.writeln(myEveryName);
    //$.writeln(myEveryContent);
    $.writeln(myEveryAttributes.length);
    for(var i=0; i<myEveryAttributes.length; i++)
      $.writeln(myEveryAttributes[i]);
    function traverse(tree) {
        myEveryName.push(tree.name());
    myEveryContent.push(tree.text());
      myEveryAttributes.push(tree.getAttribute);
    // you get the contents by using .text() insted of .name()
        if(tree.elements().length() > 0) {
            for(var i=0; i<tree.elements().length(); i++) {
                traverse(tree.elements()[i]);
    //============== End =====================//
    and the XML Structure is
    //===============XML =====================//
    <?xml version="1.0" encoding="UTF-8"?>< Entity_Convertion>
    < Entitys char="Ç" GID="173"/></ 
    Entity_Convertion>
    //===============End ====================//
    Here I'm getting the XML Elements and its contents, but not xmlAttributes.
    Please any one can help me, then I will appreciate...
    Thanks & Regards
    T.R.Harihara SudhaN

    Dear All,
      I have the doubt regarding: reading the xmlElement and its attributes.
    Here I droping the xml script
    //============= Start ======================//
    var myDoc = app.activeDocument;
    var Fpath = File("../Projects/Entity_map.xml");
      if (Fpath.exists)
       Fpath.open("r");
       var Cont= Fpath.read();
      var roots = new XML(Cont);
      var myEveryName = new Array();
      var myEveryContent = new Array();
      var myEveryAttributes = new Array();
      traverse(roots);
    //$.writeln(myEveryName);
    //$.writeln(myEveryContent);
    $.writeln(myEveryAttributes.length);
    for(var i=0; i<myEveryAttributes.length; i++)
      $.writeln(myEveryAttributes[i]);
    function traverse(tree) {
        myEveryName.push(tree.name());
    myEveryContent.push(tree.text());
      myEveryAttributes.push(tree.getAttribute);
    // you get the contents by using .text() insted of .name()
        if(tree.elements().length() > 0) {
            for(var i=0; i<tree.elements().length(); i++) {
                traverse(tree.elements()[i]);
    //============== End =====================//
    and the XML Structure is
    //===============XML =====================//
    <?xml version="1.0" encoding="UTF-8"?>< Entity_Convertion>
    < Entitys char="Ç" GID="173"/></ 
    Entity_Convertion>
    //===============End ====================//
    Here I'm getting the XML Elements and its contents, but not xmlAttributes.
    Please any one can help me, then I will appreciate...
    Thanks & Regards
    T.R.Harihara SudhaN

  • How to get the programs (elements and premiere)from my old computer on my new PC?

    Can I get the programs from my old computer and use tham on my new (windows 8.1) computer?
    what do I do?

    I just did this so I hope I can remember.  I have a MAC so I went into my MAC hard drive and then library > application support > adobe > photoshop elements > 10 > creations > effects.  I selected all of my files and copied them.  I then went back to photoshop elements > 12 > creations and pasted the files into effects.  I then restarted PSE and all of my files were there! 

  • How to move some xml element and its content to a new frame

    Hi All,
    How to move some xml element and its content to a new frame.

    Hi Chinnadk,
    Sorry my code its comment some lines. Now only I check the forum thread, you just try one more time.
    #target InDesign;
    #include "/Program Files (x86)/Adobe/Adobe InDesign CS5.5/Scripts/XML Rules/glue code.jsx"
    var myDoc = app.activeDocument;
    //____________________ XML RULE SET
    var myRuleSet = new Array (new margintag);
    with(myDoc){
        var elements = xmlElements;
        __processRuleSet(elements.item(0), myRuleSet);
    function margintag(){
        this.name = "margintag";
        //this.xpath = "//margintag[@type='mn2']";
        this.xpath = "//margintag";
        this.apply = function(myElement, myRuleProcessor){
            with(myElement){
                app.select(myElement);
                try{
                    var myPrePara = app.selection[0].paragraphs[-1].parentTextFrames[0].paragraphs.previousItem(app.selection[0].paragraphs[-1]);
                    if(myPrePara.characters[-1].contents=="\r"){
                        myPrePara.characters[-1].remove();
                    var myTextframe = myElement.placeIntoInlineFrame(["7p9","6p"]);
                    myTextframe.appliedObjectStyle= myDoc.objectStyles.item("MN1");
                    myTextframe.fit(FitOptions.FRAME_TO_CONTENT);
                    myTextframe.parentStory.paragraphs.everyItem().appliedParagraphStyle = app.activeDocument.paragraphStyles.itemByName("MN1");
                    }catch(e){}
                app.selection = null;
            return true;
    thx,
    csm_phil

  • How to get the XML messages from JMS Queue in BPM

    I have one requirement in my application.we are sending XML messages to the JMS Queue.How to get the XML messages from JMS Queue and how to Extract the details from XMl.
    can you please send me the code to get the XML messages from the JMS Queue.
    Thank you,

    Hi,
    Sure others will have some other ideas, but here's what I typically do to get the XML from a JMS queue. Inside the Global Automatic that pops the messages off the queue you'd have logic similar to this:
    artifactInfoNodes as Any[]
    xmlObject as Fuego.Xml.XMLObject = XMLObject()
    load xmlObject using xmlText = message.textValue
    . . . Once you have this, it's a matter of deciding what you want to do with the message. Most times you'll parse the XML (using XPATH statemens), set argument variables and create a work item instance.
    Hope this helps,
    Dan

  • How to get the XML Source again from the same RDF ???

    If the one new column is added in the .rdf file, then how u create your new XML source by submitting the same cp?
    When I ran the cp for 1st time, I was able to get xml source by view output, save it, make rtf and make data defn and template creation.
    But how to get the XML source If the one new column is added in the same .rdf file?
    Thanks
    Ud.

    The simple answer is: you don't.
    Not only is it simply not possible, but the entire concept of "the active browser" doesn't exist.
    You were on the right track with your code to retrieve the page directly from the server, but as you noticed that code will only work for regular http connections.
    For https and other protocols you will need to use appropriate libraries for each protocol. Something like Apache Commons can help you with that. There are networking libraries in there for a lot of commonly used protocols.

  • Does anyone know how to get the vendor ID and product ID for NI-Visa? TIA

    Does anyone know how to get the vendor ID and product ID for NI-Visa? TIA

    This question has already been addressed in this thread:
    Does anyone know how to get the vendor ID and product ID for a USB device in NI-Visa?
    John M
    National Instruments

  • Does anyone know how to get the vendor ID and product ID for a USB device in NI-Visa? TIA

    Does anyone know how to get the vendor ID and product ID for a USB device in NI-Visa? TIA

    Hello,
    Exactly which USB device are you referring to? Is the device a NI product?
    The Product ID for National Instruments DAQPad-6020E is 0x12C0. The USB vendor ID is 0x3923. This is a 16-bit hexadecimal number(1093) (that is decimal 4243).
    Also, here's a document on our website that will help you in configuring NI-VISA to control your USB device:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/6792BAB18242082786256DD7006B6416?opendocument
    Swapnil P.
    National Instruments Engineer

  • How to get the kerning value and set it to back use script?

    hi,guys
    I come back again.
    I encountered a kerning problem.
    how to get the kerning value and set it to back use script?
    Thanks very much!

    For both cases, the filename can be found on the FILE.ReceivedFileName Context Property.  You can access this Property in a Pipeline Component or Orchestration and take any action you want, such as apply to a database.
    The value is accessed by: MyReceivedMessage(FILE.ReceivedFileName)
    In the case of a duplicate EDI Interchange, you would use the Failed Message Routing feature to capture the error message with either an Orchestration or Send Port.

  • I have been charged 274.55 from 8-23-2013 - 8-26-2013. These are not my charges. I need to know how to get the charges reversed and put back on my account ASAP. Please confirm!

    I have been charged 274.55 from 8-23-2013 - 8-26-2013. These are not my charges. I need to know how to get the charges reversed and put back on my account ASAP. Please confirm!

    You can contact iTunes Support via this page (we are fellow users here on these forums) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • When I went and connected  phone to my laptop and hit restore and it got rid of everything my photos my contacts everything and I don't know how to get the stuff back and if you need to know I have an IPhone4S

    When I went and connected my phone to my laptop and hit restore and it got rid of everything my photos my contacts everything and I don't know how to get the stuff back and if you need to know I have an IPhone4S

    I take it you were replacing an older iPhone and this was the first time you plugged it in? If so, that's what happens. It restored the backup of your old phone. A backup of the current phone is not made in those circumstances.
    If that's not what happened, you need to clarify.

  • How to get the Equipements number and desciption for the contract item ?

    Hi Gurus,
            How to get the Equipements number and desciption for the contract item items? It would gr8 helpful to me...
    VBAP,,EQUI,,,,,,?
    Thanks
    Krisna

    Check with below tables :
    EQUI    Equipment master data
    EQKT   Equipment short text
    EQUZ   Equipment time segment
    Thanks
    Seshu

  • Where will i get the method code and method name in Bpc

    Dear Experts,
    Thanks for watching this thread at the time of creating Consolidation methods they have
    NEW
    HOLDING
    GLOBAL
    PROPORTIONAL
    EQUITY
    lEAVING (END OF THE YEAR)
    LEAVING(DURING THE YEAR)
    Where will i get the method Code and method name.
    Can you please guide me.
    Regards,
    Srinivasan.

    The consolidation methods types you have listed are the standard ones  provided by BPC for Consolidation Method types.
    You can set the Consolidation Methods in the BPC Administration Console under Business Rules Library -> Consolidation Methods.
    There you can see some defaults - you can remove these and set your own if you prefer.
    You should read the BPC340 Training guide.

  • How to get selection screen elements and its table reference of a report ?

    halo experts
    How can I get selection screen elements and its table reference of a report ? . I tried rs_refresh_from_select_options. But I am unable to get the table and field it is referring to
    For eg if my selection screen 1000 is
    parameters: p_carrid type spfli-carrid,
    select-options :s-_connid type sflight-connid.
    is there any Fm or method which gives me what are the screen elements( p_carrid and s_connid ) and what table( splfi and sflight ) and field ( carrid and conid )it is referring to ?

    The following code is an example of how you might dynamically determine all your PARAMETERS and SELECT-OPTIONS variables at run time.  The PARAMETERS and SELECT-OPTIONS only point to a dictionary element--not a specific table.  Even though you may say "spfli-carrid" or "sflight-connid", the data type really references the dictionary type and not a specific table/structure.
    REPORT  ZTEST_PROG.
    TABLES sflight.
    DATA:
           screen_tab TYPE STANDARD TABLE OF screen,
           wa_screen TYPE screen,
           scrn_nm TYPE string,
           scrn_leftover TYPE string,
           l_type TYPE REF TO cl_abap_typedescr,
           typ_nm TYPE string,
           typ_pre TYPE string.
    FIELD-SYMBOLS <fs_data> TYPE ANY.
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECT-OPTIONS s_connid FOR sflight-connid.
    INITIALIZATION.
      LOOP AT SCREEN.
        IF screen-group3 = 'PAR'
          OR screen-group3 = 'LOW'.
            APPEND screen TO screen_tab.
        ENDIF.
      ENDLOOP.
    START-OF-SELECTION.
      LOOP AT screen_tab INTO wa_screen.
        ASSIGN (wa_screen-name) TO <fs_data>.
        l_type = cl_abap_typedescr=>describe_by_data( <fs_data> ).
        IF wa_screen-group3 = 'LOW'.
          SPLIT wa_screen-name AT '-' INTO scrn_nm scrn_leftover.
          TRANSLATE scrn_nm TO UPPER CASE.
        ELSE.
          scrn_nm = wa_screen-name.
        ENDIF.
        SPLIT l_type->absolute_name AT '=' INTO typ_pre typ_nm.
        WRITE:
                 / 'Screen Name:  ', scrn_nm,
                 / 'DDIC Type:    ', typ_nm.
      ENDLOOP.
    When you get into defining internal tables you can determine those at run time with cl_abap_structdescr.  The following is an example of how you might do that.  You can loop through the "components_table" and evaluate each field of the structure in this way.
    DATA: structure_reference TYPE REF TO cl_abap_structdescr,
          components_table TYPE abap_compdescr_tab,
          components_structure LIKE LINE OF components_table.
    structure_reference ?= cl_abap_structdescr=>describe_by_data( any_structure ).
    components_table = structure_reference->components.
    I don't know if this answers any of your questions but I hope that some of it is useful.

  • How to get the XML Payload of called process from calling process?

    I have two SOA processes say process A and process B.
    Process B is called by process A.In process A I, am using the getRequestMessage() method in Java code to get the XML payload of process A.
    But i want the XML payload of process B in process A.How can i achieve it?

    Doug,
              I used the property loader method but I could not load the limits of any sub sequence call calling an external sequence file.
    I took the FlowRate_test.seq example from the NI Example folder "C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 4.2.1\Examples\PropertyLoader\LoadingLimits\LimitsFromExcelFile\UsingCVI". I created a sequence called PumpTest.seq in the same folder path. I then moved the Pump Test step from the FlowRate_test.seq to the PumpTest.seq. Now created a sequence call in the FlowRate_test.seq and called the PumpTest.Seq as the module path. When I execute the FlowRate_test.seq , I get the error as shown below:
    Attached is the Flowrate_Test.seq and the PumpTest.seq which should be there in the folder path "C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 4.2.1\Examples\PropertyLoader\LoadingLimits\LimitsFromExcelFile\UsingCVI".
    Let me know whether I am doing something wrong in this method. 
    My idea is to alter the runstate variable High and Low of Pump Test in the PumpTest.seq and then run the Flowrate_Test.seq.
    Attachments:
    PumpTest.seq ‏6 KB
    FlowRate_test.seq ‏11 KB

Maybe you are looking for