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;
      

Similar Messages

  • 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");

  • Very simple jstl question

    I for the life of me have not been able to find the answer to this very simple question, googling and looking at various documentation. What is the difference between accessing properties using $ or #? Is there a difference?
    Thanks

    Read on this excellent explanation about the unified EL: http://java.sun.com/products/jsp/reference/techart/unifiedEL.html

  • Very Simple C question - reading input parameters/flags... [SOLVED]

    This is an extremely simple question. Please forgive me for being a noob. I am writing an application in C (with GCC) called GAPE and need to be able to pass it parameters through a shell script (/usr/bin/gape) that can determine how it runs. To start with easy stuff, I want the end-user to be able to type "gape -V" to output the version of the program. How do I do that? I understand that I need to put the shell script in /usr/bin...where should I put the actual gcc-compiled gape application? Or do I even need a shell script? Can I just put the GAPE binary in /usr/bin and pass parameters to it directly? If so, how do I do that in C? Any help is greatly appreciated.
    Last edited by tony5429 (2008-03-10 12:00:21)

    include <stdio.h>
    main(int argc, char *argv[])
    int i;
    for(i = 1; i < argc; i++) //argc = the number of arguments
    printf("param nr %d: %s\n", i, argv[i]); // argv[i] contain the arguments, with 0 being the program name (anyone may correct me here)
    [jaqob@p238 c++-egna]$ ./a.out 1 2 3
    param nr 1: 1
    param nr 2: 2
    param nr 3: 3
    [jaqob@p238 c++-egna]$ ./a.out -h -V -zxvf
    param nr 1: -h
    param nr 2: -V
    param nr 3: -zxvf
    A very simple program that prints the parameters
    And yes, you can put the program in /usr/bin/ without a shellscript
    Last edited by JaQoB (2008-03-05 18:09:34)

  • XSL for a Pie chart with a very simple XML data file

    Hi All
    Using BI Pub Desktop 10.1.3.2.1 with Oracle Apps R12.1.3.
    I am trying to do a pie chart for the below data in an xml file. Normally this is pretty straight forward but with the below simple data structure I am a bit stuck, maybe thinking about it too much. Appreciate any help on what the xsl should like.
    xml file contains only the below. There is no other data in the file.
    <G2>
    <ITEM>ALL</ITEM>
    <AA>10</AA>
    <BB>20</BB>
    <CC>50</CC>
    <DD>30</DD>
    </G2>
    I want to be able to have a pie chart that shows the labels: AA, BB, CC and DD with the corresponding data values of 10,20,50 and 30.
    Thanks for viewing the question.
    Cheers Cel

    Please disregard. i went back to the original blog code and started over, and figured this out.

  • Simple xerces DOMParser.  Why won't this validate? Very simple, xml schema

    I have written a java program called "Validate.java" to validate an xml file. The program uses the xerces DOMParser. When I try and validate a correct .xml file with a correct schema in an .xsd file I get the following errors:
    [Error] Document is invalid: no grammar found. line 2 column 6 - name5.xml
    [Error] Document root element "name", must match DOCTYPE root "null". line 2 column 6 - name5.xmlThe XML file, the XSD file, and the Validate.java program are all in the same directory. My CLASSPATH includes xml-apis.jar, xercesImpl.jar, and xercesSamples.jar.
    Here is the xml file (name5.xml):
    <?xml version="1.0"?>
    <name
        xmlns="http://www.myOwnURL.net/name"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.myOwnURL.net/name name5.xsd"
        title="Mr.">
      <first>John</first>
      <middle>Fitzgerald</middle>
      <last>Doe</last>
    </name>(I saved the file in the UTF-8 encoding, which causes it to look double spaced in some text editors.)
    The schema is in the following xsd file (name5.xsd):
    <?xml version="1.0"?>
    <schema
        xmlns="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://www.myOwnURL.net/name"
        xmlns:target="http://www.myOwnURL.net/name"
        elementFormDefault="qualified">
      <element name="name">
        <complexType>
          <sequence>
            <element name="first" type="string"/>
            <element name="middle" type="string"/>
            <element name="last" type="string"/>
          </sequence>
          <attribute name="title" type="string"/>
        </complexType>
      </element>
    </schema>(Again, the file is saved in UTF-8 format.)
    Here is the code for Validate.java:
    public class Validate implements org.xml.sax.ErrorHandler
        private String instance = null;
        private int warnings = 0;
        private int errors = 0;
        private int fatalErrors = 0;
        private org.apache.xerces.parsers.DOMParser parser = new org.apache.xerces.parsers.DOMParser();
        public Validate() // constructor
            parser.setErrorHandler(this); // Set the errorHandler
        public void setInstance(String s)
            instance = s;
        public boolean doValidate()
            try
                warnings = 0;
                errors = 0;
                fatalErrors = 0;
                try
                    // Turn the validation feature on
                    parser.setFeature( "http://xml.org/sax/features/validation", true);
                    // Parse and validate
                    System.out.println("Validating source document...");
                    parser.parse(instance);
                    // We parsed... let's give some summary info of what we did
                    System.out.println("\nComplete " + warnings + " warnings " + errors + " errors " + fatalErrors + " fatal errors");
                    // Return true if we made it this far with no errors
                    return ((errors == 0) && (fatalErrors == 0));
                catch (org.xml.sax.SAXException e)
                    System.err.println("\nCould not activate validation features - " + e.getMessage());
                    return false;
            catch (Exception e)
                System.err.println("\n"+e.getMessage());
                return false;
        public void warning(org.xml.sax.SAXParseException ex)
            System.err.println("\n[Warning] " + ex.getMessage() + " line " + ex.getLineNumber()
            + " column " + ex.getColumnNumber() + " - " + instance);
            warnings++;
        public void error(org.xml.sax.SAXParseException ex)
            System.err.println("\n[Error] " + ex.getMessage() + " line " + ex.getLineNumber()
            + " column " + ex.getColumnNumber() + " - " + instance);
            errors++;
        public void fatalError(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException
            System.err.println("\n[Fatal Error] " + ex.getMessage() + " line " + ex.getLineNumber()
            + " column " + ex.getColumnNumber() + " - " + instance);
            fatalErrors++;
            throw ex;
        public static void main(String[] args)
            Validate validate1 = new Validate();
            if (args.length == 0)
                System.out.println("Usage : java Validate <instance>");
                return;
            // Set the instance
            if (args.length >= 1) validate1.setInstance(args[0]);
            // Validate (the doValidate returns either true or false depending on
            // whether there were any errors.)
            if (!validate1.doValidate()) return;
    }My question is: why do I get those errors??? Why doesn't everything just validate like it is supposed to??? Also, why does the error even mention DOCTYPE -- I thought that was for DTDs, and I am using XML Schema.
    I will be very grateful to anyone who can tell me what is going on here.
    Thanks,
    Jon

    I have solved my problem. I just needed to add the following line to my java program:
    parser.setFeature("http://apache.org/xml/features/validation/schema", true);I'm still not sure how I was supposed to know this, however. I guess spending three hours searching on google is what you are supposed to do. Also, I was thrown for a bit of a loop by the following official faq found at http://xml.apache.org/xerces2-j/faq-pcfp.html:
    [faq]
    Question: How can I tell the parser to validate against XML Schema and not to report DTD validation errors?
    Answer: Currently this is impossible. We hope that JAXP 1.2 will provide this capability via its schema language property. Otherwise, we might introduce a Xerces language property that will allow specifying the language against which validation will occur.
    [faq]
    I am very new to XML (less than a week), but that FAQ sure makes it sound like using only XML Schema and completely avoiding DTDs is impossible. On the other hand, I think that is what I was able to achieve by adding the above line to my code.
    Oh well.
    Jon

  • 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

  • Very simple cfselect question

    Hi,
    I have a really noob question; what is the easiest way to
    output the values of a cfselect dropdown to a cfoutput tag on the
    same page?
    I am only interested in puting the values of the dropdown
    into the cfoutput tag when the user selects on a dropdown item .
    Thanks for your time.

    Thanks for the quick reply!
    I think what i meant to say with the code i posted is that i
    am perfectly happy with validating the form on the server AND i
    have added a submit button to my form (its just not in the code i
    posted) and the form is "in fact" validating to my CF8 server.
    However where I am stuck is that I am not sure if there is still is
    tricky server behavors or other code that i need to add to the form
    or page itself.
    In the code i posted before i still only recieve the first
    output selection regardless if the submit button is pressed the
    value of "50" always appears/reappears.
    I am still new to CF and i like it a lot but it is a little
    puzzling that for such a ultra-simple task as what im stuck with i
    hope that i dont need to write reams and reams of code to do this.
    Thank you in advance.

  • Very simple network question

    Forgive my stupidity asking this question...
    I have an iBook G4 and two Windows PCs (one W2K, one XP) all happily sharing a wi-fi network using Airport Express.
    I am about to dash out to the shops to buy a USB printer so that we can all print wirelessly, using iFelix's fab website for guidance. My incredibly dumb question is this: do I need to establish any kind of network before embarking on the printer-sharing project, or, by the very fact that we are all sharing a wi-fi network, are we already three "networked" computers??
    I don't want to share any files between the computers, just a printer. Is there anything I need to do beforehand to create a network, or are we already one??
    iBook G4   Mac OS X (10.3.9)   Window XP, Windows 2000, AirPort Express

    Sanhodo: there are reports of problems with windows sharing a printer to a wireless iBook. You should read iFelix guide to wireless printing (run a google search), it will shed some light on the subject.
    JFYI, the setup of Claudine is completely different from yours, since she will connect the printer to THE ROUTER, not to a computer --which is your case-- and therefore she will avoid the problems of windows printer sharing...

  • 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

  • Very simple Hashtable question

    Ok, this might be a very dumb one, but I can't spot the error. After seeing numerous examples of a hashtable, I tried the following:
    Hashtable p = new Hashtable();
    p.put ("Alberta", "ab");
    But I keep getting the following error:
    <identifier> expected
    p.put ("Alberta", "ab");
    Can anyone tell me what I'm doing wrong???

    It's not a problem with hashtables, specificly. you can't add elements to an hash or a vector or perform another routine outside a method or a constructor. there is no way that
    that operation can be executed during compiling.
    regards

  • Very Simple Numbers Question

    Hi all,
    I am recently converted from the PC world...
    I am trying to create a simple line graph in numbers. I have a data set that consists of about a dozen columns containing summary data from 1955 - 2007. The first column 'A' contains the year, and all subsequent columns contain the yearly variable value.
    I am trying to creat a simple line graph of each variable from year to year (i.e the first column, year, is my horizontal (x) axis, and what ever other variable -or column- is my verticle (y) axis.
    I have done this (and am doing this) quite easily in excel, but I have spend the better part of an evening trying to figure it out in numbers ('08 or '09).
    I looked at the online manuals and tutorials, but they were of no help.
    Any assistance will be most welcome.
    Many Thanks,
    Bryan

    Select the cells with dates and totals > Toolbar > Chart > Line chart > the table will have the axis the wrong way around for what you want so click the black box on the table with III on to change it to ☰.
    Open Inspector > Chart to set up the chart the way you want.
    The User Guide is available under Help on the Numbers Menu Bar,
    S.

  • Very simple Parameter question in Eclipse

    I simply want to create a report where a user can pick a date range at runtime.  I designed a simple report, added parameter fields and ran it in the designer.  It prompted me for dates and I filled them in.  The report ran in the designer just fine.  When I publish the report to the Apache Tomcat web site, I want the prompts to pop up for the user so they can pick the date range.  There are no parameters that pop up and the parameter panel shows NO parameters.  Can someone point me to a document or process that will allow me to prompt the user for these dates?  I am invoking the report from the JSP that is generated by the plugin.

    Are you passing paramete values in your code? If you do not then it will automatically asks for parameters.
    Regards,
    Tejaswini

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

  • Very simple Strings Question

    Hi All:
    I am stuck with a small situation, I would appreciate if someone can help me with that. I have 2 strings:
    String 1 - "abc"
    String 2 - "I want to check if abc is in the middle"
    How can I check if the string 1 "abc" is in the middle of the string 2. I mean the String 2 does not start with "abc" and it does not end with "abc", I want to check if it is somewhere between the string.
    Thanks,
    Kunal

    int i = s2.indexOf(s1);
    if((i > 0) && ((i + s1.length()) < s2.length())) {
       // somewhere in the middle
    } else if(i == 0) {
       // start
    } else if((i + s1.length()) == s2.length()) {
       // end
    } else if(i == -1) {
       // nowhere
    }

Maybe you are looking for