[CS5-5.5][JS] Replace xml element content with user selection

Hi,
I'm trying to write a script that replaces xml element content with a user selection.
I have document containing a textframe with a "root" tag attached. In this frame I have 2 paragraphs, each tagged with a different tag.
I would like to replace the content of one of the paragraphs with the content of a text selection.
This piece of code doesn't seem to work:
myXMLElement.xmlContent = app.selection[0];
The problem is that almost all properties of the xmlelement (paragraphs, words, etc) are read-only.
Does anyone have any suggestion?
Thanx

It depends on whether you want to maintain formatting. You can use
myXMLElement.contents = app.selection[0].contents;
in the (unlikely?) event that you don't mind blowing away the formatting. Otherwise you'll want to use something like:
myXMLElement.xmlContent.remove();
app.selection[0].duplicate(LocationOptions.AT_BEGINNING, myXMLElement.xmlContent);
Jeff

Similar Messages

  • How to separate XML element content

    Hi All,
    How can i separate XML element content in to two strings, where each string will be copied into new variables.
    For ex:
    The input I get is
    <XmLElement>C:/documents/sharedFiles/apple.pdf</XMLElement>
    now I want to break the content into two parts like
    <aaaa>C:/documents/sharedFiles/</aaaaa>
    <bbbbb>apple.pdf</bbbbbb> ( I want to separate file name from the string)
    and now I want to copy this into two other variables. How can I achieve this in BPEL. Appreciate your help.
    Thanks,
    Edited by: kameshb on Mar 25, 2013 11:16 AM

    I am getting the following error
    <bpelFault><faultType>0</faultType><subLanguageExecutionFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is substring(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),1, oraext:last-index-within-string(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),'/') -1) . The XPath expression failed to execute; the reason was: internal xpath error. Check the detailed root cause described in the exception message text and verify that the XPath query is correct. </summary></part><part name="code"><code>XPathExecutionError</code></part></subLanguageExecutionFault></bpelFault>
    This is the code inside XPATH
    <assign name="BreakURL">
    <copy>
    <from expression="substring(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),1, oraext:last-index-within-string(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),'/') -1) "/>
    <to variable="outputVariable" part="payload"
    query="/ns1:Toutput/ns1:Location"/>
    </copy>
    <copy>
    <from expression="substring(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),1, oraext:last-index-within-string(bpws:getVariableData('inputVariable','payload','/ns1:Tinput/ns1:URL'),'/'),) "/>
    <to variable="outputVariable" part="payload"
    query="/ns1:Toutput/ns1:Filename"/>
    </copy>
    </assign>

  • How replace XML Elements with java

    I have been usint SAX 2.0 and DOM Level 2 api's to represent XML documents, which i parse with apache's Xerces parser... I am trying to delete certain elements and replace them with others, but none of the api's allow this the closes i have come is replacing attributes of elements....

    -jverd
    You might also want to look into jdom or dom4j.Thanks jdom worked for replaceing the elements and attributes...but when i tried to store the changes in a new file, the text nodes were processed. for e.g. if i had &#8217 the char ( ' ) appeared in the new file. how do i keep the unicode...

  • Compare xml elements content

    Hi,
    I have one big xml file which looks like this:
    <Parameters>
    <previous>
    <business>
    <id>1234</id>
    <name>Business Customer</name>
    </business>
    <location>
    </location>
    </previous>
    <current>
    <business>
    <id>12345</id>
    <name>Business Customer Changed</name>
    </business>
    <location>
    </location>
    </current>
    </Parameters>
    Thie main part of the file is created using xstream and object:(there is some other data attached as well)
    public class MyObject{
    public AnotherObject previous;
    public AnotherObject current;
    String xmlParams = xstream.toXML(myObject);
    public class AnotherObject{
    public Business business;
    public Location location;
    The problem I have is how to compare content of certain elements under <current> and <previous>(the number, position and name of the elements are the same since they
    are both created from the same object type)
    and then attach only elements that are modified to the existing xml file(this file is afterwards processed with xslt and result is sent as email).
    So, the resulting xml file should look something like this:
    I have one big xml file which looks like this:
    <Parameters>
    <previous>
    <business>
    <id>1234</id>
    <name>Business Customer</name>
    </business>
    <location>
    <name>Location 1234</name>
    </location>
    </previous>
    <current>
    <business>
    <id>12345</id>
    <name>Business Customer</name>
    </business>
    <location>
    <name>Location 12345</name>
    </location>
    </current>
    <modified>
    <current>12345</current>
    <previous>1234</previoius>
    <displayName>Business Id</displayName>
    </modified>
    <modified>
    <current>Location 12345</current>
    <previous>Location 1234</previous>
    <displayName>Location Name</displayName>
    </modified>
    </Parameters>
    After I have this resulting xml file I use it with xslt to create email that has current data displayed:
    Business ID: <xsl:value-of select="/Parameters//current//business/id"/>
    Business Name:<xsl:value-of select="/Parameters//current//business/name"/>
    Location Name:<xsl:value-of select="/Parameters//current//location/name"/>
    Plus Modification summary(which I will get after I create the right xml file with modifications part):
    <xsl:for-each select="(/Parameters//modified)">
    <xsl:value-of select="displayName"/><xsl:value-of select="previous"/> <xsl:value-of select="displayName"/><xsl:value-of select="current"/>
    </xsl:for-each>
    This is how resulting email looks like:
    Current Data:
    Business ID: 12345
    Business Name:Business Customer
    Location Name: Location 12345
    Modifications Summary:
    (old value) (new value)
    Business Id:1234 Business Id: 12345
    Location Name: Location 1234 Location Name: 12345
    All of this processing(creating resulting xml file) needs to be done in some helper class, before the file is transformed with xslt.
    The biggest issue is that not all elements under <current> and <previoius> are compared. So basically I have to get the list of elements which I want to compare somehow(property file or somthing)
    and also for every element displayName value as well......

    Vestrini thanks for the response.
    The business scenario is this:
    We have many different locations that are issuing payments. Each location has it's own set of signature levels required for the dynamic image(s) to show up on the signature lines. I am storing the signature level values in a DFF and would like to use them to help make the decision of when the signature shows up or not. We are doing this in an effort to reduce the number of templates that we have to create.
    My current thought is that I can write a statement like this: <?if@inlines: C_CHECK_AMOUNT > ../../C_SIG_LEVEL_1 and C_CHECK_AMOUNT != 0?> 'insert dummy image' <?end if?>
    However it is not working. If I put a value in the place of ../../C_SIG_LEVEL_1 like <?if@inlines: C_CHECK_AMOUNT > 10000 and C_CHECK_AMOUNT != 0?> 'insert image' <?end if?> it works fine.
    Copy of the xml in next post. Looking forward to hearing from you.
    Thanks again.

  • How to replace XML elements using java

    I have been usint SAX 2.0 and DOM Level 2 api's to represent XML documents, which i parse with apache's Xerces parser... I am trying to delete certain elements and replace them with others, but none of the api's allow this the closes i have come is replacing attributes of elements....

    Answered in crosspost.
    http://forum.java.sun.com/thread.jspa?threadID=638156

  • Replace xml elements on OSB

    Hi,
    I have the following problem:
    I have 2 xmls foo and bar and to insert the data from bar into foo
    foo:=
    <a>
    <t>x</t>
    <t>b</t>
    <t>c</t>
    <t>x</t>
    <t>e</t>
    </a>
    bar:=
    <data>
    <x>a</x>
    <x>c</x>
    </data>
    I need to insert into $foo//t[t/text()='x'] the values of $bar//x
    The result should look like that:
    newFoo:=
    <a>
    <t>a</t>
    <t>b</t>
    <t>c</t>
    <t>d</t>
    <t>e</t>
    </a>
    I need that to be done dynamically, meaning I don't know how many x's I'l have in foo but I do know that count($foo//t[t/text()=x]) == count($bar//x)
    Thank you,
    Vitaly
    Edited by: Vitalyb on Jun 11, 2012 11:51 PM
    Edited by: Vitalyb on Jun 11, 2012 11:54 PM

    Hi,
    First I recommend you see some tutorial and xpath xquery. (i.e. www.w3schools.com)
    Posible solution, PseudoCode:
    for $barElement on $bar
    for $fooElement on $foo
    if name($barElement) equal value($fooElement)
    return changeValue($barElement, value(fooElement)
    else
    return $barElement
    Edited by: Sergio_AA on 12-jun-2012 0:58

  • Replacing harcoded XML element attributes with variables

    Is there any way for Xpath expressions in JAVA to refer to variables (for an attribute) instead of harcoded strings (like 'abc' and 'xyz' below)
    So below ... 'abc' , 'xyz' could be varaibles.....
    String getServerInstance="/Accounts/Account[@code='abc']/TestingProgram[@code='abc']/Modes/Mode[@code='xyz']/*";
    Thanks a lot

    I have a class now that resolves variables:
    public class Resolve_Xpath_Vars implements XPathVariableResolver
         public Object resolveVariable(QName var)
    try {          
              if (var.equals(new QName("pqr")))
                        return new String("pqr");
              else if (var.equals(new QName("abcde")))
                        return new String("abcde");
    else
    return null;
    catch (Exception ex)
              ex.printStackTrace();
              throw new RuntimeException();     
    NOWWWWW
    how do i configure my XPATH expression to call this class to reolve my varaible....
    XPATH EXPRESSION IS:
    "this.Account" is the variable that the class should resolve.....to "pqr"
    String getAccnt="/Accounts/Account[@code="+"'"+*this.Account*+"'"+"]/*";      
    Once resolved to "pqr" then i can make the following call:
    NodeList nodeList =(NodeList) xPath.evaluate(getAccnt, inputSource, XPathConstants.NODESET );
    any help is appreciated.............

  • Matching JS XML object with Indd XML elements

    Hello Scripters,
    I need help ...
    I have some XML from a file read into a Javascript XML object.
    The object has the name "myXml", and contains:
        <book id="bk101">
            <author>Gambardella, Matthew</author>
            <title>XML Developer's Guide</title>
            <genre>Computer</genre>
            <imagecontainer href="C:\33415677.JPG"></imagecontainer>
            <price>44.95</price>
            <publish_date>2000-10-01</publish_date>
            <description><test>Sublevel</test>An in-depth look at creating applications with XML.</description>
        </book>
        ... and several other books
    I also have some XML in Indesign, wich in my JS is known as "myTplXmlRoot".
    myTplXmlRoot is defined as myTplXmlRoot = mySelection.associatedXMLElement;
    What would be the best approach for matching elements of the same name in the two xml structures, and where there is a match* replace the Indesign content**, with that from the object "myXml"?
    *) Match if same name, dont worry about place in hirachy
    **) content might be an image

    I've figured out the solution to my problem. For anyone
    interested, see me code below (the xml element names are different,
    but the concept is the same).

  • [JS-CS4] Associated XML element...

    Hi,
    I'm going crazy with this.
    I have a table built with XML import and I need to get the XML element associated with a cell.
    I use this code:
    cell.associatedXMLElement
    but it always returns "null".
    Obviously that cell has a content in XML structure...
    Any idea why?
    Thanks.

    Here's my script:
    var my_doc = app.activeDocument;
    var my_table = my_doc.pages.firstItem().textFrames.firstItem().tables.firstItem();
    my_table.columns.firstitem().select();
    var my_selection = doc.selection;
    for(var c = 0; c < my_selection.length; c++){
         if(my_selection[c].associatedXMLElement.xmlAttributes.itemByName("type").value != "house"){
              my_selection[c].appliedCellStyle = doc.cellStyles.itemByName("column");
              my_selection[c].clearCellStyleOverrides(true);
    This will run once the table is placed through XML import
    I need to check the "type" XML attribute value for every XML cell, that's why I'm performing that if statement.
    Basically if a cell's XML element has a "type" attribute with "house" value the script will not apply the "column" style.
    The problem is that
    my_selection[c].associatedXMLElement
    always return null.
    The XML data structure is:
    <List><Category><Table><Cell/><Cell/>....</Table></Category></List>
    So I have a simple table inside a textFrame.
    I know what I'm doing could sound weird, but I experienced it's the most quick way to handle a big table within ID.
    Here's the background story
    Thanks again.

  • SAX, incor. data for XML element, XML 1.1 doc (1.0 ok) in JRE 6 (JRE 5 ok)

    Hello,
    for some reason, the test case below fails when driven with Java 6. Looks like, when long string data is stored in a XML element, DocumentHandler's characters() method will be provided with incorrect data.
    With XML 1.0, parsing works fine in all my tests, Apache Xerces, JRE 5, JRE 6.
    With XML 1.1., parsing works fine with Apache Xerces, JRE5 but not with JRE6.
    I've checked it with latest JRE 6 update 4.
    Anyone else xperiencing such problems with XML1.1 parsing when using JAXP bundled with Java 6?
    I've tried to file a bug at bugdatabase, but for some reason I got no response for my issue - so I'm trying the forum now ;-)
    Thanx for comments
    Merten
    import java.io.StringReader;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    import junit.framework.TestCase;
    import junit.framework.TestResult;
    import junit.framework.TestSuite;
    /** snippet to demonstrate problem in SAXParser */
    public class ProblemWithSAXParser extends TestCase
    public static void main(String[] args)
    TestResult result=junit.textui.TestRunner.run(suite());
    System.exit(result.wasSuccessful() ? 0 : 1);
    private static junit.framework.Test suite()
    final TestSuite ts=new TestSuite();
    ts.addTestSuite(ProblemWithSAXParser.class);
    return (ts);
    /** small DocumentHandler, just waiting for one and only XML element <c></c> */
    class MySAXDocumentHandler extends DefaultHandler
    boolean listening=false;
    public void startElement(final String uri, final String localName, final String qName, final Attributes attributes)
    throws SAXException
    System.out.println("startElement uri " + uri + " localName " + localName + " qName " + qName);
    if("c".equals(qName))
    listening=true;
    public void endElement(final String uri, final String localName, final String qName) throws SAXException
    System.out.println("endElement uri " + uri + " localName " + localName + " qName " + qName);
    if("c".equals(qName))
    listening=false;
    public void characters(final char ch[], final int start, final int length) throws SAXException
    if(listening)
    final String str=new String(ch, start, length);
    System.out.println("<c> element, start==" + start + " length==" + length + " ch.length==" + ch.length + " ch=="
    + str);
    sb.append(str);
    private final StringBuffer sb=new StringBuffer();
    /** return what I got for XML element <c></c> */
    public String toString()
    return (sb.toString());
    /** test an XML document with an element <c>, use XML 1.0 and XML 1.1 and some (more)
    * content in the XML element */
    public void testWithSunAndApache() throws Exception
    // test XML element content for <c> element
    final StringBuffer plain_str=new StringBuffer("");
    for(int i=0; i < 500; i++)
    plain_str.append("0123456789 This is some text ").append(i).append(". ");
    final String xml_orig=plain_str.toString();
    // SAX parsers, one Sun, one (original) Apache Xerces
    // accept that Apache Xerces is not in path ...
    final String prop_name="javax.xml.parsers.SAXParserFactory";
    final String prop_val_sun="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";
    final String prop_val_apache="org.apache.xerces.jaxp.SAXParserFactoryImpl";
    System.setProperty(prop_name, prop_val_sun);
    final SAXParser sax_sun=SAXParserFactory.newInstance().newSAXParser();
    System.out.println("SaxParser Sun= " + sax_sun);
    assertTrue(("" + sax_sun).indexOf("com.sun.") >= 0);
    System.setProperty(prop_name, prop_val_apache);
    SAXParser sax_apache;
    try
    sax_apache=SAXParserFactory.newInstance().newSAXParser();
    catch(final Throwable t)
    System.err.println("no Apache Xerces in path? " + t);
    sax_apache=null;
    System.out.println("SaxParser Apache= " + sax_apache);
    assertTrue(sax_apache==null || ("" + sax_apache).startsWith("org.apache."));
    // i==0: XML 1.0, i==1: XML 1.1
    for(int i=0; i <= 1; i++)
    assert i == 0 || i == 1;
    final String xml_version=(i == 0 ? "1.0" : "1.1");
    final StringBuffer sb=new StringBuffer("<?xml version=\"" + xml_version + "\" encoding=\"UTF-8\"?><c>");
    sb.append(xml_orig);
    sb.append("</c>");
    final String xml=sb.toString();
    // parse it!
    final StringReader string_reader_sun, string_reader_apache;
    string_reader_sun=new StringReader(xml);
    final InputSource input_source_sun=new InputSource(string_reader_sun);
    string_reader_apache=new StringReader(xml);
    final InputSource input_source_apache=new InputSource(string_reader_apache);
    final MySAXDocumentHandler my_handler_sun, my_handler_apache;
    my_handler_sun=new MySAXDocumentHandler();
    my_handler_apache=new MySAXDocumentHandler();
    sax_sun.parse(input_source_sun, my_handler_sun);
    if(sax_apache!=null)
    sax_apache.parse(input_source_apache, my_handler_apache);
    final String xml_sun=my_handler_sun.toString();
    final String xml_apache=my_handler_apache.toString();
    assertNotNull(xml_sun);
    assertNotNull(xml_apache);
    System.out.println("xml version " + xml_version);
    System.out.println("xml " + xml);
    System.out.println("xml_orig " + xml_orig);
    System.out.println("xml_sun " + xml_sun);
    System.out.println("xml_apache " + xml_apache);
    // test the data returned from DocumentHandler
    if(sax_apache!=null)
    assertEquals(xml_orig, xml_apache);
    assertEquals(xml_orig.length(), xml_sun.length()); // length seems to be okay
    assertEquals(xml_orig, xml_sun); // content seems to be not okay for XML 1.1
    }

    thanx, DrClap, haven't seen the "code" button for some reason, code is attached again
    The output of my test is like this for JRE6 (truncated)
    xml_sun 456789 This is is some text 0. 0123456789 This is some text 1.
    xml_apache 0123456789 This is some text 0. 0123456789 This is some text 1.
    Notice, xml_sun not only starts wrong ("0123" missing) - for some reason, the text there is not "This is some text" but "This is is some text" - very interesting in a way. I guess there's an issue with repeated text chunks ...
    So, the data in my XML element is kind of changed, the length of the string is okay but the characters are "misplaced" or so :-) I thought about a problem with StringBuffer first, but the StringBuffer works fine for Apache ... so I really think there's an issue with JRE 6's parser for XML 1.1
    Merten
    import java.io.StringReader;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    import junit.framework.TestCase;
    import junit.framework.TestResult;
    import junit.framework.TestSuite;
    /** snippet to demonstrate problem in SAXParser */
    public class ProblemWithSAXParser extends TestCase
    public static void main(String[] args)
      TestResult result=junit.textui.TestRunner.run(suite());
      System.exit(result.wasSuccessful() ? 0 : 1);
    private static junit.framework.Test suite()
      final TestSuite ts=new TestSuite();
      ts.addTestSuite(ProblemWithSAXParser.class);
      return (ts);
    /** small DocumentHandler, just waiting for one and only XML element <c></c> */
    class MySAXDocumentHandler extends DefaultHandler
      boolean listening=false;
      public void startElement(final String uri, final String localName, final String qName, final Attributes attributes)
        throws SAXException
       System.out.println("startElement uri " + uri + " localName " + localName + " qName " + qName);
       if("c".equals(qName))
        listening=true;
      public void endElement(final String uri, final String localName, final String qName) throws SAXException
       System.out.println("endElement uri " + uri + " localName " + localName + " qName " + qName);
       if("c".equals(qName))
        listening=false;
      public void characters(final char ch[], final int start, final int length) throws SAXException
       if(listening)
        final String str=new String(ch, start, length);
        System.out.println("<c> element, start==" + start + " length==" + length + " ch.length==" + ch.length + " ch=="
          + str);
        sb.append(str);
      private final StringBuffer sb=new StringBuffer();
      /** return what I got for XML element <c></c> */
      public String toString()
       return (sb.toString());
    /** test an XML document with an element <c>, use XML 1.0 and XML 1.1 and some (more)
      * content in the XML element */
    public void testWithSunAndApache() throws Exception
      // test XML element content for <c> element
      final StringBuffer plain_str=new StringBuffer("");
      for(int i=0; i < 500; i++)
       plain_str.append("0123456789 This is some text ").append(i).append(". ");
      final String xml_orig=plain_str.toString();
      // SAX parsers, one Sun, one (original) Apache Xerces
      // accept that Apache Xerces is not in path ...
      final String prop_name="javax.xml.parsers.SAXParserFactory";
      final String prop_val_sun="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";
      final String prop_val_apache="org.apache.xerces.jaxp.SAXParserFactoryImpl";
      System.setProperty(prop_name, prop_val_sun);
      final SAXParser sax_sun=SAXParserFactory.newInstance().newSAXParser();
      System.out.println("SaxParser Sun= " + sax_sun);
      assertTrue(("" + sax_sun).indexOf("com.sun.") >= 0);
      System.setProperty(prop_name, prop_val_apache);
      SAXParser sax_apache;
      try
       sax_apache=SAXParserFactory.newInstance().newSAXParser();
      catch(final Throwable t)
       System.err.println("no Apache Xerces in path? " + t);
       sax_apache=null;
      System.out.println("SaxParser Apache= " + sax_apache);
      assertTrue(sax_apache==null || ("" + sax_apache).startsWith("org.apache."));
      // i==0: XML 1.0, i==1: XML 1.1
      for(int i=0; i <= 1; i++)
       assert i == 0 || i == 1;
       final String xml_version=(i == 0 ? "1.0" : "1.1");
       final StringBuffer sb=new StringBuffer("<?xml version=\"" + xml_version + "\" encoding=\"UTF-8\"?><c>");
       sb.append(xml_orig);
       sb.append("</c>");
       final String xml=sb.toString();
       // parse it!
       final StringReader string_reader_sun, string_reader_apache;
       string_reader_sun=new StringReader(xml);
       final InputSource input_source_sun=new InputSource(string_reader_sun);
       string_reader_apache=new StringReader(xml);
       final InputSource input_source_apache=new InputSource(string_reader_apache);
       final MySAXDocumentHandler my_handler_sun, my_handler_apache;
       my_handler_sun=new MySAXDocumentHandler();
       my_handler_apache=new MySAXDocumentHandler();
       sax_sun.parse(input_source_sun, my_handler_sun);
       if(sax_apache!=null)
        sax_apache.parse(input_source_apache, my_handler_apache);
       final String xml_sun=my_handler_sun.toString();
       final String xml_apache=my_handler_apache.toString();
       assertNotNull(xml_sun);
       assertNotNull(xml_apache);
       System.out.println("xml version " + xml_version);
       System.out.println("xml        " + xml);
       System.out.println("xml_orig   " + xml_orig);
       System.out.println("xml_sun    " + xml_sun);
       System.out.println("xml_apache " + xml_apache);
       // test the data returned from DocumentHandler
       if(sax_apache!=null)
        assertEquals(xml_orig, xml_apache);
       assertEquals(xml_orig.length(), xml_sun.length()); // length seems to be okay
       assertEquals(xml_orig, xml_sun); // content seems to be not okay for XML 1.1
    }

  • How to replace the existing selection screen with new selection screen

    Hi,
    I have first selection screen with parametre as a table name, then I have created dynamic selection screen as 2nd selection screen with different fields of that table as select options. This is done using genaration of dynamic report. Now If I click on button on this 2nd selction screen , then I want to replace this 2nd dynamic selection screen , with the other selection screen fields.
    Can anybody guide me, How to do replace one slection screen with different selection screen.
    and one imp thing is this selction screen is populating with dynamic fields on it.
    Regards,
    Mrunal

    As I can understand you want to make some of the screen field to disable or visible on screen  depending upon the interaction of user with screen 1.
    You may use this example code in PBO of screen 2.
    LOOP AT SCREEN.
        " action has been taken to modify the area office screen as per the option chosen at screen 99.
        CASE ACTION.
            " if the user has taken up the option of UPLOAD
          WHEN 'UP'.     " screen processing while we upload the plan
            " during upload we will make dates as output fields only
            IF SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_TO' OR SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_FRM'.
              SCREEN-INPUT = 0.
              MODIFY SCREEN.
            ENDIF.
            " also make 2 buttons disabled
            IF SCREEN-NAME = 'AO_DO' OR SCREEN-NAME = 'AO_VE'.
              SCREEN-ACTIVE = 0.
              MODIFY SCREEN.
            ENDIF.
          WHEN 'DN'.      " screen processing while we upload the approved plan
            " during upload we will make dates as output fields only
            IF SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_TO' OR SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_FRM'.
              SCREEN-INPUT = 0.
              MODIFY SCREEN.
            ENDIF.
            " also make 2 buttons disabled
            IF SCREEN-NAME = 'AO_UP' OR SCREEN-NAME = 'AO_VE'.
              SCREEN-ACTIVE = 0.
              MODIFY SCREEN.
            ENDIF.
          WHEN 'VW'.      " screen processing while we view the plan
            " during upload we will make dates as output fields only
            IF SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_TO' OR SCREEN-NAME = 'ZSDTPLANVRSIO-DAT_FRM'.
              SCREEN-INPUT = 0.
              MODIFY SCREEN.
            ENDIF.
            " also make 2 buttons disabled
            IF SCREEN-NAME = 'RLGRAP-FILENAME' OR SCREEN-NAME = 'FNAME'.
              SCREEN-ACTIVE = 0.
              MODIFY SCREEN.
            ENDIF.
            " and hide the file input field
            IF SCREEN-NAME = 'AO_DO' OR SCREEN-NAME = 'AO_UP'.
              SCREEN-ACTIVE = 0.
              MODIFY SCREEN.
            ENDIF.
        ENDCASE.
      ENDLOOP.

  • 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 modify the content of a xml element using java?

    Hi all,
    In my usecase I need to export some data from the database to the external file (Ms Word) using java.
    The data which I get from the database will be in the form of a xml file. In that xml file
    I got to modify the content of an attribute of a xml element in the java class. Kindly comeup with your help
    to achieve this.
    Thanks,
    Phanindra.
    Edited by: 887737 on Dec 5, 2011 5:52 AM

    Why don't you try Xerces2?Why don't you tell him to use the javax.xml APIs that are already built in? And that use Xerces2 under the hood? Instead of throwing out a suggestion that might lead to him adding another copy of Xerces into his application?
    @OP there are several techniques:
    - string replacement as suggested by jschell
    - XML parsing to a DOM and then use the DOM API
    - XSLT
    Which you should use depends on the complexity of your requirement.

  • XML tag markers moved: Find and Replace causing problem in xml elements

    Hi All,
    I am doing find and replace using GREP. While using the expression like $1, $2 (Found Items) in the change to field it changes the placement of tag marker. If the found item is a part of two of more xml elements, I am getting a serious problem while replacing it. (ie. The xml tag markers are moved.)
    See the screen shot below, then you may get better idea. And help me to overcome this issue.
    This is just an example to show you what i'm trying to say, there are so many cases like this.
    Original text/ Before doing find replace
    After replacing
    Green4ever

    Hi Peter and John,
    but it seems to me that the example is looking for any space that
    follows a semi-colon and has two word characters following it, and
    repalce that with an em space. I think you could do the same using look
    behind and look ahead and not need to replace the found text.
    Yes you are right about the look behind and look ahead. I'd like to show some more examples to show what the actual problem is,
    Original/Before Replacing,
    (Consider there is another case here, instead of em-space some times normal word space will also be there)
    Using the Grep:
    Find What---------> ^(\d+\.(?:\d+)?)~m
    Change To------------->$1\t
    After Replace:
    Did I make any sense? Eventhough this will not make any changes in the layout, my requirement is to insert the tab out-side the tag marker not indise.
    Green4ever

  • Howto use Converting File Content in Rec. Adapt. to suppress a xml-element

    Hi,
    we use PI/700, SP6.
    I have following structure (example):
    <MsgOut>
      <Sender>Partner1</Sender>
      <Receiver>Partner2</Receiver>
      <FlatPayload>
         blabla blabla
      </FlatPayload>
    </Msgout>
    Now I wanna use a XI-File-Adapter to write just a Flat-File with the content (of the element <FlatPayload>):
        blabla blabla
    (in other words: I wanna suppress all other xml-elements beside of FlatPayload)
    But I'm not able to configurate this with the function "Converting File Content"
    I tried different possiblities:
    e.g.
    setting yyy.fieldFixedLengths = 0 and yyy.fixedLengthTooShortHandling = Cut
    (yyy = Sender and Receiver)
    or
    just defining "MsgOut,FlatPayload" as RecordSet Structure (without Sender and Receiver)
    Result: no success.
    Now my question: is it possible to suppress some xml-elements?
    Thanks for your help!
    bye
    Wolfgang

    HI,
    You can suppress the XML Nodes/Elements over here. Not Fields ..
    For e.g if your outout xml is like this
    <MsgOut>
        <Sender>Partner1</Sender>
        <Receiver>Partner2</Receiver>
    <FlatPayload>
       <flatdata> blabla blabla</flatdatat>
    </FlatPayload>
    </Msgout>
    In this case you can suppress the <FlatPayload> node/element here.. Using Cut Parameter in the Receiver File Content COnversion.
    /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
    So in your case, you can restructure your data type as you required.. I have mentioned in vice-versa here
    Hope this helps,
    Regards,
    Moorthy
    Message was edited by: Krishna Moorthy P

Maybe you are looking for

  • Choosing Proper Video Output Format

    I've been searching the internet and this forum for an answer to what is probably a simple question, but haven't located the right source. -I want to produce a movie using still photographs using iMovie HD. I want to use the proper format for viewing

  • How to transmit counter input data of different channels simultaneously?

    Hello. I'm using X-series PCIe-6361 DAQ board which have 8 DMA channels and Labview 8.2.1. I upgraded the version of DAQmx as 9.0 which supports the X-series devices and confirmed the board worked normally on my system. I'm trying to measure the puls

  • Oracle forms 9i and C language

    Hi, I'm not able to use user-exits written in C language with oracle 9i in UNIX_HP environment. From the URL with a form without user exits it is ok, but if I start with a form with user-exits I have the message FRM-40800. With oracle forms 4.5 it is

  • Number of rings before going to answerphone

    I have a Nokia 6300 and was wondering if there is any way to increase the number of rings before it goes to answerphone. Many Thanks Dartmoor48

  • Spotify 64 bits for Windows ?

    Please I need link to download the spotify 64 bits for Windows