How to create/call dynamic XML feed from CFC - HELP PLEASE!!

Hi All,
First off I'm a newb to web services.  I'm trying to create the invoke a web service on a CFC for a XML feed.  When I call the CFC directly all looks fine and is correctly formatted etc:
http://www.prevu.tv/cfc/xyzTest.cfc?method=listPlant
Am I correct in outputting it in this way?  What if I output as a string instead......would others be able to consume it?
When I try to invoke it as a web service I am getting an error I do not understand.  I am trying to call it using (user/pass not required in CFC):
<cfinvoke webservice="test" method="listPlant" returnvariable="foo">
<cfinvokeargument name="username" value="abc">
<cfinvokeargument name="password" value="123">
</cfinvoke>
<cfoutput><cfdump var="#foo#"></cfoutput>
Here is my CFC code:
<cfcomponent>
    <cffunction name="listPlant" access="remote" returntype="xml" output="no">
    <cfargument name="username" type="string" required="no">
    <cfargument name="password" type="string" required="no">
        <cfquery datasource="#request.dsn#" name="getPlant">
        SELECT                *
        FROM                  plant
        INNER JOIN        plantaddress ON plant.plantID = plantaddress.plantID
        WHERE              icePlantID IS NULL
        AND                   categoryID NOT IN (9,10,11)
        AND                   statusID = 1
        AND                   activePlantList = 1
        ORDER BY        plant.plantID LIMIT 5
        </cfquery>
        <!---Convert Query to xml--->
        <cfprocessingdirective suppresswhitespace="Yes">
        <cfcontent type="text/xml; charset=utf-8">
        <cfxml variable="xmlobject">
        <PrevuPlant>
            <cfoutput query="getPlant">
            <Plant>
                <PlantID>#plantID#</PlantID>
                <PlantName>#XmlFormat(plantName)#</PlantName>
                <Street>#XmlFormat(street)#</Street>
                <Suburb>#XmlFormat(suburb)#</Suburb>   
                <City>#XmlFormat(city)#</City>
                <State>#XmlFormat(state)#</State>
                <Country>#XmlFormat(country)#</Country>
                <PostCode>#XmlFormat(postcode)#</PostCode>
                <Latitude>#XmlFormat(latitude)#</Latitude>
                <Longitude>#XmlFormat(longitude)#</Longitude>
                <CountryCode>#XmlFormat(countryCode)#</CountryCode>
                <AreaCode>#XmlFormat(areaCode)#</AreaCode>
                <Phone>#XmlFormat(phone)#</Phone>
                <Fax>#XmlFormat(fax)#</Fax>
            </Plant>
             </cfoutput> 
        </PrevuPlant>
        </cfxml>
        <!---Convert back to a string--->
        <cfset myvar=toString(xmlobject)>
        </cfprocessingdirective>
    <cfreturn myvar>
    </cffunction>
</cfcomponent>
Can anyone please tell me where I am going wrong, or how the output for a XML feed called from a CFC should look in a browser etc?
Thanks

Hey Dan....thanks for the prompt reply.
I added the wsdl and this is what I get when I call the service from this cfm page: http://www.prevu.tv/xyzTest.cfm
Have never seen output like this.  Is this correct?
The web service I'm writing is also for some .net developers so it may be that I need to output as string also - this discussion has not taken place yet.

