XML structure validation by javascript

Hi All,
I’m trying to find solution for XML structure validation on opening the indesign document.
Is this possible by javascript.
by
hasvi

Or you could go directly to the source.
http://help.sap.com/saphelp_nw70/helpdata/en/c4/e1343e8c7f6329e10000000a114084/frameset.htm
Regards,
Henrique.

Similar Messages

  • Indesign Javascript and xml structure

    Hi to all
    I am new to program javascript in Indesign, and I am looking for some example on how modify the xml structure inside a document using a javascript script.
    i.e.
    if I have a structure like this in the original document:
    root
    section
    tag1
    tag2
    tag3
    I need to transform it in this way( this is just an example, may be more complex):
    root
         section
              tag1
              tag2
              tag3
    Any help on where or how to solve this is very appreciate.
    Thanks a lot

    I think the MoveXMLElement.jsx script there shows pretty well what's involved. Here's something that addresses something closer to your example:
    var root = app.activeDocument.xmlElements[0];
    root.xmlElements.item("tag1").move(LocationOptions.AT_END, root.xmlElements.item("section"));
    root.xmlElements.item("tag2").move(LocationOptions.AT_END, root.xmlElements.item("section"));
    root.xmlElements.item("tag3").move(LocationOptions.AT_END, root.xmlElements.item("section"));
    You want to be careful about the order you do things and when you grab references to the xml structure objects, since you're changing them as you go (i.e. root.xmlElements[3] might refer to tag3 when you start, but will be invalid once you start moving things into section).
    If the xml structure in your InDesign document is the result of an xml import, you might consider transforming the xml as you import it. It's faster and more natural there.
    Hope that helps,
    Jeff

  • Validating input XML structure

    Hi All,
      If i need to validate the input XML structure, is there any standard modules available. I heard some options are available in PI7.0..Can any one explain in detail for validating the structure without any custom programming.
    Regards,
    Babu

    Hello Babu,
    This feature will be avauilable in Stanndard from Pi 7.1 Currently you would need to have custom coding to do this.
    /people/morten.wittrock/blog/2006/03/21/validating-messages-in-xi-using-xml-schema
    /people/jacob.vandborg/blog/2005/11/29/schema-validation-of-incoming-message
    http://help.sap.com/saphelp_nw70/helpdata/en/c4/e1343e8c7f6329e10000000a114084/frameset.htm
    With Regards,
    BVS

  • Basic XML/DTD design/structure validity.

    I would like some clarification on valid XML structure - is it valid to have an XML element content both CDATA & other elements? I noticed that by using the keyword ANY in my DTD, that the SAX parser that I'm using seems to accept the following -
    <firstElement att="1">
    Some character values.
    <secondElement att="2"/>
    </firstElement>
    However, is this a poor design choice? I have made several attempts to read up on DTD/XML structure and have not found anything which explains whether that structure/approach is valid or not.
    Many thanks!
    ~ RomT

    Yes, you can do that. It's called "mixed content" in the markup biz. And as you suspect, it's not the greatest design choice. No doubt there are uses for it -- for example if you have a text string and you want to mark off pieces of it as being bold or italic -- but you should probably try to avoid it if possible.

  • Special characters in XML structure when prepared using String

    Hi,
       I am preparing an XML structure using 'String'. I print the prepared XML structure in the server log. Issue is that I am seeing extra characters([[ and ]]) that I am not printing.
    Please let me know how to get rid of those.
    Code Excerpt
            String xmlHeader = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
            String lsb_xmlcon = xmlHeader;
            logger.info("ReqXMLString Process  1  --->" + lsb_xmlcon);
            lsb_xmlcon = lsb_xmlcon +("\n");
            logger.info("ReqXMLString Process  1.1  --->" + lsb_xmlcon);
            lsb_xmlcon = lsb_xmlcon +("<REQUEST>");
            lsb_xmlcon = lsb_xmlcon +("\n");
            logger.info("ReqXMLString Process  1.2  --->" + lsb_xmlcon);
    Log
    ReqXMLString Process  1  ---><?xml version="1.0" encoding="utf-8" ?>
    ReqXMLString Process  1.1  ---><?xml version="1.0" encoding="utf-8" ?>[[
    ReqXMLString Process  1.2  ---><?xml version="1.0" encoding="utf-8" ?>[[
    <REQUEST>
    Thanks,
    Message was edited by: 996913
    This issue is observed only while running the code in server, not from Jdev.
    When we append the additional tags without new line character, "\n", there are no extra characters being added. Also, in other case also. where we used "Marshaller" to prepare the XML, we have seen this issue.
    After we set the below property to false, we got rid of the extra characters.
                            jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, false);
    Apparently the insertion of new line when the code runs on server(Weblogic 10.3.6.0) is creating the issue.
    Please let me know if anyone has come across a similar scenario.
    Thanks,

    I am building this XML in a servlet so ,right, DOM does process XML (even though a valid HTML file can be loaded into a DOM object) but if you build XML using DOM then write the XML out using PrintWriter and Transformer objects this will cause the XML to print out in your browser. If you view source on this XML you will see that the DOM object has translated all special characters to there &xxxx; equivalent. For a example: when the string (I know "cool" java) gets loaded into a attribute using the DOM object then wrote back out it looks like (I know &xxx;cool&xxx; java) if you view the source in your browser. This is what it should do, but the DOM object is not change the � to the "&xxxxx;". This servlet is acting as a gateway between a Java API and a windows asp. The asp will call the servlet expecting to get XML back and load it directly into a DOM object. When the windows DOM object gets the xml that I am returning in this servlet is throws a exception "invalid character" because the � was not translated to &xxxx; like the other characters were. According to the book HTML 4 in 24 hours (and other references) the eacute; or #233; are how you say "�" in HTML or XML. How do you say it?

  • Doubt in XML payload validation in PI 7.1

    Dear All,
    I understand that the PI message payload can be validated against a XSD/XML structure..
    but i do not understand its advantage as the payload will by default be validated against our source data type..
    then why do we need it to get validated against some other xml at adapter/IE level

    Dear Ravi,
    A very good question asked by you... Actually to tell there is not much of an advantage...
    What it actually does is..
    1)XML Validation allows you to check the structure of a PI message payload. The structure check is
    performed using saved data types.
    2)Syntax validation of the incoming message payload is done at the Advanced Adapter Engine and at
    the Integration Engine against their XML Schema stored in the File System.
    3)Syntax validation of outgoing message payload is done at the Integration Engine against their XML
    Schema stored in the File System.
    And regarding your question why do we need it ..." This feature is demanded by the customers. "
    Source:https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/406a97c4-748c-2a10-f2be-cb63c5b0a11f
    Rgds
    joel

  • Reg: consistency check in recordset structure validation

    Hi all,
    I am doing FCC to FCC scenario, i am getting this error. Help me out, it is very urgent for me.
    Sender Adapter v2723 for Party '', Service 'bs_text2text':
    Configured at 2007-08-21 08:00:49 UTC
    History:
    - 2007-08-21 09:29:06 UTC: Retry interval started. Length: 2.000 s
    - 2007-08-21 09:29:06 UTC: Error: Conversion of complete file content to XML format failed around position 0: Exception: ERROR consistency check in recordset structure validation (line no. 87: missing structure(s) in last recordset
    - 2007-08-21 09:29:06 UTC: Processing started
    - 2007-08-21 09:29:04 UTC: Error: Conversion of complete file content to XML format failed around position 0: Exception: ERROR consistency check in recordset structure validation (line no. 87: missing structure(s) in last recordset
    - 2007-08-21 09:29:04 UTC: Processing started
    Regards,
    Ajay.

    Hi Ajay,
    Problem with the file content conversion parameters you specified in the sender file adapter. 
    Do let us know your DT structure and FCC parameters specified in adapter.
    Regards,
    Sumit

  • ERROR consistency check in  recordset structure validation

    Hi,
    I have a file that has the format below. The file is managed with the below content conversion parameters. However, it's not working and the error message that i get is "Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR consistency check in recordset structure validation (line no. 7: missing structure(s) in last recordset". Any idea, what when wrong? Thanks.
    Message Type defined:
    FileHeader            (occurrence = 1)
      ARPostingRecord    (occurrence = 1 to unbounded)
        RecordHeader       (occurrence = 1 to unbounded)
        RecordDetail          (occurrence = 1 to unbounded)
    Source file looks like this:
    01 Field1 Field2...Field-n  
    H  Field1 Field2...Field-n  
    L  Field1 Field2...Field-n  
    L  Field1 Field2...Field-n  
    H  Field1 Field2...Field-n  
    L  Field1 Field2...Field-n  
    L  Field1 Field2...Field-n  
    where:
    01 is the keyfieldvalue for FileHeader
    H is the keyfieldvalue for RecordHeader
    L is the keyfieldvalue for RecordDetail
    Specified parameters:
    FileHeader.fieldSeparator
    FileHeader.endSeparator
    FileHeader.fieldNames
    FileHeader.keyFieldValue
    RecordHeader.fieldSeparator
    RecordHeader.endSeparator
    RecordHeader.fieldNames
    RecordHeader.keyFieldValue
    RecordHeader.missingLastFields
    RecordHeader.keepIncompleteFields
    RecordDetail.fieldSeparator
    RecordDetail.endSeparator
    RecordDetail.fieldNames
    RecordDetail.keyFieldValue
    RecordDetail.missingLastFields
    RecordDetail.keepIncompleteFields
    ignoreRecordsetName
    Recordset Name:
    ARPostingRecord
    Recordset Structure:
    FileHeader,1,RecordHeader,1000000,RecordDetail,1000000

    >ERROR consistency check in recordset structure validation (line no. 7: missing structure(s) in last recordset". Any idea, what when wrong?
    When you are not sure about number of records for RecordHeader and RecordDetail, Please specify wildchar character. Dont give max numbers.  The errors says expecting the specified number for recordset and  since it is missing gives errror.

  • Adapter Engine XML Schema Validation Error Surpression

    We recently developed a number of web services that are called by 3rd parties outside our network. The web service request once made is picked up by a Web Dispatcher which then forwards the request to the de-central adapter. Both of these components reside within within a DMZ.
    We have, as an additional security measure made use of the new Adapter Engine XML Schema validation available with PI 7.1, to ensure that the payload of incomming messages is checked to ensure that it is a known structure.
    Now here is my problem, we recently had these services penetration tested by a 3rd party to ensure that they were secure and whilst the report was very good showing no major weaknesses they did pickup on a couple of items including that the fact that if the XSD to be used during payload message validation cannot be found an 'ADAPTER.JAVA_EXCEPTION' is returned to the web service consumer that highlights the path details of where the XSD should be (but could not be found).
    This was viewed as useful to an attacker for a number of reasons:
    1. Feedback in SQL injection attempts via verbatim DB error messages greatly improves attacker efficiency
    2. Path information is useful to the attacker for OS fingerprinting, directory traversal attempts
    3. Other miscellaneous stack trace information is useful to an attacker to understand how the application works
    Is there anyway this can be surpressed so that the adapter does not show this information in the returned error message - see example message below ?
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: Schema MaintenanceOrderByIDQuery_sync.xsd not found in E:\usr\sap\DPI\DVEBMGS40\j2ee\cluster\server0\validation\schema\f7cd3b50a87411e08830ed9d0af006a5\urnstw.contractor.wfm.workorderretrieval\MaintenanceOrderByIDQueryRequest_Out\httpsap.comxiSAPGlobal20~Global\MaintenanceOrderByIDQuery_sync.xsd  (validation\schema)
         at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1041)
         at sun.reflect.GeneratedMethodAccessor497.invoke(Unknown Source)
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: Schema Schema1.xsd not found in E:\usr\sap\DPI\DVEBMGS40\j2ee\cluster\server0\validation\schema\f7cd3b50a87411e08830ed9d0af006a5\urnstw.contractor.wfm.workorderretrieval\MaintenanceOrderByIDQueryRequest_Out\httpsap.comxiEA-APPLSEGlobal\Schema1.xsd  (validation\schema)
         at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1041)

    Hi,
    We are having the same problem, so you are not alone.
    I had an extensive call with Azure premium support and we where able to determine that:
    - Nothing is missing or in the wrong place in my exported .xml file.
    - Any changes to the VNET's using the web gui interface of https://manage.windowsazure.com is not possible when you have dns servers and use an gateway
    - You can download the .xml configuration file of the network and make manual changes to it, then import it again , to add/remove dns servers and or subnet's. 
    I am currently waiting for an solution,  i have let them lower the urgency from A to B (because i can make changes trough xml) and responded to the next support contact (saying he will continue with the issue) that the problems seems to be with azure and
    he should speak with the previous person helping me.  I have not heard from Azure support since.
    SR Number:115021812414226
    Open on:02/18/2015 09:28
    > There are networks with and without gateways created and the issue is happening on all the networks.
    > We are unable to add or remove the DNS servers. (by web gui)
    > Also not able to add or remove any subnets. (by web gui)
    > Every time the error message is same but the DNS server name is different. (from another subnet then the one we are changing)
    > Created CRI- 3405931, but they said it will need WATS team.
    > Confirmed with WATS engineer as well and moving case to WATS.
    > Cx agreed to lower the severity of the case as they are able to make changes through the network configuration file.
    > But they still want to get this resolved soon.
    > Agreed and dropped off, reducing severity to B 24/7.
    I hope microsoft is going to resolve this soon, as i do not want to edit my xml for little things like adding a subnet all the time. I have requested an status update in the issue.
    Should anyone have more information on this, please share it here.

  • Changing the XML Structure in "Submit as XML"

    Dear all,
    We have two PDF Templates which are submitted via a WebService using Submit as XML. For both templates we need the same structured XML output.
    Form 1 has the hierarchy like this (all subforms):
    Company
    Subsdiary
    Responsibles
    Footer
    so the xml looks like
    <creditrequest>
    <company>...</company>
    <subsdiary>...</subsdiary>
    <responsible>...</responsible>
    <footer>...</footer>
    </creditrequest>
    Form 2 has the hiearchy like this (all subforms):
    Responsibles
    Subsidiary
    Company
    Footer
    and the xml looks like
    <creditrequest>
    <responsible>...</responsible>
    <subsdiary>...</subsdiary>
    <company>...</company>
    <footer>...</footer>
    </creditrequest>
    So my question is how can influence the XML output order without changing the PDF hiearchy. This way I can change the XML output for Form 1 or Form 2 and both files would have the same XML structure to submit.
    I have checked the presubmit event and the javascript API to change XML string programmaticly but I couldn't find any possiblity to read/write the XML to submit.
    Thanks,
    Koray

    You can use JDOM and DOM. They are classes that load the XML File on memory and then you can modify it. I strongly recommend JDOM.

  • Pre-validation using JavaScript cannot work in JSF?

    Sometimes we need to do pre-validation using JavaScript in some senarios that data need be entered and validated at client site before it reaches to Web Application Server. Remind that JSF is a server validation. Creator seems not to allow Developers to do pre-validation using JavaScript for any editable input fields in form. I will illustrate an example and hope anyone can help me to solve it out.
    Assume that if we write the a new web page that allows User enters Name and Phone. The pre-validation function called test() is written in JavaScript for validating field Phone. For simplicity, the below HTML/JavaScript without nested in table is a simple one for HTML form.
    <html>
    <body>
    <script language="JavaScript">
    function test(){
         if (form1.phone.value == "")
              alert("Please enter phone number in digits.");
              return false;
    </script>
    <form name=form1>
    <input id="phone" type="text" size=20><Br>
    <input id="name" type="text" size=20><Br>
    <input type="submit" id="submit" onclick="test()" value="Submit">
    </form>
    </body>
    </html>
    Now, we consider using Java Studio Creator to generate the same form as describing above. The script is shown below:
    <?xml version="1.0"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <html>
    <head>
    <title>testForm Title</title>
    </head>
    <body rave-layout="grid">
    <h:form binding="#{testForm.form1}" id="form1">
    <h:inputText binding="#{testForm.textField1}" id="phone" style="position: absolute; left: 192px; top: 96px; width: 168px; height: 23px"/>
    <h:inputText binding="#{testForm.textField2}" id="name" style="position: absolute; left: 192px; top: 144px; width: 168px; height: 23px"/>
    <h:commandButton binding="#{testForm.button1}" id="submit" style="position: absolute; left: 192px; top: 216px" value="Submit"/>
    </h:form>
    </body>
    </html>
    </f:view>
    </jsp:root>
    After running Script that Creator created, the HTML is generated and reduced (for simplicity) as follows:
    <f:view>
    <html>
    <body rave-layout="grid">
    <form action="/rave/rave" id="form1" method="post">
    <input id="form1:Phone" type="text"></input>
    <input id="form1:name" type="text"></input>
    <input id="form1:button1" value="Submit" onClick="test()"></input>
    </body>
    </html>
    </f:view>
    Take a look carefully at <input> elements. We see the syntax for naming for each "input" element that there is a semi colon added between form1 and phone or form1 and name. This syntax is generated from built-in JSF components. Hence, I rewrite the test() JavaScript function to match with the naming that Creator generated as follows:
    <script language="JavaScript">
    function test(){
         if (form1.form1:Phone.value == "")
              alert("Please enter phone number in digits.");
              return false;
    </script>
    Clearly, this JavaScript cannot be worked because of a semi column that Creator has named it.
    I have tried to work arround for this but cannot find a solution except changing the name such as: from <input id="form1:phone" ...> to <input id="form1_phone" ..>. But I could not change or modify the scripts because it is generated from JSF components when running it under browser.
    I guess to solve this problem, the naming for elements in form should be reconsidered in the next release of Java Studio Creator.

    Hi Marie,
    I currently sucess in client pre-validation using JSF. I found a way to do it.
    Please take a look of how javascript has been added in the following scripts:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <html lang="en-US" xml:lang="en-US">
    <head>
    <meta content="no-cache" http-equiv="Cache-Control"/>
    <meta content="no-cache" http-equiv="Pragma"/>
    <title>login Title</title>
    </head>
    <body style="-rave-layout: grid">
    <h:form binding="#{login.form1}" id="form1">
    <h:outputLabel binding="#{login.componentLabel1}" for="componentLabel1" id="componentLabel1" style="position: absolute; left: 216px; top: 72px">
    <h:outputText binding="#{login.componentLabel1Text}" id="componentLabel1Text" value="Application System Name"/>
    </h:outputLabel>
    <h:panelGrid binding="#{login.gridPanel1}" columns="3" id="gridPanel1" style="position: absolute; left: 72px; top: 168px; width: 504px; height: 100px">
    <h:outputLabel binding="#{login.componentLabel2}" for="componentLabel2" id="componentLabel2">
    <h:outputText binding="#{login.componentLabel2Text}" id="componentLabel2Text" value="User Name: "/>
    </h:outputLabel>
    <h:inputText binding="#{login.textField1}" id="textField1" onclick="" style="width: 149px; height: 22px"/>
    <h:outputText binding="#{login.outputText1}" id="outputText1"/>
    <h:outputLabel binding="#{login.componentLabel3}" for="componentLabel3" id="componentLabel3">
    <h:outputText binding="#{login.componentLabel3Text}" id="componentLabel3Text" value="Password: "/>
    </h:outputLabel>
    <h:inputSecret binding="#{login.textField2}" id="textField2" style="width: 147px; height: 22px"/>
    <h:outputText binding="#{login.outputText2}" id="outputText2"/>
    <h:outputLabel binding="#{login.componentLabel4}" for="componentLabel4" id="componentLabel4">
    <h:outputText binding="#{login.componentLabel4Text}" id="componentLabel4Text"/>
    </h:outputLabel>
    <h:commandButton action="#{login.ok_action}" binding="#{login.button1}" id="button1" onclick="return checkUserIdentity(this.form)"
    style="width: 90px; height: 25px" value="OK"/>
    <h:outputLabel binding="#{login.componentLabel5}" for="componentLabel5" id="componentLabel5">
    <h:outputText binding="#{login.componentLabel5Text}" id="componentLabel5Text"/>
    </h:outputLabel>
    </h:panelGrid>
    </h:form>
    </body>
    <script type="text/javascript">
    function checkUserIdentity(form){
    var userName = form["form1:textField1"].value;
    var userPassword = form["form1:textField2"].value;
    if (userName == "") {
    alert("Please enter User Name.");
    form["form1:textField1"].focus();
    return false;
    if (userPassword == "" ){
    alert("Please enter password.");
    form["form1:textField2"].focus();
    return false;
    form.submit();
    return true;
    </script>
    </html>
    </f:view>
    </jsp:root>
    The key for getting data value from Form based on Javascripts is var userName = form["form1:textField1"].value;
    Thanks,
    VTT_

  • Remove Structured Anchored Frame  without disturbing the XML Structure - Reg.

    Dear All,
    Please any one help me!, How to remove the xml Structured Anchored Frame without disturbing the XML Structure.
    Manually If I'm removing the XML Structured Anchored Frame, the XML Structured is gone.
    I tried so many ways.  If  I am removing manually in Grouped Frame, then this problem is not happens.
    I mean, Create 2 separate frames Move any xml structured contents to that frames. Group that 2 frames and make it anchored.
    Now you can remove that anchored, this xml Structure is not disturbing (I mean not removed).
    If I did the same in above method for Single Text Frame, this xml Structure is gone.
    Kindly any one person resolve this problem, Thanks in advance!!!
    Note:
    (1) I tried through in InDesign CS6 Plug-In, this is working perfectly. But I need in Javascript to do this.
    Thanks & Regards
    T.R.Harihara SudhaN

    Hm – if you can do it with a Group object, why don't you wrap around a group object?
    With ExtendScript it's quite possible to create Groups with only one single object.
    If we have a text frame selected, you could add a "helper" rectangle to the spread.
    Group the text frame and the rectangle, then remove the rectangle from the group.
    Now you have a Group with a single text frame.
    var myTextFrame = app.selection[0];
    var myHelperRectangle = app.documents[0].layoutWindows[0].activeSpread.rectangles.add();
    var myGroup = app.documents[0].layoutWindows[0].activeSpread.groups.add([myTextFrame,myHelperRectangle]);
    myGroup.rectangles[0].remove();
    app.documents[0].select(myGroup);
    Uwe

  • Indesign Comparing XML Structure

    Can Anyone help me ?????
    I have wasted a lot time in this query with no result please help me to achieve my desired output.
    i want to display all XmlAttributes of a xml structure in a TextFrame of indesign CS4 that match the following conditions :-
    1) for a selected Character Style ( KT), XmlAttribute of one document(i.e CHAPTER ) must have same value as other document(GLOSSARY) that is being compared. then keywords with same id & olinkend would be displayed in a text frame.
    snapshot 1 shows chapter with highlighted keyterm & its olinkend (which to be used for comparison).
    snapshot 2 shows Xml Structure of Glossary with highlighted glossentry & its id
    Snapshot 3 shows Xml Structure of chapter(containing keyterm its olinkend)
    Snapshot 4 shows Xml Structure of chapter(containing glossary)
    in above snapshot pathology,etiology,pathogenesis,infection and disease have same olinkend(keyterm in chapter) and id (glossentry in glossary) but Human Microbiome Project  do not have different id & olinkend so its not a keyterm. it should not be displayed in text frame with  keyterms but somehow it is tagged wrongly as KT .we dont want it to b displayed.
    my text frame displayed it as
    i want a javascript code to display only keyterms in a text frame( in active document i.e. chapter )where keyterm olinkend = glossentry id and finally save the data to excel file .
    i have taken this code from ADOBE FORUM plz modify this to achieve my output.
    var myDc =app.activeDocument;
    var mySty = myDc.characterStyles.everyItem().name;
    var myDia = app.dialogs.add({name:"Character Style Display Menu", canCancel:true});
         with(myDia.dialogColumns.add()){  
              with(borderPanels.add()){
                   with(dialogColumns.add()){staticTexts.add({staticLabel:"Select Character Style:  "});}
                        with(dialogColumns.add())
                                                                var SelSty = dropdowns.add({stringList:mySty, selectedIndex:0});}
    var myRes = myDia.show();
    if(myRes==true)
          var myChoice = mySty[SelSty.selectedIndex];
                myDia.destroy();
    else
    { exit();}
    app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences.appliedCharacterStyle = myChoice.toString();
    var myFind = app.findText(false).reverse();
    for(var a=myFind.length-1; a>=0; a--){
         var  myString= myFind[a];
         var myPg = myString.parentTextFrames[0].parent.name;
         var myCon = myString.contents;
         app.selection[0].insertionPoints[-1].contents = String(myCon+"\t"+myPg);
         app.selection[0].insertionPoints[-1].contents = "\r";
    app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
    if(myCon==null)
                                                      alert("Character Style not found");
    HOPE YOU WILL UNDERSTAND MY QUERY.
    THANX
    WAITING FOR REPLY.

    Could Peter or someone move this to the scripting forum, please?

  • Fetch entire xml structure

    Hi,
    I am looking for a way to get the entire xml structure inside an actual xml object, or if possible, as a string. I need to pass it to a service but i haven't found a way to get it in the layout that it is shown in the structure panel. The only thing i am able to do is work with XMLElments but isnt there any other way to access it?

    if its importing then you can import the xml into javascript rather than indesign then manipulate the xml before placing it in indesign.
    for example, in this case the xml is read from a file into javascript:
    var xmlFile = File.openDialog ("Please select the XML file");
    xmlFile.open("r");
                        var strXML = xmlFile.read();
      xmlFile.close();
                        XML.ignoreComments = true;
                        XML.ignoreProcessingInstructions = true;
    xmlTree =  new XML(strXML);
    var childrenXML = XMLTree.children(); // children would be directly below the root element to select individual elements use .child("elementName") there are several other options available for navigating through the nodes: including: .parent() and also descendants().
    for (i =0;i < XMLTree.children().length; i++) {
    //process the xml
    Keith

  • XML format for Acrobat JavaScript

    Hi,
    This is my first posting to any Adobe forum, so please bear with me...
    I'm interested in the XML format for Acrobat JavaScript.  I'll be using an external editor (UltraEdit).  When I do (in Acrobat 8) Advanced-->Document Processing-->Edit All JavaScripts, UltraEdit starts off with this:
    //-----------------Do not edit the XML tags--------------------
    Interesting, but not very useful.  If I look at some existing PDF files containing JavaScript, I see things like:
    //-----------------Do not edit the XML tags--------------------
    //<Document-Level>
    //<ACRO_source>DocOpen</ACRO_source>
    //<ACRO_script>
    /*********** belongs to: Document-Level:DocOpen ***********/
    OK, this is better.  In fact, if I look at enough existing PDF files containing JavaScript, I could probably figure out the XML format by myself, including the XML format of tags like <Page-Actions>,  <AcroForm>, etc.  However, it would be far easier to get the specification of the JavaScript XML format -- for example, what is the format of the text following the "belongs to:" string within the various types of XML tags?
    I *presume* this is documented somewhere but I couldn't find it.  If someone has the Acrobat JavaScript XML format specification, it would be greatly appreciated.
    Thanks.
    Dave
    P.S. Another possible approach would be to create JavaScripts myself using Advanced-->Document Processing-->Document JavaScripts, and then see what XML is created based on the code I enter into the GUI, e.g. form code, functions, etc. This also seems somewhat inefficient, presuming again that the JavaScript XML format is already documented.

    Thanks for the additional information.
    I played with JavaScript some more, using my preferred editor, UltraEdit, which I attached to Acrobat.  I thought I would be able to take a JavaScript program from one PDF file (source file) and do a copy & paste into another PDF file (destination file).  While I can do the paste (again, via UltraEdit) into the destination file and can do an UltraEdit Save, when I go back into UltraEdit via Advanced --> Document Processing --> Edit All JavaScripts, the JavaScript I pasted from the source file to the destination file isn't there in the destination file.
    From this, I concluded that I'll need to create the Document-level JavaScript and the form field Javascripts (e.g. a JavaScript triggered by a "Mouse Down" in a button) via the Acrobat GUI's.  Acrobat doesn't seem to like it if I bypass the GUIs and just attempt to paste the code directly into the PDF file via an editor.  By not using the GUI and just doing the cut & paste as I did, I'm probably missing some part of the code setup/creation process that Acrobat needs to know about.
    This is why I originally asked about the syntax for the pseudo-XML, thinking I could just copy the pseudo-XML/JavaScript code from one PDF file to another, and then modify the code to reflect the needs of the destination PDF.  Now I understand the need you mentioned to use the Acrobat GUIs to set up the initial XML/JavaScript structure.
    Once I have the XML structure set up in the destination file (e.g. a JavaScript triggered by a "Mouse Down" in a button), I can obviously copy code snippets into that <AcroForm> sections, I just can't *create* the original "Mouse Down" <AcroForm> sections via the editor.
    Another approach I could follow would be to make a copy of the original source file and change the name of the copy to the desired destination file name, and then start modifying the code in the new (destination) file -- presuming that's the easiest path to get the desired functionality created.  This way, I wouldn't have to manually (via the Acrobat GUI) create all of the <Document-Level> and <AcroForm> sections.
    Thanks for your (and others') help, let me know if I'm missing anything.
    Dave

Maybe you are looking for

  • I am getting and error with a panel in CS6 with configurator

    I get the zxp file to load into CS6 but I keep getting this error when I try to use anything IOError, "File or folder does not exist" I have built tons of panels in the other versions of configurator, but I am inporting one I did in version two and c

  • Whats about working with 2 computers ? lightroom 1.2

    on trip i use my laptop a macbook and at home i work with my working station, the big apple , both apple computers. how can i import all my work ,my photos, with all the metadatas i have changed on the laptop during travelling ? now i imported all my

  • Invoke 3rdparty webservice through XI as sender

    Hi,   In our scenario, We need to invoke a 3rd party webservice through PI and then send the data to R/3 system. Once get the reponse from R/3 again we need to send back the response to 3rd party webservices. (synchro scenario) Could you help me unde

  • Labview6.1 hangs on windows 98 when using adobe acrobat control for activex to open pdf file

    I downloaded the attached vi from this forum and it works perfectly in windows XP with the same version of labview(6.1) and adobe acrobat reader (6.0). However, it hangs immediately when i am just trying to open the vi on windows 98.... I have also e

  • TS3899 My email application will not stay open

    Today my email application started closing itself a few seconds after I open it. Tried restarting the iPad and checking for email lock down but am having no luck finding the problem. Any suggestions?