Creating dynamic XML without String var ?

Hi all...
I am trying to create a XML to use it in a DataGrid as a
DataProvider... So far I was able to do it but only using a String
variable, is there any othe way to do it? I found/think there is
another way but i'm kinda lost on this subject... Here is how im
doing it (more or less):
private var dataPlaylist : XML;
private var xml : String = new String();
xml += ' <music>\n';
xml += ' <artist>' + player.id3.artist +
'</artist>\n';
xml += ' <track>' + player.id3.songName +
'</track>\n';
xml += ' <title>' + player.id3.title +
'</title>\n';
xml += ' <album>' + player.id3.album +
'</album>\n';
xml += ' <time>' + player.length + '</time>\n';
xml += ' </music>\n';
dataPlaylist = XML(xml);
playlist.dataProvider = dataPlaylist.musica;

It's better to read the entire XML documentation located one
level up:
http://livedocs.macromedia.com/flex/2/docs/00001910.html
For your case, you can actually do this:
dataPlayList: XML =
<music>
<artist>{player.id3.artist}</artist>
<track>{player.id3.songName}</track>
</music>;
Note the use of curly braces {} to embed variables inside
your XML. There's a lot more you can do with XML as well. It's in
the docs.

Similar Messages

  • Getting started with create dynamic XML forms

    I work for a software vendor that is developing a C#.Net data entry system designed to replace a paper process.  The original forms come from a 3rd party and are paper form, such as a tax form, loan application form, etc.  The goal is to be able to enter data on the screen in a form that looks like something like the original form and then to print out the form that looks identical to the form on the screen.
    The system is designed to allow the end user to create the forms.  The process is that the end user creates the fields in the C#.Net application, then pick from those fields to build the form. During data entry, the fields are both pre populated by the C#.Net application and the results are saved back to the C#.Net application.
    The data entry and print all needs to be embedded into the core C#.Net application and NOT rely on any outside systems like the LifeCycle system.
    Is there some way to embed PDF creation in the C#.Net application (or in a traditional C/C++ application for that matter)?  I am under the impression that is what dynamic XML forms is all about.  Is dynamic XML forms an Adobe thing or an open standard?

    You are funny  I clearly state that I do *NOT* want to use LiveCycle Designer and you go tell me to post a question in that forum  Hopefully someone else will come along which can actually address my questions

  • MapViewer API: addMapCacheTheme creates unexpected XML request string

    Hi,
    I try to get a map with map cache theme on it. But MapViewer class generates an xml request string in which an unexpected wfs theme
    exists. So I'm unable to add a map cache theme since the wfs theme causes a problem and i only get an image painted with background
    color...
    my java code is as follows:
                   String viewerUrl = "http://localhost:8888/mapviewer/omserver";
                   String dataSource = "ADATASOURCE";
                   String mapCache= "AMAPCACHE";
                   MapViewer viewer = new MapViewer(viewerUrl);
                   viewer.setDataSourceName(dataSource);
                   viewer.setImageFormat(MapViewer.FORMAT_PNG_URL);
                   viewer.setMapRequestSRID(8307);
                   viewer.setAntiAliasing(false);
                   viewer.setMapTitle(null);
                   viewer.setBackgroundColor(new Color(0xA6CAF0));
                   viewer.setBackgroundImageURL(null);
                   viewer.setDeviceSize(new Dimension(480, 480));
                   //viewer.setBaseMapName(baseMap);
                   viewer.addMapCacheTheme(mapCache, dataSource, mapCache, true);
                   viewer.setCenter(29, 41);
                   viewer.setSize(1);
                   //For debugging issues
                   String req = viewer.getMapRequestString();
                   viewer.run();
    value for req variable is:
    <?xml version="1.0" standalone="yes"?>
    <map_request
    datasource="ADATASOURCE"
    srid="8307"
    width="480"
    height="480"
    bgcolor="#a6caf0"
    antialiase="false"
    format="PNG_URL"
    >
    <center size="1.0">
    <geoFeature>
    <geometricProperty typeName="center">
    <Point>
    <coordinates>29.0,41.0</coordinates>
    </Point>
    </geometricProperty>
    </geoFeature>
    </center>
    <themes>
    <theme name="AMAPCACHE" datasource="ADATASOURCE">
    <map_cache_theme map_cache_name="AMAPCACHE" snap_to_cache_scale="true"/> </theme> <theme name="AMAPCACHE" >
    <wfs_feature_request
    datasource="ADATASOURCE"
    />
    </theme>
    </themes>
    </map_request>
    The first theme is the one that i wanted to add.
    The second one (bold) is the one that causes trouble. I don't know where it comes from.
    This problem occured when i started to use mvclient.jar that came with patch 6453515 which changed MapViewer version from
    Ver10131_B06102 to Ver11_B07100.
    The old mvclient.jar (came with MapViewer Ver10131_B06102) produces the following xml request string:
    <?xml version="1.0" standalone="yes"?>
    <map_request
    datasource="ADATASOURCE"
    srid="8307"
    width="480"
    height="480"
    bgcolor="#a6caf0"
    antialiase="false"
    format="PNG_URL"
    >
    <center size="1.0">
    <geoFeature>
    <geometricProperty typeName="center">
    <Point>
    <coordinates>29.0,41.0</coordinates>
    </Point>
    </geometricProperty>
    </geoFeature>
    </center>
    <themes>
    <theme name="AMAPCACHE" datasource="ADATASOURCE">
    <map_cache_theme map_cache_name="AMAPCACHE" snap_to_cache_scale="true"/> </theme> </themes>
    </map_request>
    What might cause this problem?
    OS: Windows XP Pro SP2
    IDE: JDeveloper 10.1.3.1.0
    Thanks in advance,
    Cihan

    Hi Cihan,
    it is confirmed to be a bug with this client library and it will be fixed. Thanks.
    Joao

  • Create Dynamic documents without screen.

    Is this possible ?
    Create a dynamic document (CL_DD_DOCUMENT) without creating any screen.
    Thank you.

    Is this possible ?
    Create a dynamic document (CL_DD_DOCUMENT) without creating any screen.
    Thank you.

  • Create dynamically xml file from java.

    Hi all,
    I got class information in java program. I have to put method name and return type into xml. The xml file is like this and i have created this file.
    <method>
    <name></name>
    <returnType></returnType>
    </method>
    Now when I get method information I want to put it in xml, not by writing each method name explicitly in file, mean i have to load this xml into memory for that what should i do?
    Please help me I am new in XML.
    Thanks in advance.
    -regards
    bunty

    If you save your XML file as "methodinfo.xml", you can use the following code:import java.io.File;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    try {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder parser = factory.newDocumentBuilder();
      Document doc = parser.parse(new File("methodinfo.xml"));
      Node nameNode = doc.getElementsByTagName("name").item(0);
      Node returnTypeNode = doc.getElementsByTagName("returnType").item(0);
      nameNode.setTextContent("the name of the method");
      returnTypeNode.setTextContent("the return type of the method");
      DOMSource source = new DOMSource(doc);
      StreamResult result = new StreamResult(System.out);
      TransformerFactory transformerFactory = TransformerFactory.newInstance();
      Transformer transformer = transformerFactory.newTransformer();
      System.out.println("This is the content of the XML document:\n");
      transformer.transform(source, result);
    catch (Exception e){
    ...The content of the XML document will be displayed as follows:<?xml version="1.0" encoding="UTF-8" ?>
    <method>
      <name>the name of the method</name>
      <returnType>the return type of the method</returnType>
    </method>

  • Creating a Function module to send XML Byte String

    Hi all,
    I have to create a Function module to get XML byte string.The internal table is dynamic coloums based on how many data selected as a importparameter.from the internal; table data I have to create a XML byte string as a output.Pl help me to proceed further.
    Thanks in Advance.
    Ram

    If i have your question right you need to convert an internal table of unknown type to an xml string then to a byte string.
    data xmlString type string.
    data xmlXString type xstring.
    call transformation id
       source
          table = internalTableYouWantToExport
       result
          xml xmlString.
    export xmlString to data buffer xmlXString.
    xmlString has the xml of the table and xmlXString contains the byte representation of the string.

  • How to create dynamic Connection String in SSIS Package???

    Hi
    I created OLEDB Source Connnection String for that Package,
    i need Create OLEDB Destination Connection String Dynamically,
    Same server name,but i need to add DW at the end of the Database
    ex:
    Source database name is Demo,
    Destination database should come DemoDW.
    i need to create Dynamic Destination Connection String..
    any possible to Create 
    Thanks in advance
    Pandiyan
    pandiyan

    Hi Pandiyanpvp,
    According to your description, the OLEDB Destination Connection String should be dynamically based on the OLEDB Source Connection String. They are all the same, except adding “DW” at the end of the Database of OLEDB Source Connection String in OLEDB Destination
    Connection.
    To achieve this requirement, we can create a variable with the Database name of OLEDB Source Connection String, then use expression to control the OLEDB Source and OLEDB Destination Connection Strings. For more details, please refer to the following steps:
    Create a variable named Source with the Database name of OLEDB Source Connection String as value.
    Click the OLEDB Source Connection Manager to navigate to the Properties window.
    Click “…” next to Expressions to add a ConnectionString Property with the expression like below:
    "Data Source=.;Initial Catalog="+@[User::Source] + ";Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;"
    Click the OLEDB Destination Connection Manager to navigate to the Properties window.
    Click “…” next to Expressions to add a ConnectionString Property with the expression like below:
    "Data Source=.;Initial Catalog="+ @[User::Source] + "DB"+";Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;"
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Creating new xml document

    Hi
    there are many samples about reading results into xml, but how can the oracle xml parser be used to create a xml document (String) from the scratch?
    Thanks a lot for suggestions
    Daniel

    Thanks , but i know all this !
    File corFile = new File("e:\\corFile.xml");
    DOMParser dp=new DOMParser();
    InputStream is = new FileInputStream(corFile);
    XMLDocument root=XMLHelper.parse(is,null);
    is.close();
    Element hello = root.createElement("hello");
    Text bonjour = root.createTextNode("Bonjour");
    hello.appendChild(bonjour);
    root.appendChild(hello);
    i know how i can update the XMLDocument ,
    but how i can update my file corFile.xml ??
    i would create a new xml file from my new XMLDocument !

  • How to create an XML document from a String.

    Can anyone help,
         In the Microsoft XML Document DOM there is a load function load(string) which will create an XML document, but now we are switching to Java and I do not know how to create and XML document from a string, this string �xml document� is passed to my program from a webservice and I need to read several xml elements form it in a web server.
    This string is a well formatted XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Countries NumberOfRecords="1" LanguageID="en-us">
         <Country>
              <CountryCode>AU</CountryCode>
              <CountryName>AUSTRALIA</CountryName>
         </Country>
    </Countries>

    Thanks PC!
    I made it work using:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    factory.setIgnoringComments(true); // We want to ignore comments
    // Now use the factory to create a DOM parser
    DocumentBuilder parser = factory.newDocumentBuilder();
    //TransformThisStringBuffer is a string buffer wich contain the 'XML document (String)'
    InputStream in = new ByteArrayInputStream(TransformThisStringBuffer.toString().getBytes());
    // Parse the InputStream and build the document
    Document document = parser.parse(in);
    But which one is faster InputSource or InputStream, were would you put the "new InputSource(new StringReader(yourString))" in the above code?

  • How to create dynamic connection string with variables using ssis.

    Hello,
    Can anyone let me know on how to create dynamic connection string with variables using ssis?
    Any help would be appreciated.

    Hi vinay9738,
    According to your description, you want to connect multiple database from multiple servers using dynamic connection.
    If in this case, we can create a Table in our local database (whatever DB we want) and load all the connection strings.  We can use Execute SQL Task to query all the connection strings and store the result-set in a variable of object type in SSIS package.
    Then use ForEach Loop container to shred the content of the object variable and iterate through each of the connection strings. And then Place an Execute SQL task inside ForEach Loop container with the SQL statements we have to run in all the DB instances. 
    For more details, please refer to the following blog:
    http://sql-developers.blogspot.kr/2010/07/dynamic-database-connection-using-ssis.html
    If there are any other questions, please feel free to let me know.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Does Ipad adobe reader allow to fill a  dynamic xml form created on LiveCycle?

    The form was created using LiveCycle Designer ES3 for the purpose of being filled out on the spot at the client and then submitted as email attachment. However, Adobe reader does not seem to be able to open it giving the following error:
    "Please wait... If this message is not eventually replaced by the proper contents of the document, your PDF viewer may not be able to display this type of document..."
    The form is dynamic XML, and in the description of the Adobe Reader for the Ipad, it mentions that it is capable of opening forms under the Livecycle rights.
    However, if the Reader can not open dynamic XML's, how can I convert the form into a compatible fillable form for the Ipad?
    Thanks.

    LiveCycle Dynamic XML Forms are not supported in the Mobile versions of Adobe Reader.

  • Creating Dynamic Cascading Prompts Without Business View manager?

    How can we create dynamic cascading prompts without Business View Manager??

    Creae a parameter in Crystal Report Designer. I suggest you read the help on how to also.

  • Creating page Navigation without using Dynamic Navigation

    Hi,
    I have a requirement that i need to create few pages where each page will have navigation tabs at the left side and corresponding iviews at the right. Navigation will not  be dynamic but static in nature that means target for the navigation link will not be decided dynamically but will be static. Each tab on the navigation will be linked to a page which will be opened in the same content area. Since there is no dynamic navigation so that's why there is no application present to be used for creating dynamic navigation iview. Please suggest what else can be option to create this sort of page.
    Best Regards,
    Vikash

    Hi,
    If you want your tab on the left instead of the top you need to change the defaultframeworkpage. If some users need to have the navigation on top and some on the left you need to make a custom layout for these users so that only these users have your modified frameworkpage.
    Of course you can not mix tabs on the left and tabs on top. If you want something like that then you`ll need to make a custom html page with tabs on the left pointing to standard portal locations.
    Hope this helps.

  • Dynamic XML content displayed in HTML using url variable

    Hi guys,
    The following is code i am having issues with:
    <script type="text/javascript">
    <!--
    var xml_connect_00 = "new Spry.Data.XMLDataSet(";
    var xml_connect_01 = "assets/xml/toolkit.xml\",
    \"toolkit/section/";
    var xml_connect_02 =
    "/product\",{sortOnLoad:\"product_name\",sortOrderOnLoad:\"ascending\"";
    var xml_connect_03 = ")";
    // Create variable to see if there is a ? in the url
    var url_input = document.URL.indexOf('?');
    // Create variable from ? in the url to the end of the string
    var xml_category = document.URL.substring(url_input+1,
    document.URL.length);
    var dsSoftware =
    document.write(xml_connect_00,xml_connect_01,xml_category,xml_connect_02,xml_connect_03);
    --->
    </script>
    dsSoftware is my XML Data set connection string, and by using
    document.write, the correct string i want is displayed (in my
    html), but - as you can probably guess by now(!) - i want it to
    display in the actual Javascript code so i can connect to the xml
    file and display the contents depending on the url variable sent.
    Is this possible, and if so, am i going about it the right
    way? I am not the most proficient at JavaScript, so may have some
    ugly code (and not even 100% that this can even be done)!!
    Just to give you an outline as to why i am doing this - my
    XML file has different categories within it for different products.
    I send the category name via a url variable to another page
    (containing the above code) that will display the appropriate
    category information depending on what url variable is sent.
    Cheers in advance for any help.

    Me again!
    Sorry to keep updating, but i have now surpassed my last
    question and got the alert to work correctly. The question i have
    now regards the following code:
    <script type="text/javascript">
    <!--
    var params = Spry.Utils.getLocationParamsAsObject();
    var dsSoftware = new
    Spry.Data.XMLDataSet("assets/xml/toolkit.xml", "toolkit/section");
    //If the URL parameter 'software' has a value, set the XPath
    that includes a filter and then load the data.
    if (params.software){
    dsSoftware.setXPath("toolkit/section[name =
    '"+params.software+"']/product");
    dsSoftware.loadData();
    //alert(params.software);
    //-->
    </script>
    Everything seems to work without error, but i cannot load my
    xml file. The problem, i think, is that my xml heirachy is as
    follows:
    "toolkit/section/section_name/product"
    section_name is unique for each section, and that is what i
    am trying to pass through the url variable, so i can display all
    the products from that section.
    Can anyone tell me what i am doing wrong?
    Cheers in advance - again!!

  • Error #1056: Cannot create property text on String.

    Ok, i fixed the last error message, but i still cant get the xml to load, I am getting this error message now
    What does this mean, I can't seem to figure it out.
    I am trying to load the title of a video reel onto a button
    and load a corresponding move, 1 of 4...getting this error now
    ReferenceError: Error #1056: Cannot create property text on String.
        at main2_fla::MainTimeline/setVids()
        at main2_fla::MainTimeline/xmlLoaded()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/onComplete()
    this is the correspoding codeits referring to:
    function setVids():void {
        for(var i = 0; i < 3; i++) {
            var name_txt:String = vidList_XML.vid[i + count].file;
            var reelTitle = this["vid" + (i + 1)].name;
            reelTitle.text = name_txt;

    It is telling you that you can't create a property called "text" on an instance of the String class.
    var reelTitle = this["vid" + (i + 1)].name;
    That is assigning the name property of this["vid"+(i+1)] to the variable reelTitle. You haven't typed the variable, but "name" properties are always Strings, so reelTitle is a String.
    And the String class is not dynamic, so you can't just go adding properties to it.
    My guess is that you want something like this:
    var reelTitle:TextField=this.getInstanceByName("vid"+(i+1))
    reelTitle.text=name_txt
    Or something like that....

Maybe you are looking for

  • How to use two different database Drivers in one application ????

    I want to select datas in a result set of a query on a ms access database table and insert these into a mysql table of a mysql database in one application. Now my problem is that only on database driver is acceptet in the same application even it`s i

  • Using af:query to search documents inside UCM

    Hello everybody! I have already posted this question on the [WebCenter forum|http://forums.oracle.com/forums/thread.jspa?threadID=2181706&stqc=true] , but I think it's really something that concerns both WebCenter and UCM, so I'm posting it here too.

  • PHP to CFM

    I found a php code and I want to convert it to CFM. I already converted most of the code by there're some that I don't know how to. I'll post the part that I don't know how to. Hopefully someone can help me

  • Stopping a SubVI without stopping the main VI

    Hi, I have a VI with two SubVIs which are being executed sequently, with the second SubVI waiting for an user event in the first SubVI. The SubVI front panels are open and used as the user interface when they are executed. When I push the stop button

  • Is Adobe FlashBuilder 4.6 compatible with OS X Mavericks?

    I just upgraded to OS X Mavericks and FlashBuilder 4.6 won't launch. Should it be supported?