Similar Messages

  • Tutorial Announcement .:: How to Create a Dynamic RSS Feeds  ::.

    .:: How to Create a Dynamic RSS Feeds ::.
    Using Adobe Dreamweaver 8 and InterAKT Rss Reader Writer Extension.
    Hello everyone...
    RSS feeds are very useful within sites, as they allow integrating for you website content in an automatic manner. Just share the source for the RSS feed, and when the original content changes, it will reflect in the content you share with any one who subscribed in this feeds on your site.
    In this tutorial i`ll help you integrate a RSS feed into one of your pages. This will display the content of your website to feeds subscribers with up to date content.
    The main purpose of this tutorial is to create a page that allows visitors subscribe to the RSS Feed that they want to see from your website content, or even enter their own in a text box by searching through feeds. also you can define feeds categories if your website is online store, merchant etc...
    :: Online Demo ::
    :: Go to tutorials ::
    Best Regards
    Waleed Barakat
    Developer-Online Creator and programmer
    http://www.developer-online.com

    Hey Waleed,
    thanks again for this great stuff -- and thanks for removing the login protection :-)
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • How can i call the xml report from oaf page

    Dear all
    i have oaf page in that page i need to call xml report from that oaf page
    how is posible.
    Regards
    Sreekanth

    refer this link http://apps2fusion.com/at/ps/260-integrating-xml-publisher-and-oa-framework
    --Prasanna                                                                                                                                                                                                                       

  • How to create a drag and drop video playlist Help please

    I would like to learn how to create a drag and drop video playlist.
    I think the most common example is youtube.
    I already have partial of the work but I am stuck with my preliminary knowledge of Flash.
    What I am saying is:
    I have a *.fla project that have the galleries for video and pictures.
    But this process is done from the back end.
    I would like to make it more dynamic for the visitors.
    For example:
    1. Create a visitor video (pictures) playlist
    2. Drag and drop into the playlist
    3. To be able to create different playlists (Playlist 1, "My favorite playlist", "Watch later", etc)
    If someone knows or want to guide me where or how to find this request, I'd appreciate it so much.
    If the forum think that this need to be address to a expertise ($). I am also welling to hear that and where to go.
    If someone is interesting in this project please send me a note to show the prelimary project.
    Thanks

    Yeah that is the general idea but that is more of a "lift and drop", i want to add the same thing as when you:
    Right click this window in the taskbar (assuming your using windows) when the window is not maximized and click "move" then it changes the cursor icon and allows u to move the window around and while you move it around it shows the window moving, not a click and release feature.
    So i want that ability without having to click on the title bar, if you know what i mean.

  • How to create a 'functioning' Multi angle track?   - Help Please

    hi all,
    i've spent almost three days working all the bugs out of a dvd with 10 multi angle tracks
    (thats 10 different tracks with two different angles each).
    after hours upon hours of tweaking i have it working fine in DVDSP simulator (perfect really, everything is so sweet!) only when I burn/build/format the project the multi-angle functionality is lost.
    i've tried the dvds on two different players, and two different computers, even the same mac i built the DVD on and the second angle just doesn't seem to exist?
    can anyone tell me if there is a setting i'm missing or... is the switching between angles something you can only do inside DVDSP simulator... some kind of bad joke on apple's part???
    please please pretty please - help!!!
    Message was edited by: claudia 639

    claudia 639 wrote:
    hi all,
    i've spent almost three days working all the bugs out of a dvd with 10 multi angle tracks
    (thats 10 different tracks with two different angles each).
    after hours upon hours of tweaking i have it working fine in DVDSP simulator (perfect really, everything is so sweet!) only when I burn/build/format the project the multi-angle functionality is lost.
    i've tried the dvds on two different players, and two different computers, even the same mac i built the DVD on and the second angle just doesn't seem to exist?
    can anyone tell me if there is a setting i'm missing or... is the switching between angles something you can only do inside DVDSP simulator... some kind of bad joke on apple's part???
    That's a very complex project to cut your multiangle chops on. Make a copy of the project and discard all but one of the tracks so you have something with fewer resources to juggle.
    I've done dozens of multiangle projects in DVDSP over many years since the featgure became available in, I think, DVDSPv2.5 or so, maybe v3. They all have worked without any hitches so we know there's nothing wrong with the software. There are two ways you can use the option but the most reliable is to have all angles exaactly the same length, to the frame.
    Assuming you have taken into account the bit rates required to hold all of your video assets on the single disk, I cannot think of anything that would disable or prevent multiangle from working since it is part of the basic DVD specification.
    If the alternate angle's resources are not being burned to disk, the multiangle function will not be active. You might be able to view the processing log to see if the names of your b-roll files are being processed at all.
    bogiesan

  • How to create a dynamic RTF report which creates dynamic columns based on dynamic column selection from a table?

    Hi All,
    Suppose I have table, whose structure changes frequently on daily basis.
    For eg. desc my_table gives you following column name on Day 1
    SQL > desc my_table;
    Output
    Name
    Age
    Phone
    On Day 2, two more columns are added, viz, Address and Salary.
    SQL > desc my_table;
    Output
    Name
    Age
    Phone
    Address
    Salary
    Now I want to create an Dynnamic RTF report which would fetch data from ALL columns from my_table on daily basis. For that I have defined a concurrent program with XML as output type and have attached a data template/data definition to it which takes in XML as input and gives final output of conc program in EXCEL layout. I am able to do this for constant number of columns, but dont know how to do it when the number of columns to be displayed changes dynamically.
    For Day 1 my XML file should be like this.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
    </group>
    </dataStructure>
    </dataTemplate>
    And my Day 1, EXCEL output from RTF template should be like this.
    Name     Age     Phone
    Swapnill     23     12345
    For Day 2 my XML file should be like this. With 2 new columns selected in SELECT clause.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    ,Address
    ,Salary
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
      <element name="Address" value="Address" />
      <element name="Salary" value="Salary" />
    </group>
    </dataStructure>
    </dataTemplate>
    And my Day 2, EXCEL output from RTF template should be like this.
    Name     Age     Phone     Address     Salary
    Swapnill     23     12345         Madrid     100000
    Now, I dont know below things.
    Make the XML dynamic as in on Day 1 there must be 3 columns in the SELECT statement and on Day 2, 5 columns. I want to create one dynamic XML which should not be required to be changed if new columns are added in my_table. I dont know how to create this query and also create their corresponding elements below.
    Make the RTF template dyanamic as in Day1 there must 3 columns in EXCEL output and on Day 2, 5 columns. I want to create a Dynamic RTF template which would show all the columns selected in Dynamic XML.I dont know how the RTF will create new XML tags and how it will know where to place it in the report. Means, I can create RTF template on Day 1, by loading XML data for 3 columns and placing 3 XML tags in template. But how will it create and place tags for new columns on Day 2?
    Hope, you got my requirement, its a challenging one. Please let me know how I can implement the required solution using RTF dynamically without any manual intervention.
    Regards,
    Swapnil K.
    Message was edited by: SwapnilK

    Hi All,
    I am able to fulfil above requirement. Now I am stuck at below point. Need your help!
    Is there any way to UPDATE the XML file attached to a Data Definition (XML Publisher > Data Definition) using a standard package or procedure call or may be an API from backend? I am creating an XML dynamically and I want to attach it to its Data Definition programmatically using SQL.
    Please let me know if there is any oracle functionality to do this.
    If not, please let me know the standard directories on application/database server where the XML files attached to Data Definitions are stored.
    For eg, /$APPL_TOP/ar/1.0/sql or something.
    Regards,
    Swapnil K.

  • How Do i Call An xml publissher and a jsper report from ADF pages

    Hi All
    How Do i Call An xml publissher and a jsper report from ADF pages

    I used the above links to create XML's and from there a formatted report of data from the database. I accomplish this by connecting to the database inside the XMLPublisher.java file. I also have my query hard-coded inside the DataTemplate.xml to extract the info from the database. This limits my ability on what the user can accomplish with the system.
    Is it possible to run my reports based on an iterator within Jdeveloper, as opposed to having to manually enter the query and connect to the database within the XMLPublisher.java file and the template.xml?
    Thanks.

  • How to create ArrayColletion in mx:Script from mx:Model id="results" source="/data/data.xml" /

    How to create ArrayColletion in mx:Script from <mx:Model
    id="results" source="/data/data.xml" />
    Please see my code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Model id="results" source="/data/data.xml" />
    <mx:Script>
    import mx.collections.ArrayCollection;
    import mx.utils.ArrayUtil;
    import mx.controls.Alert;
    </mx:Script>
    <mx:ArrayCollection id ="dt1"
    source="{ArrayUtil.toArray(results.result)}"/>
    <mx:Script><![CDATA[
    [Bindable]
    public var expenses:ArrayCollection = dt1;
    [Bindable]
    public var expenses2:ArrayCollection = dt1;
    [Bindable]
    public var dp:ArrayCollection=expenses;
    public function changeDataProvider():void{
    Alert.show(expenses.toString());
    if (dp==expenses){
    dp=expenses2;
    }else{
    dp=expenses;
    ]]></mx:Script>
    <mx:Panel x="10" y="10" width="100%" height="378"
    layout="absolute">
    <mx:ColumnChart dataProvider="{dt1}" x="10" y="10"
    id="myChart" height="318" width="100%">
    <mx:horizontalAxis>
    <mx:CategoryAxis categoryField="month"/>
    </mx:horizontalAxis>
    <mx:series>
    <mx:ColumnSeries displayName="apple" yField="apple"/>
    <mx:ColumnSeries displayName="orange"
    yField="orange"/>
    <mx:ColumnSeries displayName="banana"
    yField="banana"/>
    </mx:series>
    </mx:ColumnChart>
    <mx:Legend dataProvider="{myChart}" x="481" y="10"/>
    </mx:Panel>
    <mx:Button x="284" y="416" label="Change Data" id="bt"
    click="changeDataProvider()" />
    </mx:Application>

    Tracy,
    Thanks. That worked. However I have another related question:
    I convert the xml feed to a XMLListCollection by doing:
    <mx:XMLListCollection id="mission"
    source="{xmlFeed.lastResult.day}"/>
    and
    <mx:XMLListCollection id="mission1"
    source="{xmlFeed.lastResult.day.tBlock}"/>
    On the chart I have
    <mx:ColumnChart id="missionReadiness" height="150%"
    width="100%"
    paddingLeft="2" paddingRight="2"
    showDataTips="true" dataProvider="{mission1}">
    <mx:series>
    <mx:ColumnSeries xField="" yField="@today"
    displayName="Today"/>
    <mx:ColumnSeries xField="" yField="@tomorrow"
    displayName="Tomorrow"/>
    <mx:ColumnSeries xField="" yField="@afterT"
    displayName="After Tomorrow"/>
    </mx:series>
    </mx:ColumnChart>
    the yField works, but for the xField I want to have the @date
    but refers to the parent node, so I am clueless on how to refer to
    it.
    Also, I would like to display on the chart only the values to
    a specific date (like @date="05/17/2007").
    Any suggestions on how to do that?
    Gilbert

  • How to create a dynamic property in JavaFX

    public class Person() {
    private SimpleStringProperty _Name = new SimpleStringProperty();
    public final String NameGet() {
    return this._Name.getValue();
    public final void NameSet(String Name) {
    this._Name.setValue(ColumnName);
    public StringProperty NameProperty() {
    return this._Name;
    private SimpleStringProperty _SurName = new SimpleStringProperty();
    public final String SurNameGet() {
    return this._SurName.getValue();
    public final void SurNameSet(String SurName) {
    this._Name.setValue(ColumnName);
    public StringProperty SurNameProperty() {
    return this._SurName;
    How to create a dynamic property in JavaFX ?
    ObservableMap, ObservableMapValue, MapPropertyBase, MapProperty
    Which one should I use. Can you give an example?

    I'm not sure what you mean by "dynamic property"; can you be more explicit?
    Your code creates two properties that can be read, written, and observed for changes, though it's probably better to use the standard naming scheme for the methods (e.g they should be getName(), setName(...) and nameProperty()).
    An ObservableMap is an extension of the java.util.Map interface that can be observed; i.e. you can register a listener that will be notified if a key-value pair is added or removed from the map.
    ObservableMapValue is an interface that defines an observable reference to an ObservableMap; i.e. it has a get() method returning an ObservableMap and a set(...) method taking an ObservableMap. You can register a ChangeListener which is notified when the set(...) method is called. It additionally functions as an ObservableMap, so you can also register listeners that get notified when key-value pairs are added or removed from the underlying observable map.
    MapProperty and MapPropertyBase are effectively partial implementations of ObservableMapValue. SimpleMapProperty is a full implementation.
    If you just need a single ObservableMap (i.e. not an observable reference to one), then the FXCollections.observableHashMap() factory method will provide one.

  • How can I get the XML structure from a flat structure?

    Hi all,
    in my XI SP 12 I use a JMS adapter to read information using the WebSphereMQ transport protocol.
    The structure that I receive have this format:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value>
    <NumberRecordType_B><NumberRecordType_c>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    the problem is that in this structure each line is not separated by a carriage return or a comma, I have all the information in a single line:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value><NumberRecordType_B><NumberRecordType_c><Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>...<Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value><Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>...<Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    and the customer don't want to insert a line separator.
    Then, the question is:
    How can I get the XML structure from this structure?
    If possible, I don't want to develop new Module and add it in the JMS Module Sequence.
    PS I have already read the article "How to Use the Content Conversion Module with the XI 3 J2EE JMS Adapter.pdf" and it doesn't seem to help me.
    Best Regards,
    Paolo

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • How to create the dynamic report

    Hi,
    please help me, how to create the dynamic report

    Hi,
      Try this..
    DATA: p_temp(30)  TYPE c DEFAULT 'ZTEST_REPORT'.
    TYPES: BEGIN OF t_abapcode occurs 0,
            row(72) TYPE c,
           END OF t_abapcod.
    T_ABAPCODE-ROW = 'REPORT ZTEST_REPORT.'.
    APPEND T_ABAPCODE.
    T_ABAPCODE-ROW = 'WRITE: / ''TEST REPORT''. '.
    APPEND T_ABAPCODE.
    INSERT REPORT p_temp FROM it_abapcode.
          SUBMIT (p_temp) AND RETURN.
          DELETE REPORT p_temp.
    Thanks,
    naren

  • How can I call a plsql function from an attribute?

    I have an attribute defined in an element. I want execute a PLSQL function from the attribute, and display the returne value with an HTML template.
    I've defined the attribute's type like PLSQL, and I've put the called of the function in the value of the attribute, but it doesn't work. The only value I obtain is an URL (I think that is the URL of the function or someting like this).
    How can I call to my function from the attribute and display the returnes value in the page?
    Thanks.

    Thanks, but it doesn't work. I have an attribute called ID_BOL and I want to associate a sequence to that attribute. I've created a function, with the sequence. This function return de value of the sequence. I want taht the attribute takes the value of the sequenece dinamically.
    I've tried it, creating the type attribute like PLSQL, and calling the function from the attribute, but it doesn't work.
    How can I return the sequence value to my attribute?
    Thanks.

  • Can any one tell me how can i call a shell script from pl/sql

    i like to call shell script from pl/sql procedure.
    can any one suggest how can i do this

    Have you not mastered in asking the same kind of question ?
    First do write a script...
    no one will spoon feed you.
    How can i call a shell script from procedure
    How to call Shell Script from pl/sql block
    -Sk

  • How to create a dynamic mapping of columnar at the Runtime using ADF or JSF

    How to create a dynamic GUI at the Runtime using ADF or JSF in JDeveloper 11g.
    What I am trying to build is to allow the user to map one column to another at the run time.
    Say the column A has rows 1 to 10, and column B has rows 1 to 15.
    1. Allow the user to map rows of the two tables
    2. An dhte rows of the two columns are dynamically generated at the run time.
    Any help wil be appreciated.....
    Thnaks

    Oracle supports feedback form metalink was; "What you exactly want to approach is not possible in Htmldb"
    I can guess that it is not
    exactly possible since I looked at the forums and documantation etc. but
    couldnt find anything similar than this link; "http://www.oracle.com/technology/products/database/htmldb/howtos/tabular_form.h
    t". But this is a very common need and I thought that there must be at least a workaround?
    How can I talk or write to Html Db development team about this since any ideas, this is very important item in a critial project?
    I will be able to satisfy the need in a functional way if I could make the
    select lists in the tabular form dynamic with the noz_id;
    SELECT vozellik "Özellik",
    htmldb_item.select_list_from_query(2, t2.nozellik_deger, 'select vdeger
    a,vdeger b from tozellik_deger where noz_id = 10') "Select List",
    htmldb_item.text(3, NULL, t2.vcihaz_oz_deger) "Free Text"
    FROM vcihaz_grup_ozellik t1, tcihaz_oz t2
    WHERE t1.noz_id = t2.noz_id
    AND t2.ncihaz_id = 191
    AND t1.ngrup_id = 5
    But what I exactly need i something like this dynamic query;
    SELECT
    vozellik "Özellik",
    CASE
    WHEN (t2.nozellik_deger IS NULL AND t2.vcihaz_oz_deger IS NOT NULL) THEN
    'HTMLDB_ITEM.freetext(' || rownum || ', NULL) ' || vozellik
    WHEN (t2.nozellik_deger IS NOT NULL AND t2.vcihaz_oz_deger IS NULL) THEN
    'HTMLDB_ITEM.select_list_from_query(' || rownum ||
    ', NULL, ''select vdeger a,vdeger b from tozellik_deger where noz_id = ' ||
    t1.noz_id || ''' ) ' || vozellik
    END AS "Değer"
    FROM vcihaz_grup_ozellik t1, tcihaz_oz t2
    WHERE t1.noz_id = t2.noz_id
    AND t2.ncihaz_id = 191
    AND t1.ngrup_id = 5
    Thank you very much,
    Best regards.
    H.Tonguc

  • How to modify an existing xml file from java code.

    Hi
    I have worked on creating a new xml file from java code using xmlbeans.But if i try to modify an already existing file using java code I am unable to get errorfree xmlfile.
    For example if xml file(studlist.xml) is as below:
    <?xml version="1.0" encoding="UTF-8"?>
    <StudentList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\kchaitanya\xmlprac1\abc\Studlist.xsd">
         <Student>
              <Name>ram</Name>
              <Age>27</Age>
         </Student>
    <Student>
              <Name>sham</Name>
              <Age>26</Age>
         </Student>
    </StudentList>
    Now suppose i have set name to victor using student.setName,
    and set age to 20 using setAge from javacode,
    the new xml file is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <StudentList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\kchaitanya\xmlprac1\abc\Studlist.xsd">
         <Student>
              <Name>ram</Name>
              <Age>27</Age>
         </Student>
    <Student>
              <Name>sham</Name>
              <Age>26</Age>
         </Student>
    </StudentList>
    <Student>
              <Name>victor</Name>
              <Age>20</Age>
         </Student>
    As observed this is not a valid xml file.But how can i modify without any errors?

    I know it's an old post, but I found this while doing a google search for something else, and don't like to leave it un-aswered
    Just in case anyone has a similar problem... In this case the new elements have been appended outside of the root element
    What you need to do is first get the root element and then append the new children to that, there are several ways of getting the root element, which depend on what you want to do with the elements you get back here's a simple (incomplete) way.
    // gets the root element of the specified file (code not shown)
    Element rootElement= new SAXReader().read(file).getRootElement();Then just append the new elements as below (this is non-generic code and would need to be modified for your situation)
    // write a new student element
    Element student = document.createElement("Student");  // creates the new student
    rootElement.appendChild(student); // ***appends it to the root element***
    Element name = document.createElement("Name"); // creates the name element
    name.appendChild(document.createTextNode("Fred")); // adds the name text to the name element
    student.appendChild(name); // appends the name to the student
    Element age= document.createElement("Age"); // creates the age element
    age.appendChild(document.createTextNode("26")); // adds the age text to the age element
    student.appendChild(age); // appends the name to the studentThen flush ya buffers or whatever and write the file
    Edited by: Dream-Scourge on Apr 23, 2008 11:10 AM

Maybe you are looking for

  • How can I get my PDFs to show up as anything but the Firefox html icon?

    I need the old format where the contents of the first page of the PDF showed up as its icon instead of the Firefox icon. Now they all look alike, which really slows down my work production! I now have to read every title to find the PDF I want! Also,

  • ITunes match wont show artwork, without downloading a song?

    I did upload/match my music collection to itunes match on one PC and all worked fine and it shows the embedded artworks of the local files. The problem is that if i turn on itunes match on a remote machine, the songs play fine from the cloud, BUT all

  • Power on light (led) with 23" cinema hd ?

    hi, i am used to the "old" apple monitors where there is always a power on light visible. my new cinema 23" display has only - for a small second - light on when starting up and shutting down. is this normal behaviour ? tia

  • ArchLinux on Acer Aspire One Review

    Here is my mini-review: http://kaiwai.blogspot.com/2009/03/linu - eview.html I did a review previously of Linux from a non-Geek perspective (and was flamed by some precious individuals). This review was based from a geek perspective (my own perspecti

  • Standard function for settlement period

    Hello Does someone knows if there is a standard function that could define the settlement period based on a date (DD.MM.YYYY)? The aim of this is to use it in report RKO7CO88 thanks to a link with table TVAR because we would like to run in background