Parse and output XML document while preserving attribute order

QUESTION: How can I take in an element with attributes from an XML and output the same element and attributes while preserving the order of those attributes?
The following code will parse and XML document and generate (practically) unchanged output. However, all attributes are ordered a-z
Example: The following element
<work_item_type work_item_db_site="0000000000000000" work_item_db_id="0" work_item_type_code="3" user_tag_ident="Step" name="Work Step" gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_site="0000000000000000" last_upd_db_id="0" rstat_type_code="1">
</work_item_type>is output as:
<work_item_type gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_id="0" last_upd_db_site="0000000000000000" name="Work Step" rstat_type_code="1" user_tag_ident="Step" work_item_db_id="0" work_item_db_site="0000000000000000" work_item_type_code="3">
</work_item_type>As you may notice, there is no difference in these besides order of the attributes!
I am convened that the problem is not in the stylesheet.xslt but if you are not then it is posted bellow.
Please, someone help me out with this! I have a feeling the solution is simple
The following take the XML from source.xml and outputs it to DEST_filename with attributes in a-z order
Code:
private void OutputFile(String DEST_filename, String style_filename){
     //StreamSource stylesheet = new StreamSource(style_filename);
     try{
          File dest_file = new File(DEST_filename);
          if(!dest_file.exists())
              dest_file.createNewFile();
          TransformerFactory tranFactory = TransformerFactory.newInstance();
          Transformer aTransformer = tranFactory.newTransformer();
          aTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
          Source src = new DOMSource("source.xml");
          Result dest = new StreamResult(dest_file);
          aTransformer.transform(src, dest);
          System.out.println("Finished");
     catch(Exception e){
          System.err.print(e);
          System.exit(-1);
    }

You can't. The reason is, the XML Recommendation explicitly says the order of attributes is not significant. Therefore conforming XML serializers won't treat it as if it were significant.
If you have an environment where you think that the order of attributes is significant, your first step should be to reconsider. Possibly it isn't really significant and you are over-reaching in some way. Or possibly someone writing requirements is ignorant of this fact and the requirement can be discarded.
Or possibly your output is being given to somebody else who has a defective parser which expects the attributes to be in a particular order. You could quote the XML Recommendation to those people but often XML bozos are resistant to change. If you're stuck writing for that parser then you'll have to apply some non-XML processing to your output to fix it up on their behalf.

Similar Messages

  • Can't get the DOM to output XML document tags in correct order.

    I'm trying to output an XML document from the DOM using the DOMWriter class: new DOMWriter(document, filename, outputEncoding, encodingTag, getDocTypeString());
    It refuses to output the tags in the correct order so my document always fails validation when it is read back in. I've tried explicitly placing the elements in the correct order into the DOM and it still outputs them the way it wants to. Is there some method I'm missing to set the xsd or dtd to validate the output on. It actually appears as though it has a definite idea as to what order the tags should be output, because no matter what order I append the nodes into the document, it always outputs them in the same incorrect order. I've got the validation working when it reads the document in. Does anyone know what I have to do to get it to output the tags in the correct order?

    Does anyone know what I
    have to do to get it to output the tags in the correct
    order?You have to build the DOM in the correct way. Based on the code you posted it's impossible to tell what you are doing wrong. How about posting some code?

  • RE: (forte-users) XML Parser - Reading an XML document intothe Document

    Hi Laks
    Here is an example of converting a XML doc to a DOM object.
    The method is ParseXML(pXMLString:TextData, pListType:CSAListInterface).
    Hope this helps.
    Argyris Simakis
    Corporate Services Applications ITB
    Sydney AUSTRALIA
    -----Original Message-----
    From: Narayanan, Lakshmi [mailto:lnarayanoxhp.com]
    Sent: Thursday, April 06, 2000 8:31 AM
    To: 'kamranaminyahoo.com'
    Subject: (forte-users) XML Parser - Reading an XML document into the
    Document Object
    Importance: High
    Hi guys,
    I have been trying to read an XML file and feed it into the XMLParser.
    I have read about the DOM API, and i can work with the DOM API in java
    scripts. How
    will i play with it in TOOL implementation of DOM API. Can anyone guide me
    in this
    process.
    Thanks for your help.
    Laks
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Hi Laks
    Here is an example of converting a XML doc to a DOM object.
    The method is ParseXML(pXMLString:TextData, pListType:CSAListInterface).
    Hope this helps.
    Argyris Simakis
    Corporate Services Applications ITB
    Sydney AUSTRALIA
    -----Original Message-----
    From: Narayanan, Lakshmi [mailto:lnarayanoxhp.com]
    Sent: Thursday, April 06, 2000 8:31 AM
    To: 'kamranaminyahoo.com'
    Subject: (forte-users) XML Parser - Reading an XML document into the
    Document Object
    Importance: High
    Hi guys,
    I have been trying to read an XML file and feed it into the XMLParser.
    I have read about the DOM API, and i can work with the DOM API in java
    scripts. How
    will i play with it in TOOL implementation of DOM API. Can anyone guide me
    in this
    process.
    Thanks for your help.
    Laks
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • RE: (forte-users) XML Parser - Reading an XML document intothe D ocumen

    Hi Simakis,
    Your attachments explained the exact start i was looking for.
    Thanks a lot for sharing.
    Thanks
    Laks
    -----Original Message-----
    From: Simakis, Argyris [mailto:Argyris.Simakisdet.nsw.edu.au]
    Sent: Thursday, April 06, 2000 12:35 AM
    To: 'Narayanan, Lakshmi'
    Cc: 'kamranaminyahoo.com'
    Subject: RE: (forte-users) XML Parser - Reading an XML document into the
    D ocument Object
    Hi Laks
    Here is an example of converting a XML doc to a DOM object.
    The method is ParseXML(pXMLString:TextData, pListType:CSAListInterface).
    Hope this helps.
    Argyris Simakis
    Corporate Services Applications ITB
    Sydney AUSTRALIA
    -----Original Message-----
    From: Narayanan, Lakshmi [mailto:lnarayanoxhp.com]
    Sent: Thursday, April 06, 2000 8:31 AM
    To: 'kamranaminyahoo.com'
    Subject: (forte-users) XML Parser - Reading an XML document into the
    Document Object
    Importance: High
    Hi guys,
    I have been trying to read an XML file and feed it into the XMLParser.
    I have read about the DOM API, and i can work with the DOM API in java
    scripts. How
    will i play with it in TOOL implementation of DOM API. Can anyone guide me
    in this
    process.
    Thanks for your help.
    Laks
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Hi Simakis,
    Your attachments explained the exact start i was looking for.
    Thanks a lot for sharing.
    Thanks
    Laks
    -----Original Message-----
    From: Simakis, Argyris [mailto:Argyris.Simakisdet.nsw.edu.au]
    Sent: Thursday, April 06, 2000 12:35 AM
    To: 'Narayanan, Lakshmi'
    Cc: 'kamranaminyahoo.com'
    Subject: RE: (forte-users) XML Parser - Reading an XML document into the
    D ocument Object
    Hi Laks
    Here is an example of converting a XML doc to a DOM object.
    The method is ParseXML(pXMLString:TextData, pListType:CSAListInterface).
    Hope this helps.
    Argyris Simakis
    Corporate Services Applications ITB
    Sydney AUSTRALIA
    -----Original Message-----
    From: Narayanan, Lakshmi [mailto:lnarayanoxhp.com]
    Sent: Thursday, April 06, 2000 8:31 AM
    To: 'kamranaminyahoo.com'
    Subject: (forte-users) XML Parser - Reading an XML document into the
    Document Object
    Importance: High
    Hi guys,
    I have been trying to read an XML file and feed it into the XMLParser.
    I have read about the DOM API, and i can work with the DOM API in java
    scripts. How
    will i play with it in TOOL implementation of DOM API. Can anyone guide me
    in this
    process.
    Thanks for your help.
    Laks
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • XSLT Generation from input and output XML

    Is it possible to generate an XSL mapping file in Java if we have input and output XML.
    If yes, then how to achieve this when user defined functions are used during mapping?

    Hi Prateek,
    check the following links for Business connectors and adapter:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/92/3bc0401b778031e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/4fb240ac052817e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/3f93404f673028e10000000a1550b0/frameset.htm
    Hope these help you.
    Regards,
    Anuradha.B

  • Schema Parsing to create xml documents(Urgent)

    Hi,
    I'm new to XML and need some help for my course project. I need to parse xml schema and get the values of element name, attributes etc so that user can input values to create xml documents. Also I need to write a code that extracts the schema once the user selects schema of his choice. So its basically I need to provide dynamic interface for user to input values based on various schema.
    It would be helpful if some advices me or let me know where I can proceed.
    Thanx
    swetha

    Hello Swetha,
    If you choose an XML binding technology go with JAXB 2.0. This is an industry standard included in Java since Java SE 6. Oracle offers a JAXB implementation as part of the TopLink product see the latest tech preview), and has recently open sourced it through Eclipse (Eclipse Persistence Services or EclipseLink). EclipseLink/TopLink offers features beyond what is available in standard JAXB that you may need.
    TopLink object-to-XML/JAXB:
    http://www.oracle.com/technology/products/ias/toplink/oxm/index.html
    EclipseLink:
    http://www.eclipse.org/eclipselink/
    http://wiki.eclipse.org/EclipseLink
    You may also consider using SDO. SDO can be viewed as a dynamic object model, the metadata can be loaded from XML Schemas (even the XML Schema for XML Schema). TopLink & EclipseLink include SDO implementations. The dynamic model is very rich in metadata which may be useful to you in creating a dynamic interface. For more information on SDO see:
    http://www.osoa.org/display/Main/Service+Data+Objects+Specifications
    If you are interested in the SDO approach post back, and I can provide more details.
    -Blaise

  • Parse and render XML... and get original replicated?

    Now that I've (temporarily) got iFS working (on another machine for now). I've got an XML question: I moved the airportdefinition.xml into the folder, and then subsequently moved the airport.xml into the folder, whereupon iFS parsed it and stored it. Yeah! However when examining (or copy out) the stored data, it is somewhat different than the original:
    original:
    <?xml version="1.0"?>
    <Airport>
    <Name>airport1.fly</Name>
    <AirportCode>SFO</AirportCode>
    <AirportName>San Francisco</AirportName>
    <FolderPath>.</FolderPath>
    </Airport>
    As recreated by the renderer:
    <?xml version = '1.0' standalone = 'yes'?>
    <AIRPORT>
    <Name>airport1.fly</Name>
    <Owner RefType="Name" ClassName="DIRECTORYUSER">system<!--ID # 96--></Owner>
    <ACL RefType="Name" ClassName="SYSTEMACCESSCONTROLLIST">Published<!--ID # 422--></ACL>
    <CreateDate format="MMM dd HH:mm">Nov 09 15:44</CreateDate>
    <Creator RefType="Name" ClassName="DIRECTORYUSER">system<!--ID # 96--></Creator>
    <LastModifyDate format="MMM dd HH:mm">Nov 09 15:44</LastModifyDate>
    <LastModifier RefType="Name" ClassName="DIRECTORYUSER">system<!--ID # 96--></LastModifier>
    <LockState>0</LockState>
    <AIRPORTCODE>SFO</AIRPORTCODE>
    <AIRPORTNAME>San Francisco</AIRPORTNAME>
    </AIRPORT>
    We'd like (to have cake and eat it) to be able to store parsed xml (to support queryability, indexing, reporting, etc.) but also want to be able to recreate the original xml UNCHANGED.
    If we don't parse it, we can have unchanged data, but then limit the queryability. Other than storing the xml document twice (both parsed and not) is there any way to do this?
    null

    I am glad that you solve this question and share the solution with us, I will mark your reply as the answer.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Xpath and Get XML Document Data

    Good Morning,
    I have just recently gotten involved in a project that requires communicating with some web services (axis2). We have existing scripts that handle this already, but they were built when we weren't on axis2 so now the XML output from the web service call is slightly different and i am no longer able to use the same xpath statement in the Get XML Document Data step.
    I am receiving either null values or a prefix namespace error. I am new to xpath and have been reading as best i can from http://www.w3schools.com/xpath/ to try and understand how to write my statements to pull out the data i want correctly.
    I have read that sometimes the editor has problems if the XML contains namespace declarations, etc.
    Below is an example XML output where I'd like to be able to read the value in the ax211:success. My xpath gets prefix namespace errors as it doesn't recognize ax211.
    Xpath: /descendant::ns:validateCertificationResponse/child::ns:return/child::ax211:success
    Perhaps my xpath statement is just incorrect and wouldn't retrieve what i expect it to....
    Any advice is appreciated.
    Thanks,
    Kevin

    Hi,
    well, it appears that text() is automatically appended to the XPath query for some reason in UCCX, this is why you actually see the text node within the ax211:success element. This //*[local-name()="success"] select the whole node, not its first child (which is actually the first element, which also happens to be a text).
    Anyway,
    // - anywhere
    * - any node
    And within this "everything" you actually search with the condition within the angular brackets.
    G.

  • Open and edit animated .gif while preserving frame timing

    CS4 Premium Design Edition, Win XP
    I was disappointed with the removal of Image Ready from CS3 because although some of the functionality was placed into Photoshop 10, there was no way to open and edit an existing animated .gif while preserving the timing of each individual frame. I was told on the PS forum at the time that I really needed to use Fireworks. I resented that, because I was very happy with Image Ready and I didn't want to have to learn a new application just to gain functionality that had been included in previous versions of PS/IM.
    I've now got CS4 Premium Design Edition which of course includs Fireworks... and here's what Help has to say on the subject of imported .gifs.
    "Note: When you import an animated GIF, the state delay setting defaults to 0.07 seconds. If necessary, use the States panel to restore the original timing."
    This is no use to me. What if I don't know the individual frame timings? What if there are 200 frames with varying timings?
    Simple question: which current Adobe product is capable of importing a .gif while retaining the frame timings? If anyone knows, or if I've misunderstood the nature of the Fireworks Help quote above, I'd really appreciate some input here. Thanks :)
    Not so simple question: why was an excellent gif-editing application thrown out to have its functionality partially replaced by a bunch of scripts and half-effective workarounds cooked up by desperate users ("import a gif by using the video import and typing *.* into the filename box..")? It's a fair question I think.
    Mark

    Hi Bob, that's not glib at all, it's a reasonable question.
    I uninstalled it along with everything else when I installed CS3, in the reasonable expectation that whatever replaced IR would be at least equal in functionality.
    Perhaps I should just dig out CS2 and install IM from there, but I have some serious reservations about doing so, because I don't know if/how a partial install of CS2 will impact upon my installation of CS4, and I'm not confident of getting support.
    I am also curious to know if/why Adobe actually removed basic functionality without replicating or replacing it in their other software. I really want to know: which recent, currently supported Adobe product
    should I be using in order to regain this functionality? Or do Adobe no longer produce a geniuinely comprehensive .gif-editing application?
    Mark

  • Different input and output xml files [encoding]

    Welcome. I write a little code that connect to ftp server, log in, than search an input xml file. That file is input for BufferedReader. This data are writing to local file. Im from poland and i wish use polish fonts and that fonts are broken in this output file (input is ok, it's write in editor that support utf-8 encodding)
    Code of my program:
    http://www.piotrkow.net.pl/~loko/xml_java/java_pyt.html
    Input file:
    http://www.piotrkow.net.pl/~loko/xml_java/agreeting[input].xml
    Output file (totaly broken):
    http://www.piotrkow.net.pl/~loko/xml_java/agreeting[output].xml
    How do I fix this? Please help.
    PS: Documentation used ftp libraries:
    http://jvftp.sourceforge.net/docs/api/

    Problem has been solved :)
    --> http://www.piotrkow.net.pl/~loko/xml_java/java_solved.html

  • Extracting and Loading XML document

    We need to extract and load an XML document into the database
    For e.g.
    <ROW> <EMP_ID>1</EMP_ID> <EMP_NAME>SSK</EMP_NAME>
    <RESUME> Resume of sssk
    </RESUME>
    </ROW>
    We need to load emp_id, emp_name to emp_id, emp_name field in the database and <RESUME> field to a CLOB.
    The table is as follows
    EMP_ID NUMBER
    EMP_NAME VARCHAR2(100)
    RESUME CLOB
    How exactly is this done using the XSU utility? Does it support loading of <RESUME> data in this case to a CLOB.
    Where could I find examples of doing this.
    null

    The "first child" of most of your elements is a white-space node containing a newline character. Your code incorrectly assumes it is an element node.

  • Difference between SDO and a xml document

    Hello,
    I want to know what is the exact difference between a SDO and XML document.According to my understanding, SDO defines a Java binding framework of its own. XML is a kind of data being bound to SDO.
    SDO can be represented as XML.
    But what is the difference between a normal XML document and a XML representing a SDO ?
    How can we say by looking at a XML doc that it is a representation of a SDO and not JUST ANY xml doc?
    Please clarify.
    Thanks
    Nutan

    Let's see.
    Facelets creates a facelets page
    JSP creates a JSP page
    {noformat}:){noformat}
    Facelets is the "official" view language for JSF 2.0
    http://www.realdevelopers.com/blog/development/facelets-vs-jsp should give you some more insight as well.
    John

  • JAXBContext and unmarshaling xml document to a class that came from a jar.

    I'm trying to unmarshal, code:
                   try {
                        JAXBContext jc = JAXBContext.newInstance(clazz);
                        Unmarshaller m = jc.createUnmarshaller();
                        Document doc = XmlUtils.createDom(body);
                        javax.xml.bind.JAXBElement<T> res = (javax.xml.bind.JAXBElement<T>)m.unmarshal(doc);
                        return res.getValue();
                   } catch (JAXBException e) {
                        Log.exception(e);
    now i have an ObjectFactory inside the jar that resolve (xmlRegistry) the correct type.
    but the @XmlAccessorType(XmlAccessType.FIELD) binding is not working while the class is comming from a jar.
    when i 'Link source' to my project is working fine.
    I guess it has something to do with reflection.
    the class which i want to unmarshal to looks like this:
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "GetSessionIDResponseType", propOrder = {
    "sessionID"
    public class GetSessionIDResponseType
    extends AbstractResponseType
    implements Serializable
    private final static long serialVersionUID = 12343L;
    @XmlElement(name = "SessionID")
    protected String sessionID;
    * Gets the value of the sessionID property.
    * @return
    * possible object is
    * {@link String }
    public String getSessionID() {
    return sessionID;
    * Sets the value of the sessionID property.
    * @param value
    * allowed object is
    * {@link String }
    public void setSessionID(String value) {
    this.sessionID = value;
    not the field as u can see is protected though it has getter and setter.
    anyway i must get the link source project to a jar and i cant do that cause the unmarshal is basically failing.
    any idea?
    Edited by: 813927 on Nov 20, 2010 6:10 AM

    I've overcome the problem by adding the unmarsheling code inside the jar.
    though i dont the problem i tried to set the fields to be public and it didnt work.
    very strange so far.

  • Parse and display xml doc when click on JTree node?

    Ok so here is the code that I have now. You will have to make alot of html files to run the program, but they can be empty for now. What you can do is just put the same exact html file to be displayed in each node element. for example.
    DefaultMutableTreeNode n1_node1_b1 =
                        new DefaultMutableTreeNode(new ModuleInfo("Device", "device.html"));could be changed to
    DefaultMutableTreeNode n1_node1_b1 =
                        new DefaultMutableTreeNode(new ModuleInfo("Device", "status.html"));And just keep adding the status.html page to each one of the nodes.
    anyway.
    For now when I click on the node, the html file is displayed in the JScrollPane rPane = new JScrollPane(htmlPane); and the htmlPane is a JEditorPane
    what I need it to do.
    When I click on the JTree node. I would like to go out to an xml file, parse the information in it, and display it to the pane.
    I will need to later, be able to add, edit, or delete information on the xml through the pane later.
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.JTree;
    import javax.swing.JPanel;
    import javax.accessibility.*;
    import javax.swing.UIManager;
    import javax.swing.JComponent;
    import javax.swing.JEditorPane;
    import javax.swing.tree.TreeSelectionModel;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.ImageIcon;
    import java.net.URL;
    import java.io.IOException;
    import java.awt.Dimension;
    * @author orozcom
    public class Example extends JFrame implements TreeSelectionListener
        private JEditorPane htmlPane;
        private URL helpURL;
        private static boolean DEBUG = false;
        private JTree tree;
        public Example()
            super("Example");
            setSize(1200,900);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            JMenuBar jmb = new JMenuBar();
            JMenu fileMenu = new JMenu("File");
            JMenuItem openItem = new JMenuItem("Open");
            JMenuItem saveItem = new JMenuItem("Save");
            JMenuItem exitItem = new JMenuItem("Exit");
            exitItem.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent ae)
                    System.exit(0);
            fileMenu.add(openItem);
            fileMenu.add(saveItem);
            fileMenu.add(new JSeparator());
            fileMenu.add(exitItem);
            jmb.add(fileMenu);
            setJMenuBar(jmb);
            //  **************** start JTree ******************//       
            JPanel lPane =new JPanel();       
            lPane.setLayout(new BorderLayout());
            DefaultMutableTreeNode top = new DefaultMutableTreeNode(new ModuleInfo("Devices","splashScreen.html"));
            DefaultMutableTreeNode branch1 =
                    new DefaultMutableTreeNode(new ModuleInfo("Module 1", "module1.html"));
            DefaultMutableTreeNode branch2 =
                    new DefaultMutableTreeNode(new ModuleInfo("Module 2", "module2.html"));
            //DefaultMutableTreeNode branch3 =
                    //new DefaultMutableTreeNode(new ModuleInfo("Module 3", "module3.html"));
            //adding to the topmost node
            top.add(branch1);
            top.add(branch2);
            //top.add(branch3);
             *          BRANCH 1           *
            //adding to the First branch
            DefaultMutableTreeNode node1_b1
                    =new DefaultMutableTreeNode(new ModuleInfo("Status", "status.html"));
            //branch1.add(node1_b1);
                DefaultMutableTreeNode n1_node1_b1 =
                        new DefaultMutableTreeNode(new ModuleInfo("Device", "device.html"));
                DefaultMutableTreeNode n2_node1_b1 =
                        new DefaultMutableTreeNode(new ModuleInfo("Network", "network.html"));
                DefaultMutableTreeNode n3_node1_b1 =
                        new DefaultMutableTreeNode(new ModuleInfo("Chassis", "chassis.html"));
                DefaultMutableTreeNode n4_node1_b1 =
                        new DefaultMutableTreeNode(new ModuleInfo("Resources", "resources.html"));
                node1_b1.add(n1_node1_b1);
                node1_b1.add(n2_node1_b1);
                node1_b1.add(n3_node1_b1);
                node1_b1.add(n4_node1_b1);    
            DefaultMutableTreeNode node2_b1 =
                    new DefaultMutableTreeNode(new ModuleInfo("Project Editor", "projedit.html"));
            DefaultMutableTreeNode node3_b1 =
                    new DefaultMutableTreeNode(new ModuleInfo("Project Manager", "projmngt.html"));
            DefaultMutableTreeNode node4_b1 =
                    new DefaultMutableTreeNode(new ModuleInfo("Administration", "administration.html"));
            DefaultMutableTreeNode n1_node4_b1 =
                    new DefaultMutableTreeNode(new ModuleInfo("Device", "device.html"));
            DefaultMutableTreeNode n2_node4_b1 =
                    new DefaultMutableTreeNode(new ModuleInfo("Network", "network.html"));
            DefaultMutableTreeNode n3_node4_b1 =
                    new DefaultMutableTreeNode(new ModuleInfo("Users", "users.html"));
            node4_b1.add(n1_node4_b1);
            node4_b1.add(n2_node4_b1);
            node4_b1.add(n3_node4_b1);
            DefaultMutableTreeNode node5_b1 =
                    new DefaultMutableTreeNode(new ModuleInfo("Logging", "logging.html"));
            branch1.add(node1_b1);
            branch1.add(node2_b1);
            branch1.add(node3_b1);
            branch1.add(node4_b1);
            branch1.add(node5_b1);
             *          BRANCH 2           *
            //adding to the Second branch
            DefaultMutableTreeNode node1_b2 =
                    new DefaultMutableTreeNode(new ModuleInfo("Status", "status.html"));
                DefaultMutableTreeNode n1_node1_b2 =
                        new DefaultMutableTreeNode(new ModuleInfo("Device", "device.html"));
                DefaultMutableTreeNode n2_node1_b2 =
                        new DefaultMutableTreeNode(new ModuleInfo("Network", "network.html"));
                DefaultMutableTreeNode n3_node1_b2 =
                        new DefaultMutableTreeNode(new ModuleInfo("Chassis", "chassis.html"));
                DefaultMutableTreeNode n4_node1_b2 =
                        new DefaultMutableTreeNode(new ModuleInfo("Resources", "resources.html"));
                node1_b2.add(n1_node1_b2);
                node1_b2.add(n2_node1_b2);
                node1_b2.add(n3_node1_b2);
                node1_b2.add(n4_node1_b2);
            DefaultMutableTreeNode node2_b2=
                    new DefaultMutableTreeNode(new ModuleInfo("Project Editor", "projedit.html"));
            DefaultMutableTreeNode node3_b2=
                    new DefaultMutableTreeNode(new ModuleInfo("Project Manager", "projmngt.html"));
            DefaultMutableTreeNode node4_b2=
                    new DefaultMutableTreeNode(new ModuleInfo("Administration", "administration.html"));
                DefaultMutableTreeNode n1_node4_b2=
                        new DefaultMutableTreeNode(new ModuleInfo("Device", "device.html"));
                DefaultMutableTreeNode n2_node4_b2=
                        new DefaultMutableTreeNode(new ModuleInfo("Network", "network.html"));
                DefaultMutableTreeNode n3_node4_b2=
                        new DefaultMutableTreeNode(new ModuleInfo("Users", "users.html"));
                node4_b2.add(n1_node4_b2);
                node4_b2.add(n2_node4_b2);
                node4_b2.add(n3_node4_b2);
            DefaultMutableTreeNode node5_b2=
                    new DefaultMutableTreeNode(new ModuleInfo("Logging", "logging.html"));
            branch2.add(node1_b2);
            branch2.add(node2_b2);
            branch2.add(node3_b2);
            branch2.add(node4_b2);
            branch2.add(node5_b2);
             *          BRANCH 3           *
            //adding to the Third branch
            DefaultMutableTreeNode node1_b3=new DefaultMutableTreeNode("Status");
            DefaultMutableTreeNode n1_node1_b3=new DefaultMutableTreeNode("Device");
            DefaultMutableTreeNode n2_node1_b3=new DefaultMutableTreeNode("Network");
            DefaultMutableTreeNode n3_node1_b3=new DefaultMutableTreeNode("Chassis");
            DefaultMutableTreeNode n4_node1_b3=new DefaultMutableTreeNode("Resources");
            node1_b3.add(n1_node1_b3);
            node1_b3.add(n2_node1_b3);
            node1_b3.add(n3_node1_b3);
            node1_b3.add(n4_node1_b3);
            DefaultMutableTreeNode node2_b3=new DefaultMutableTreeNode("Project Editor");
            DefaultMutableTreeNode node3_b3=new DefaultMutableTreeNode("Project Manager");
            DefaultMutableTreeNode node4_b3=new DefaultMutableTreeNode("Administration");
            DefaultMutableTreeNode n1_node4_b3=new DefaultMutableTreeNode("Device");
            DefaultMutableTreeNode n2_node4_b3=new DefaultMutableTreeNode("Network");
            DefaultMutableTreeNode n3_node4_b3=new DefaultMutableTreeNode("Users");
            node4_b3.add(n1_node4_b3);
            node4_b3.add(n2_node4_b3);
            node4_b3.add(n3_node4_b3);
            DefaultMutableTreeNode node5_b3=new DefaultMutableTreeNode("Logging");
            branch3.add(node1_b3);
            branch3.add(node2_b3);
            branch3.add(node3_b3);
            branch3.add(node4_b3);
            branch3.add(node5_b3);
            tree=new JTree(top,true);
            //tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
            tree.getSelectionModel().setSelectionMode(TreeSelectionModel.CONTIGUOUS_TREE_SELECTION);
            //Set the icon for leaf nodes.       
            ImageIcon deviceIcon = createImageIcon("/device.gif");       
            if (deviceIcon != null)
                DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
                renderer.setLeafIcon(deviceIcon);
                tree.setCellRenderer(renderer);
            else
                System.err.println("Leaf icon missing; using default.");
            //Listen for when the selection changes.
            tree.addTreeSelectionListener(this);
            //Create the scroll pane and add the tree to it.
            //JScrollPane treeView = new JScrollPane(tree);
            tree.setToolTipText(" and ");
            lPane.add(tree);
            getContentPane().add(lPane);
            //  ****************  end  JTree  ******************//
            htmlPane = new JEditorPane();
            htmlPane.setEditable(false);       
            initHelp();
            JScrollPane rPane = new JScrollPane(htmlPane);
            JSplitPane jsp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, lPane, rPane);
            jsp.setDividerLocation(180);
            getContentPane().add(jsp, BorderLayout.CENTER);
            JPanel bPane = new JPanel();
            JButton okButton = new JButton("Ok");
            JButton applyButton = new JButton("Apply");
            JButton clearButton = new JButton("Clear");
            bPane.add(okButton);
            bPane.add(applyButton);
            bPane.add(clearButton);
            getContentPane().add(bPane, BorderLayout.SOUTH);
            setVisible(true);
        /** Required by TreeSelectionListener interface. */
        public void valueChanged(TreeSelectionEvent e)
            DefaultMutableTreeNode node = (DefaultMutableTreeNode)
            tree.getLastSelectedPathComponent();
            if (node == null) return;
            Object nodeInfo = node.getUserObject();
            if (node.isLeaf())
                ModuleInfo module = (ModuleInfo)nodeInfo;
                displayURL(module.moduleURL);
                if (DEBUG)
                    System.out.print(module.moduleURL + ":  \n    ");
            else
                displayURL(helpURL);
            if (DEBUG)
                System.out.println(nodeInfo.toString());
        private class ModuleInfo
            public String deviceName;
            public URL moduleURL;
            public ModuleInfo(String device, String filename)
                deviceName = device;
                moduleURL = (URL)Example.class.getResource("/" + filename);
                if (moduleURL == null)
                    System.err.println("Couldn't find file: "
                            + filename);
            public String toString()
                return deviceName;
        private void initHelp()
            String s = "YFDemoHelp.html";
            helpURL = Example.class.getResource("/" + s);
            if (helpURL == null)
                System.err.println("Couldn't open help file: " + s);
            else if (DEBUG)
                System.out.println("Help URL is " + helpURL);
            displayURL(helpURL);
        private void displayURL(URL url)
            try
                if (url != null)
                    htmlPane.setPage(url);
                else
                { //null url
                    htmlPane.setText("File Not Found");
                    if (DEBUG)
                        System.out.println("Attempted to display a null URL.");
            catch (IOException e)
                System.err.println("Attempted to read a bad URL: " + url);
        /** Returns an ImageIcon, or null if the path was invalid. */
        protected static ImageIcon createImageIcon(String path)
            java.net.URL imgURL = Example.class.getResource(path);
            if (imgURL != null)
                return new ImageIcon(imgURL);
            else
                System.err.println("Couldn't find file: " + path);
                return null;
        public static void main(String args[])
            new Example();
            //new AssistiveExample();
    }Thanks orozcom

    yes i can at the time of MIRO u can see both
    go in SU01 for and user
    in Parameters enter IVFIDISPLAY in Parameter ID and X in Paramater Value
    thus for that user u will be able to c Invoice number and accounting number after saving MIRo
    u will get message like
    Invoice document 5105608893 was posted ( Accountng Documnt: 5100000000 )
    hope this helps

  • Text file parsing and output

    Hi,
    I'm extremely new to Java and need to read and parse a text file and generate a new text file with modifications as follows:
    1. Ignore and rewrite comments
    2. Ignore and rewrite compiler commands
    3. (a) Modify function prototypes be removing their return values, if any,
    (b) append an '_VAR' to the function name and args
    (c) add an ampersand to the args when passed by reference
    sample input file:
    /***** comment *****/
    #if (INCLUDE_STATIC_BUILD == OS_FALSE)
    extern OS_MEMORY_POOL *MEM_Non_Cached;
    #endif
    UINT16 TLS_IP_Check (const UINT16 *s, UINT16 len);
    INT32 MEM_Copy_Data(NET_BUFFER buf_ptr, const CHAR HUGE buffer, INT32 numbytes, UINT16 flags);
    sample output file:
    /***** comment *****/
    #if (INCLUDE_STATIC_BUILD == OS_FALSE)
    extern OS_MEMORY_POOL *MEM_Non_Cached;
    #endif
    UINT16_VAR = TLS_IP_Check (&UINT16_VAR, UINT16_VAR);
    INT32_VAR = MEM_Copy_Data(&NET_BUFFER_VAR, name, INT32_VAR, UINT16_VAR);
    I would appreciate any help!
    Thanks.

    Check replies on the other post
    http://forum.java.sun.com/thread.jspa?threadID=680728&tstart=0

Maybe you are looking for

  • Syntax error in program "SAPLOCS_LOG ". for SPAM

    Hi  Team , I have updated SPAM from 730 45 to 730 51 after that i am trying to update SPS from spam , it is throwing the  below error . Category           ABAP Programming Error Runtime Errors     SYNTAX_ERROR ABAP Program       SAPLOCS_LOG Applicati

  • I can't send a photo by text - New user, Blackberry Torch 9800

    I recently started using the Blackberry Torch 9800 and I'm still getting the hang of things. This means I'm at the stage where i'm still accidentally muting myself while i leave a phone message or putting people on hold with my ear.  If anyone has a

  • How to add a Link with children in the SuiteLink bar?

    Hello, I have developed a code to add a new link in the SuiteLink bar using delegate control that works as expected. Now I want to include a new link but with children, I have tried many options in my code but with not luck. What I need in the SuiteL

  • Universal Adapter- CRM load is failing

    Hi friends, Recently had a successful load for the following SA in my DAC *) Human Resources. *) Finance. *) Supply Chain Mgmt. *) Procurement and Spend. *) Projects. Since all the above SA are in the ORA_R1213 Adaptor. After the successful load im i

  • Extra material to be created

    hi suppose my production order qty is 10 for fert,but after quality inspection ,2 materials were rejected ,it is not fixed.so i want to post it as scrap.for this iam planing to create new materail type and with new materail.the scrap qty i will post