NewBie's Simple XML Question

Hi Friends,
I am starting to learn "xml"..got the complete reference book.But can someone please tell me how to start with it.i have a *.xml file and a *.xsl file.I am trying to call the xml file in my browser..but the xml file contents shows up..with no xsl formatting options applied.Can someone please tell me or show me the rite way to accomplish this.
Thanks
Mick

http://www.w3schools.com/xsl/xsl_transformation.asp

Similar Messages

  • Very simple XML question

    1. I have a simple table with a clob to store an unlimited number of contacts as follows ....
    CREATE TABLE MY_CONTACT (USER_id NUMBER, All_Contacts SYS.XMLTYPE );
    2. I inserted 1 user with 2 contacts as follows :
    INSERT INTO MY_CONTACT
    VALUES(1, sys.XMLType.createXML('<?xml version="1.0"?>
    <CONTACT>
    <CONTACTID ID="1">
    <FNAME>John</FNAME>
    <MI>J</MI>
    <LNAME>Doe</LNAME>
    <RELATIONSHIP> </RELATIONSHIP>
    <ADDRESS>
    <STREET>1033, Main Street</STREET>
    <CITY>Boston</CITY>
    <STATE>MA</STATE>
    <ZIPCODE>02118</ZIPCODE>
    </ADDRESS>
    </CONTACTID>
    <CONTACTID ID="2">
    <FNAME>Carl</FNAME>
    <MI>J</MI>
    <LNAME>Davis</LNAME>
    <RELATIONSHIP>Son</RELATIONSHIP>
    <ADDRESS>
    <STREET>1033, Main Street</STREET>
    <CITY>San Francisco</CITY>
    <STATE>CA</STATE>
    <ZIPCODE>06456</ZIPCODE>
    </ADDRESS>
    </CONTACTID>
    </CONTACT>'));
    --- 1 row inserted .
    I have the the following issues :
    3. When I run the following :
    select A.All_Contacts.extract('/CONTACT/CONTACTID/@ID').getnumberval() ID,
    A.All_Contacts.extract('/CONTACT/CONTACTID/FNAME/text()').getstringval() FNAME,
    A.All_Contacts.extract('/CONTACT/CONTACTID/LNAME/text()').getstringval() LNAME
    from MY_CONTACT A ;
    I was hoping this query would return :
    ID FNAME
    1 John
    2 Carl
    But instead, I am getting : .... How do I fix the query to get the results I am looking for ( above) ?
    ID FNAME
    12 JohnCarl
    4. I have another query :
    select A.All_Contacts.extract('/CONTACT/CONTACTID/@ID').getnumberval() ID,
    A.All_Contacts.extract('/CONTACT/CONTACTID/FNAME/text()').getstringval() FNAME,
    A.All_Contacts.extract('/CONTACT/CONTACTID/LNAME/text()').getstringval() LNAME
    from MY_CONTACT A
    where
    A.All_Contacts.extract('/CONTACT/CONTACTID/@ID').getstringval() = 1;
    that returns no rows at all !!!
    How do I get the query to return only the first set of values for CONTACTID ID=1 ? :
    ID FNAME
    1 John
    I hope this is easy to fix - my aim is to store up to ten contacts in the clob, but I cant't even get it to work with just 2 contacts ...
    Any help would be greatly appreciated.
    Thanks !!!

    If you are on 10g (I think at least 10.2.x.x) or greater, then you can also use the following. I prefer XMLTable over the table(xmlsequence()) structure.
    SELECT cid, fname, lname
      FROM MY_CONTACT A,
           XMLTABLE('CONTACT/CONTACTID'
                    PASSING A.All_contacts
                    COLUMNS
                    cid    NUMBER PATH '@ID',
                    fname  VARCHAR2(20) PATH 'FNAME',
                    lname  VARCHAR2(20) PATH 'LNAME')
    WHERE cid = 1;
          

  • Simple XML question

    org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
    at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:235)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201)
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
    I'm sure many of you you know exactly what causes this exception. Could you please help me with this one.
    Here is some background info:
    I'm using NetBeans IDE, with xerces.jar mounted (so it should be available). Here is the source code, that parses the file:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(
    new java.io.File(this.resourceLocation)); //<-- Exception !!
    Here is the (simplified) xml-file:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE Configuration SYSTEM "params.dtd">
    <Something>
    <firstConfig>
    <someAttr a="a" b="b" c="c" />
    <someOtherAttr h="h" i="i" j="j" />
    </firstConfig>
    <secondConfig>
    <attr name="name" value="value" />
    </secondConfig>
    </Something>
    I created a dtd from this xml with NetBeans' dtd-wizard.
    The xml-file is at the same directory as the compiled class-files and so is the dtd.
    What could cause this exception to occur?!?
    Thank you in advance,
    -J-

    Hi, not well formed, means that your xml does not match your DTD!
    Obviously the root Element must be
    <Configuration> and not <Something> according to your Doctype deklaration.
    But in general, it's very useful to override the normal
    ErrorHandler (like this):
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.SAXException;
    /** Just extends the normal ErrorHandler to display the kind of error and the linenumber.
    *  The column-number is displayed too, but it is normally not so usefull.
    *  So its much easier to debug files.
    public class SAXErrorHandler implements ErrorHandler {
        public SAXErrorHandler() {
        public void error(SAXParseException parm1) throws org.xml.sax.SAXException {
            System.err.println("Error");
            System.err.println( parm1.getLineNumber() +"\t"+ parm1.getColumnNumber() +"\t"+ parm1.getSystemId() +"\t"+ parm1.getMessage());
        public void fatalError(SAXParseException parm1) throws org.xml.sax.SAXException {
            System.err.println("FatalError");
            System.err.println( parm1.getLineNumber() +"\t"+parm1.getColumnNumber()+"\t"+parm1.getSystemId() +"\t"+parm1.getMessage());
        public void warning(SAXParseException parm1) throws org.xml.sax.SAXException {
            System.err.println("Warning");
            System.err.println( parm1.getLineNumber() +"\t"+parm1.getColumnNumber()+"\t"+parm1.getSystemId() +"\t"+parm1.getMessage());
            parm1.printStackTrace();
    }Than add an new instance of this class to the DocumentBuilder.
    builder.setErrorHandler(new SAXErrorHandler());So you will be able to figure out at least the line of code, which causes the problem.
    Hope this helps.
    Greetings Michael

  • A really simple XML Question

    i want to use XML to save some configuration for elements in my app.
    in my example i want to add 6 additional configuration sets to one "main" XML. each set can be config1 or config2.
    In this case i added 3x config1 and 3x config2. if i trace my results i do not only get the wrong order of elements but also some "strange" binding behavior.
    Of course this is a simplified example. my configuration sets are more complex (this is why i use seperate xml-objects for each config).
    Can someone tell me how this is supposed to work ?
    thanks,
    quadword
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                     xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160" creationComplete="init();">
      <fx:Declarations>
      <fx:XML id="mainConfig" format="e4x">
              <allConfigSets>
                        <viewconfig>Baseconfig</viewconfig>
              </allConfigSets>
      </fx:XML>
      <fx:XML id="configSet1" format="e4x">
              <configSet><viewconfig>Set1</viewconfig></configSet>
      </fx:XML>
      <fx:XML id="configSet2" format="e4x">
              <configSet><viewconfig>Set2</viewconfig></configSet>
      </fx:XML>
      </fx:Declarations>
      <fx:Script>
                        <![CDATA[
                                  private function init(): void {
                                            mainConfig.appendChild(configSet1.viewconfig);
                                            mainConfig.appendChild(configSet1.viewconfig);
                                            mainConfig.appendChild(configSet1.viewconfig);
                                            mainConfig.appendChild(configSet2.viewconfig);
                                            mainConfig.appendChild(configSet2.viewconfig);
                                            mainConfig.appendChild(configSet2.viewconfig);
                                            // trace1 (see below): trace shows wrong order of elements
                                            trace (mainConfig);
                                            // trace2:(see below): changing data on original configSet seems to bind into mainConfig
                                            configSet1.viewconfig = "-";
                                            trace (mainConfig);
                        ]]>
      </fx:Script>
    </s:Application>
    Trace1:
    <allConfigSets>
      <viewconfig>Baseconfig</viewconfig>
      <viewconfig>Set1</viewconfig>
      <viewconfig>Set2</viewconfig>
      <viewconfig>Set2</viewconfig>
      <viewconfig>Set2</viewconfig>
      <viewconfig>Set1</viewconfig>
      <viewconfig>Set1</viewconfig>
    </allConfigSets>
    Trace2:
    <allConfigSets>
      <viewconfig>Baseconfig</viewconfig>
      <viewconfig>-</viewconfig>
      <viewconfig>Set2</viewconfig>
      <viewconfig>Set2</viewconfig>
      <viewconfig>Set2</viewconfig>
      <viewconfig>-</viewconfig>
      <viewconfig>-</viewconfig>
    </allConfigSets>

    mainConfig.appendChild(configSet1.viewconfig.toString());
    This will make it work.

  • Newbie! Simple CreateDynaset Question

    How do I pass multiple options to the CreateDynaset Method?
    i.e. Set OraDynaset = OraDatabase.CreateDynaset(SQL, &H8&&H4&)?

    I use the number 12 in this case ( 4 + 8 )
    it seems to work

  • Simple query question

    hi all,
    I have a XMLType table with one column - I have presently one row, in my column xmlsitedata I have stored one large xml file.The schema definition is given below:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:element name="siteList">
    - <xs:complexType>
    - <xs:sequence>
    <xs:element name="site" type="siteType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    - <xs:complexType name="siteType">
    - <xs:sequence>
    <xs:element name="nameEn" type="xs:string" />
    <xs:element name="nameFr" type="xs:string" />
    </xs:sequence>
    <xs:attribute name="code" type="xs:string" />
    </xs:complexType>
    </xs:schema>
    I have executed the query below:
    select x.XMLSITEDATA.extract('/siteList/site/nameEn/text()').getCLOBVal() "stName" from wsitelist x;
    and I get all english names of some 200 locations, however, there is 1 row selected and all names show up on one row. How do I split them into 200 or whatever rows?
    Thanks,
    Kowalsky

    Have a look at the answer provided in the following thread.
    very simple XML question
    This may solve your problem.
    use xmlsequence.
    Alvinder

  • 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

  • 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.

  • A Few Newbie 10.8 Server Questions...

    Hi All,
    A few quick newbie 10.8 Server questions:
    1) Airport Extreme - I currently have an Airport Extreme attached to one of my workstations which is serving as my main router with a dedicated IP. I'm just in testing mode with my new server and wondering if I need to do anything to the Airport's configuration to make it work with the Server? Does the Server need to administer the functions of the AirportExtreme? Or is it ok to leave it attached to the workstation? Or does it not make any difference?
    2) Automount Shared Folder/Drive - I would like my users (who are mostly using MacBookPros with they take home and bring back to work) to be able to Automount our shared data drive when they come in to work. I read the help section regarding AutoMount, but it a) referred to using ServerAdmin, which I understand has been eliminated from 10.8 (dont know why they are still referring to it in the help!) and b) it talks about AutoMounting Home Folders, but not shared Drives/Folders.
    3) Firewall - I have a static IP and want my users to be able to connect using VPN. I am buying a SSL for the domain. Wondering if the combination of the built in firewall, plus the SSL, plus the built in VPN is secure enough, or should I be investing in a solution such as the SonicWall TZ100.
    Thank you !!!!!

    1) Airport Extreme - I currently have an Airport Extreme attached to one of my workstations which is serving as my main router with a dedicated IP. I'm just in testing mode with my new server and wondering if I need to do anything to the Airport's configuration to make it work with the Server? Does the Server need to administer the functions of theAirportExtreme? Or is it ok to leave it attached to the workstation? Or does it not make any difference?
    The Server app is not required to manage your airport.
    The server app can automatically open ports for you, so it makes life easier for a home-server-administrator.
    Continue managing your Airport or whatever NAT router you prefer any way you choose.
    2) Automount Shared Folder/Drive - I would like my users (who are mostly using MacBookPros with they take home and bring back to work) to be able to Automount our shared data drive when they come in to work. I read the help section regarding AutoMount, but it a) referred to using ServerAdmin, which I understand has been eliminated from 10.8 (dont know why they are still referring to it in the help!) and b) it talks about AutoMounting Home Folders, but not shared Drives/Folders.
    You can drag a mounted sharepoint to the right-side of a user's dock.
    It will then remember the sharepoint, and its 1-click to open it when needed,
    This is my preference with laptops.
    You can also add the sharepoint to your user's login items (on their workstations, System Prefs, UsersGroups/, User, Login Items - I don't like to do this with laptops because it causes a login delay when they aren't in the locaiton of the sharepoint.
    Either method is simple.
    I even use Safari bookmarks to get people to a server. Go to the addressbar and type:   afp://[email protected]   (with your real IP) then bookmark it. You can also drag that that URL to the desktop to have a location file which will ALSO take you to the server.
    So Lots of ways...  Depends on users/environment.
    3) Firewall - I have a static IP and want my users to be able to connect using VPN. I am buying a SSL for the domain. Wondering if the combination of the built in firewall, plus the SSL, plus the built in VPN is secure enough, or should I be investing in a solution such as the SonicWall TZ100.
    If you aren't going to have anything except for VPN open to the public, then you won't need SSL.
    VPN, but nature, is already encrypted and does not use SSL.
    If you will run Mail, Web, Calendar, Contacts, etc and don't want to requires users to VPN, then you should use SSL.
    TIP: Fromt the start, use a fqdn for your server. Don't use a .private or something fictitious.
    If you own mydomain.com, then setup myserver.mydomain.com and make it your server's hostoname from the get-go.
    Later, you'll be glad you used a proper FQDN
    Jeff

  • 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

  • Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Just a suggestion..........
    Download Thunderbird.  Easier to use when it comes to what you want to do w/your emails. 

  • 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.

Maybe you are looking for