Probably Simple XML toString

I've been trying to convert an xml document to a string, but I'm having a problem converting. I'm reading the XML from a file.
Document document = builder.parse(new File(filename));
And I'm sure that works. I can parse the result. But then I try to return what I've read using:
return (document.toString());
Every attempt I've made at using toString() has failed; even when I just try to write it out. What's the trick?

I don't think that is right way of doing it, try it out this way:
Document document;
TransformerFactory tFactory =
                TransformerFactory.newInstance();
                        Transformer transformer = tFactory.newTransformer();
            DOMSource source = new DOMSource(document);
            StringWriter sw=new StringWriter();
            StreamResult result = new StreamResult(sw);
            transformer.transform(source, result);
String xmlString=sw.toString();Message was edited by:
java_queen

Similar Messages

  • Simple xml config file

    I have created a simple config file using something like:
          XMLEncoder e = new XMLEncoder(
                                      new BufferedOutputStream(
                                          new FileOutputStream("Config.xml")));
          e.writeObject(base.toString());
          e.writeObject(numberFrom);
          e.writeObject(numberTo);
          e.writeObject(numberPad);
          e.writeObject(maxTasks);
          e.writeObject(maxSubTasks);
          e.writeObject(textFrom);
          e.writeObject(textTo);
          e.close();which produces a file like:
    <?xml version="1.0" encoding="UTF-8"?>
    <java version="1.4.2_05" class="java.beans.XMLDecoder">
    <string>C:\</string>
    <int>1</int>
    <int>20</int>
    <int>2</int>
    <int>0</int>
    <int>1</int>
    <string>a</string>
    <string>z</string>
    </java> I want to make it a bit more version proof so need to get something more like:
    <?xml version="1.0" encoding="UTF-8"?>
    <program name=myprog>
    <dir>C:\</dir>
    <version>1</version>
    <myval1>20</myval1>
    <myval2>2</myval2>
    </program>There's probably loads of errors in that bit;) but you get the idea. I'm a bit new to xml programming.
    Can anyone give me any urls of help or examples that might do this?
    Thanks,
    David.

    You could use a binding api such as JAXB or xmlbeans. In essence these apis abstract the xml as pure java objects. Alternatively you could use an xml parser such as dom4j and build the XML 'by hand'. This class will create an example config file and write it to the file system
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileWriter;
    import java.io.IOException;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.apache.xml.serialize.OutputFormat;
    import org.apache.xml.serialize.XMLSerializer;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Text;
    * Class to create a simple xml config file using W3C api
    * @author wollnyj
    public class CreateConfig {
         * create the config file
         *?xml version="1.0" encoding="UTF-8"?>
         *<program name=myprog>
         *    <dir>C:\</dir>
         *    <version>1</version>
         *    <myval1>20</myval1>
         *    <myval2>2</myval2>
         *</program>
         * @param configFile
         * @throws ParserConfigurationException
         * @throws IOException
        public CreateConfig(String configFile) throws ParserConfigurationException, IOException {
            //Document doc = parseXml(configFile);
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            Document doc = factory.newDocumentBuilder().newDocument();
            Element program = doc.createElement("program");
            program.setAttribute("name","myprog");
            Element dir = createEle("dir","c:\\",doc);
            Element version = createEle("version","1",doc);
            Element val1 = createEle("myval1","20",doc);
            // etc...
            program.appendChild(dir);
            program.appendChild(version);
            program.appendChild(val1);
            doc.appendChild(program);
            write(doc,new File(configFile));
         * @param args
         * @throws Exception
        public static void main(String[]args) throws Exception {
            CreateConfig create = new CreateConfig("F:\\config.xml");
         * Write an xml document to the file system
         * @param document The document to be written
         * @param xmlFile The output file
         * @throws IOException The file does not exist or could not be created
        private void write(Document document, File xmlFile) throws IOException {
            OutputFormat format = new OutputFormat(document);
            format.setIndent(4);
            format.setLineSeparator(System.getProperty("line.separator"));
            format.setLineWidth(80);
            FileWriter writer = new FileWriter(xmlFile);
            XMLSerializer fileSerial = new XMLSerializer(new BufferedWriter(writer), format);
            fileSerial.asDOMSerializer();
            fileSerial.serialize(document);
        private Element createEle(String name, String value, Document doc) {
            Element ele = doc.createElement(name);
            Text textNode = doc.createTextNode(value);
            ele.appendChild(textNode);
            return ele;
    }

  • Change over from a simple Xml call to a rpc-Http call ....

    Hi there,
    I need to change over from a simple Xml call:
    <mx:XML id="urlsGeneral" source="http://www.mySite.com//.../AFS.xml"/>
    to a rpc-Http call which is updating the readout if Xml is changed at any time.
    I forgot to mention the most important item yet a very simple one: I need this only to be displayed in a title etc, and NOT a datagrid or else example below.
    title="{urlsGeneral.urlGeneral.(@name==0).age}
    I tried a lot today, but just can't get it right as the id="urlsGeneral" is always the problem.
    Any help would be appriciated !!! Thanks in advance. regards aktell2007
    <urlsGeneral>
    <urlGeneral>
    <name>Jim</name>
    <age>32</age>
    </urlGeneral>
    <urlGeneral>
    <name>Jim</name>
    <age>32</age>
    </urlGeneral>
    </urlsGeneral>
    Another call:
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    public var myData:ArrayCollection;
    protected function myHttpService_resultHandler(event:ResultEvent):void {
    myData = event.result.urlsGeneral.urlGeneral;
    ]]>
    </mx:Script>
    <mx:HTTPService
    id="myHttpService"
    url="http://www.mySite.com//..../AFS.xml"
    result="myHttpService_resultHandler(event)"/>
    Preferable I wanted something like this to work:
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.FaultEvent;
    import mx.managers.CursorManager;
    import mx.controls.Alert;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.xml.SimpleXMLDecoder;
    // Don't use here as it is already used in .swc !
    /* import mx.rpc.http.HTTPService; */
    private var myHTTP:HTTPService;
    private function initConfigCall():void {
    myHTTP = new HTTPService();
    myHTTP.url = "com/assets/data/changesAppAIRPIOne001.xml";
    myHTTP.send();
    myHTTP.resultFormat = "xml";
    myHTTP.addEventListener(ResultEvent.RESULT, resultHandler);
    myHTTP.addEventListener(FaultEvent.FAULT, faultHandler);
    CursorManager.setBusyCursor();
    private function resultHandler(evt:ResultEvent):void {
    var xmlStr:String = evt.result.toString();
    var xmlDoc:XMLDocument = new XMLDocument(xmlStr);
    var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(true);
    var resultObj:Object = decoder.decodeXML(xmlDoc);
    // Removed [0] on single node !
    appUpdateAvl.text = resultObj.application.configApp.appNewUpDate;
    appLastChanged.text = resultObj.application.configApp.appLastChanged;
    appChangedSections.text = resultObj.application.configApp.appChangedSections;
    CursorManager.removeBusyCursor();
    myHTTP.disconnect();
    private function faultHandler(event:mx.rpc.events.FaultEvent):void {
    var faultInfo:String="fault details: "+event.fault.faultDetail+"\n\n";
    faultInfo+="fault faultString: "+event.fault.faultString+"\n\n";
    mx.controls.Alert.show(faultInfo,"Fault Information");
    var eventInfo:String="event target: "+event.target+"\n\n";
    eventInfo+="event type: "+event.type+"\n\n";
    mx.controls.Alert.show(eventInfo,"Event Information");
    CursorManager.removeBusyCursor();
    myHTTP.disconnect();
    ]]>
    </mx:Script>

    Hi again,
    These days there are more quetions than answeres on any forum, and very seldom anybody shares the answer if they lucky enough to work it out so here is my answer for the above question
    Change over from a simple Xml call to a rpc-Http call ....
    I had it all along as a commend noted: // Removed [0] on single node !
    So instead of title="{urlsGeneral.urlGeneral.(@name==0).age} it would be now title="{resultObj.urlsGeneral.urlGeneral.[0].age} and now it works perfectly well. I hope that one or the other of you can use the answer and the code !!! regards aktell2007

  • XML toString method not working as expected.

    Why is the XML.toString method inconsistant?
    var xml:XML = new XML( "<root/>" );
    var xml_withtext:XML = new XML( "<root>a</root>" );
    var xml_withchild:XML = new XML( "<root><child/></root>" );
    trace(xml.toString()); //traces "" (blank)
    trace(xml_withtext.toString()); //traces "a"
    trace(xml_withchild.toString()); //traces "<root><child/></root>"
    If the XML contains only a root node, toString prints nothing.  When it contains text, it prints the text.  That would make sense if toString was printing only the contents of the root node, but if the root node contains a child, it doesn't print "<child/>" as one would expect.  Instead, it suddenly includes the root node as well in the string.  That is inconsistant/unexpected.  For some reason, there is also a separate toXMLString method that consistantly prints the entire XML structure.  Was that some kind of patch since toString doesn't work in a consistant manner, instead opting to sometimes include the root node depending on whether it contains simple or complex content?

    Andrei1:
    1. No, it's not what it is.  No, there aren't hundreds of reasons/dependencies why more descriptive or intuitive conventions are not chosen. In this case, the reason (singular) is spelled out in the E4X spec, and it basically boils down to them naively thinking it would be easier for programmers if the node would just magically return text if that's all it contains.  In other words, they thought it would be simpler for a node to run specialized arbitrary logic to decide what to return, than it would for a programmer to explicitly select what they want by typing ".text".  I see no reason why XML.toString should return anything other than the underlying/original string of characters that originally represented the node in the first place.  If programmers wanted the child text of a node, they should call a method like "getTextContent".  Since an original, unaltered string of XML character had to exist in the first place in order to instantiate an XML object, anything that creates a new string based on arbitrary logic, for whatever reason, has no business existing within the toString method.  For classes that represent data that is not fundamentally a string, any string representation is by definition arbitrary and in that case they can override the universal (i.e. a member of every base Object) toString method.  But for classes that represent strings, toString should return the string they represent, unaltered.
    2.  An AS3 XML object IS an XML-type object, but the AS3 XML class is actually instantiated from String-type data or from  bytes that represent encoded String data (i.e. sequences of known  characters), because XML is very strictly and fundamentally a "markup language" which is essentially a format of a string of characters.  Its rules are based around characters, exact unicode character classes, and a logical ordering of those characters.  XML is logically and fundamentally the kind of data that a String class represents, text, so its converstion to a String instance should be straightforward.   As a string, a "toString" method for a node should return the original string representation of that node from the first character that is part of that XML node to the last character that is part of that node.  XML may contain data the represents anything, but XML itself is a string of characters.  Period.
    3.  There is a universal string method called toString and it's a member of the most basic class "Object" which all other classes inherit from.  Although the technical details are different in different object-oriented langauges, they all tend to have a method like that, whether we're talking about AS3, C#, Java, or JavaScript.  Calling toString on a String returns the string itself.  Calling toString on a class that represents a string, should return the string it represents; not some arbitrary tranformation of that string.  Calling toString on a class that doesn't represent a string, has no default string representation to return, and therefore any string returned is by definition arbitrary.
    4.
    In other words toString() does not return XML at all but an un-interpreted representation that is cast to String
    That's precisely what it DOESN'T do.  Instead of returning the original, un-interpretted representation of the string FROM WHICH THE NODE WAS CONSTRUCTED, it returns some arbitrarily interpretted represention.  It decides whether the XML string is interpretted as complex or simple content, and then it arbitrarily decides to include or not include the outermost tags representing the XML of that node.  The fact remains, the string representation PRECEDES the existance of the XML instance, so toString should not be performing arbitrary logic to construct a brand new string.
    In other languages datatype string can be a totally different animal.
    No, actually a string always refers to a secquence of characters.  Each of those character may contain one or more bytes, they may be contiguous in memory or not, they may be represented by arrays, linked lists, doubly-linked lists, etc. but their logical data is always a sequence of characters.  That is the same in every programming language, and is even codified in the Unicode standards which represents characters in hundreds of different written languages.
    5.
    Again, XML is not a string until application says so and XML in AS3 is not a String but a special object.
    XML is actually a string BEFORE the application says it is XML, since the XML is constructed FROM A STRING.  XML is a special object, which is constructed from, represents, and processes a string.
    I could very easily create a class named "AllCapsSentence" and like "XML", the class itself is not "String", but they logically represent a string of characters and any "toString" method on either of such classes should return the underlying string representation without mangling it.

  • How to create simple XML database in oracle 11g

    Hi,
    what are the steps to followed to create a simeple custormer XML database.
    Like storing .xml file into XMLType, writing simple xml schema.....like that
    how to register the .xsd
    how to insert the xml data
    how to querying the the data base with xquery
    Thanks in Advance

    Have a look a the FAQ on the main page of this XMLDB forum. That's a good source to start (besides the XMLDB Developer Guide manual).

  • Flat File to simple XML structure in Mail Sender Adapter

    Hi,
    I have a scenario, where I want to put the content of a flat file (text, no csv or similar), which is an attachement of an e-mail, into a simple XML structure: entire file content as content of one XML tag. E.g.:
    file content:
    "abcdefgh"
    xml file:
    <root>
      <content>abcdefgh</content>
    </root>
    Do I need to use MessageTransformBean? Or is there an easiert way?
    Thanks,
    Torsten

    Hi Dirk,
    When we use MessageTransform, we can use ContentDisposition to specify, as to whether the payload has to go as an attachment or inline(as the mail itself.)
    It could also be a text file. Right?
    Just take a look at this..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm
    cheers,
    Prashanth

  • Creating a very simple XML-driven gallery

    Hi, I'm learning XML in AS3 and I am having real trouble finding a resource that can help me learn how to build a very simple XML-driven picture gallery.
    I am working in an FLA file with AS3, with a dynamic text field with the instance name "textfield". I also have a UILoader Component with the instance name "UILoaderComponent" and an XML file called "rootdir.xml".
    I have an XML file in the following format.
    <images>
         <imagenames>
              <name>image1</name>
              <name>image2</name>
              <name>image3</name>
              <name>image4</name>
              <name>image5</name>
         </imagenames>
         <imagepaths>
              <path>image1.jpg</path>
              <path>image2.jpg</path>
              <path>image3.jpg</path>
              <path>image4.jpg</path>
              <path>image5.jpg</path>
         </imagepaths>
    </images>
    I am using the following as my actionscript.
    var xmlLoader:URLLoader = new URLLoader();
    var xmlData:XML = new XML();
    xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
    xmlLoader.load(new URLRequest("rootdir.xml"));
    function LoadXML(e:Event):void {
    xmlData = new XML(e.target.data);
    parseImg(xmlData);
    function parseImg(imgLoad:XML):void {
    var imgChild:XMLList = imgLoad.images.children();
    for each (var imgTrace:XML in imgChild) {
    trace(imgTrace);
    No matter which way I experiment, I always have poor results with my dynamic text, and every tutorial I've followed does not reproduce anything like the same returned data in "textfield" that it does with the trace command.
    My objective is: I simply want to build a menu inside a textbox called "textfield" that lists images1-5, and when clicked, calls upon the relevant image. For instance: I load the file "rootdir.xml" into the file "index.fla". I call a function to parse the XML into a dynamic text box called "textfield". When image 2 is clicked on the textbox "textfield", it would call upon a function that would load into the UIComponent Loader "image2.jpg".
    Are there any tutorials for this? I'm so confused as to why dynamic text operates so differently from the trace command. I'm not interested in doing a fancy menu bar with thumbnails, scrollbars and animations, I just want to learn the basics.

    I don't really see how you are getting a valid trace out of that code (I get nothing if I try it as is), but as far as the textfield goes, you haven't shown any attempt in your code that might help to point to why you cannot get the text into a textfield.  It might be a problem with how you are trying to write to the textfield and not how your are manipulating the data.
    While you could make use of a textfield for the menu, doing so is not straightforward, as you would need to implement htmlText with special coding in order to have the text clickable.  You might consider using a List component or ComboBox instead.
    What I always do when I am working with xml is to store the data into a data structure, usually an array conatining objects, and then make use of that structure rather than dippng into the xml data itself when I utilize the data.
    Another thing, which rquigley demonstrated, is that your xml will serve its purpose better if the data for each image is collected under the same node.  If you have separate sections for each piece of data like you have, when it comes to editing it will be more prone to error as you have to be sure you are editing the correct entry of each separate group.
    I too am no expert in the world of xml, but I have not yet worked with parameters inside the tags, so I would usually structure it as...
    <images>
       <image>
           <imgName>image 1</imgName>
           <imgPath>image1.jpg</imgPath>
       </image>
       <image>
           <imgName>image 2</imgName>
           <imgPath>image2.jpg</imgPath>
       </image>
    </images>
    Now, back to what you have...  let's say you have a textField named imgText that you want to list the image names in.  The following should work, though I do not go my usual route of storing the data into an object array first...
    function parseImg(imgLoad:XML):void {
       var imgNames:XMLList = imgLoad.imagenames.name;
       var imgPaths:XMLList = imgLoad.imagepaths.path;
       // show name
       for each (var nameTrace:XML in imgNames) {
          trace(nameTrace);
          imgText.appendText(nameTrace +"\n");
       // show path
       for each (var pathTrace:XML in imgPaths) {
          trace(pathTrace);
          imgText.appendText(pathTrace +"\n");
       // show name and path
       for(var i:uint=0; i<imgNames.length(); i++){
          trace(imgNames[i].text()+"  "+imgPaths[i].text());
          imgText.appendText(imgNames[i].text()+"  "+imgPaths[i].text() +"\n");

  • Simple XML Editor

    Is there a simple, FREE, XML editor out there (written in Java)?
    I am using an XML file format for a small application I wrote, and I would prefer to edit the file using an XML editor, since it is easy to screw up the file in a text editor.
    If you've used Forte or Netbeans, all I want is a simple XML editor like the one that is built into the IDE.
    Thanks for any information.

    Vim works pretty good, its free, and has syntax highlighting. You would need to be familiar with using vi. http://www.vim.org/
    If you use Eclipse, you can get http://www.oxygenxml.com/. It's not free, but its cheaper than XMLSpy.
    I haven't found anything better than XMLSpy, even though its expensive.
    Does anyone know of another tool that can generate a sample instance document from a schema, and/or a schema from an instance document? I find that handy in XMLSpy.
    -Scott
    http://www.swiftradius.com

  • Covnert Complex XML to Simple XML tags using Adapter Module

    Hi
    <buyer>
    <fnParty:partyIdentifier partyIdentifier="GER" partyIdentifierQualifierCode="SenderAssigned"/>
    </buyer>
    I want to convert above complex xml into following simple xml document
    <buyer>GER</buyer>
    I am writing adapter module. Could any one please tell me how to convert this
    Regards
    Sowmya

    Hi,
    Is partyidentifier is source xml and buyer in target xml?
    You can map the attribute to buyer element in message mapping itself.
    Why do you want adapter module?
    Thanks,
    Beena.

  • How can we convert soap wrapped xml to simple xml?

    I am getting a soap wrapped xml as payload to JMS in JMS queue and need to convert that into a simple xml. Can anyone please suggest how this can be done? I am adding the xml as an attachment.
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:header="http://wsi.nat.bt.com/2005/06/StandardHeader/">
    <SOAP-ENV:Body>
    <setupXMLDataAcquisitionRequest xmlns="http://capabilities.nat.bt.com/xsd/ManageMISDataAcquisition/2007/06/30" xmlns:S18="http://capabilities.nat.bt.com/xsd/ManageMISDataAcquisition/2007/06/30/CCM/Activities" xmlns:S70="http://capabilities.nat.bt.com/xsd/ManageMISDataAcquisition/2007/06/30/CCM/Events" xmlns:S78="http://capabilities.nat.bt.com/xsd/ManageMISDataAcquisition/2007/06/30/CCM/Incidents" xsi:schemaLocation="http://capabilities.nat.bt.com/xsd/ManageMISDataAcquisition/2007/06/30
    D:\Jay_137788\OffshoreCode\WSDLandXSD\WSDLandXSD\ManageMISDataAcquisition.20070630.xsd">
    <header:standardHeader>
    <header:e2e>
    <header:E2EDATA>e2EData</header:E2EDATA>
    </header:e2e>
    <header:serviceState>
    <header:stateCode>OK</header:stateCode>
    </header:serviceState>
    <header:serviceAddressing>
    <header:from>http://ccm.intra.bt.com/neo</header:from>
    <header:to>
    <header:address>http://ccm.intra.bt.com/orbit</header:address>
    <header:contextItemList>
    <header:contextItem contextId="http://ccm.intra.bt.neo" contextName="serviceType">WLR</header:contextItem>
    </header:contextItemList>
    </header:to>
    <header:messageId>http://ccm.intra.bt.com/neo/manageMISDataAcquasition/EC9DB800-5C5F-11DC-AECA-E60BE61DBC5B</header:messageId>
    <header:serviceName>http://ccm.intra.bt.com/manageMISDataAcquasition</header:serviceName>
    <header:action>http://ccm.intra.bt.com/manageMISDataAcquasition/2007/08#problemMISEventNotification</header:action>
    </header:serviceAddressing>
    <header:serviceSpecification>
    <header:payloadFormat>XML</header:payloadFormat>
    <header:version>1.0</header:version>
    </header:serviceSpecification>
    </header:standardHeader>
    <activity>
    <S18:Event>
    <S70:id>KPI.SA.dispatchActionItem</S70:id>
    <S70:eventDateTime>2007-09-06T15:29:56</S70:eventDateTime>
    </S18:Event>
    <S18:activityId>000000109</S18:activityId>
    <S18:activityType>WFT</S18:activityType>
    <S18:activityCode>BBHC5</S18:activityCode>
    <S18:activityStatus>Not Started</S18:activityStatus>
    <S18:activityCondition>Not Started-Dispatch</S18:activityCondition>
    <S18:activityDateCreated>2007-09-06T16:30:36</S18:activityDateCreated>
    <S18:activityDateCompleted>1753-01-01T00:00:00</S18:activityDateCompleted>
    <S18:activityQueueID>ASG</S18:activityQueueID>
    <S18:activityNote>
    <S18:comment>Customer Apparatus SFI for BBHC5</S18:comment>
    </S18:activityNote>
    <S18:activityOwner>sa</S18:activityOwner>
    <S18:activityAccessURL />
    <S18:faultIdentifier>
                                                 <S78:name>faultId</S78:name>
                                                 <S78:value>NeoSAC00000041</S78:value>
    </S18:faultIdentifier>
    <S18:activityRelatedTo>Action Request</S18:activityRelatedTo>
    </activity>
    </setupXMLDataAcquisitionRequest>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    I take that to mean "Yes" to the first question and a failure to answer the second.
    I don't know anything about SOAP, but that shouldn't matter because you're just asking a general question about XML. I assume that "the message in the body" must correspond to something in that XML you posted? Right? When I look at it I don't see anything that looks much like a message, but then I don't know anything about SOAP.

  • Fail to load Simple XML

    Hi Guys,
    Can any one help me loading a simple XML file into a Select list on JSP page. I found many examples but unable to load it the way I wanted it. I have a XML file with contents as;
    <examples>
    <example name='abc'>value here can be complete new xml document as well as a simple text and I want both to be shown in select list as 'text'</example>
    <example name='def'>value here can be complete new xml document as well as a simple text and I want both to be shown in select list as 'text'</example>
    <example name='ghe'>value here can be complete new xml document as well as a simple text and I want both to be shown in select list as 'text'</example>
    </examples>
    Now I want to parse this xml in my 'Select' HTML component in a way that I want the value of the element *<example>* (which can be a simple string or complete new XML (but I do not want to parse that XML and put it in a Select option as it is) and attribute name in each element/node as 'title' of the option in Select box just to provide some more info to user.
    Let me know if you guys need more information on this.
    Thanks,
    SJunejo

    There are many frameworks (castor, xmlbeans, jaxb etc) that helps you convert an xml to an object with corresponding properties. If you then place such an object in the proper scope, you can use a jsp (and jstl) easily to build your select tag.
    Or you can do it all by yourself - use an api like dom and extract the data into String objects and build up your own data Container to hold multiple String text and once again use jsp/jstl to build your tag.
    cheers,
    ram.

  • Writing a simple XML editor

    I need to write a simple XML/SVG code editor for my application. I basically want to display the contents of an XML DOM so that if the user changes the text in the editor the DOM will be updated to reflect this.
    What would be the best way to do this?

    http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=XML+SVG+site%3Asourceforge.net

  • Macbook pro will not restart to download update instead goes straight to download? macbook pro will not restart to download update instead goes straight to update download probably simple setting prob but i dont know can some on help me i just replaced a

    Macbook pro will not restart to download update instead goes straight to download?
    macbook pro will not restart to download update instead goes straight to update download probably simple setting prob but i dont know can some on help me i just replaced a dieing hard drive and and im running on 08 software pleas help

    i replaced my hard drive and put osz back on now im trying to update but will not update supost to restart then update but instead of restarting it goeses to update and i have to shut it down pleas ignore typos im trippen

  • Simple XML DOM Example Needed.

    I need a simple XML DOM Example that reads in the XML and makes objects out of the elements. The tutorial from sun is very sketchy and seems to good far too quickly.
    Thanks,
    Dave.

    You can find some examples:
    http://java.sun.com/xml/jaxp/dist/1.0.1/examples/#building
    http://newinstance.com/writing/javaxml2/javaxml2_examples.html
    http://www.docuverse.com/domsdk/index.html#tutorial
    http://www.devx.com/sourcebank/search.asp

  • DEBMDM06 based Idocs: Simple XML Vs Complex XML

    The idocs we extracted from ECC "mdmc" Tcode based on DEBMDM type. Are they simple XML or Complex XML?? because we operate on AIX and according to IM referecne guide AIX does not support Complex XML via Import server

    Ok, it is not Complex type, based on Reference guide, and also couple of other posts!.

Maybe you are looking for