Parsing XML from the Net - Using the SAXParser

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Same problem like dariusz

Postby jhandal7 » Tue Apr 07, 2009 2:33 am

[b] bstubbs wrote:
Artur79, did you ever figure out how to solve the missing string?

I'm getting the same results:


Quote:

ExtractedString =
ExtractedInt = 1337



Anyone else getting this, found a solution? Thanks


Hi
I meet the same proplem.

Chnage the xml file from
XML:
<mytag>
anddev.org rulez =)
</mytag>


to
XML:
<mytag>anddev.org rulez =)</mytag>


That works.


Damn, had the same problem. After changing to inline as you said, it works. It is weird imo, valid xml is valid xml.
_________________
---
Dariusz Dwornikowski


[u]I am using SDK 1.0,this code need upgrade?

:D
thanks
jhandal7
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Apr 06, 2009 9:03 pm

Top

Postby songotho » Thu Apr 09, 2009 10:05 am

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <Test>
  2. <Student>
  3. <Name>Jane</Name>
  4. <Address>ABC</Adress>
  5. <Age>20</Age>
  6. </Student>
  7. <School>
  8. <Name>NTUST</Name>
  9. <Adress>123</Adress>
  10. </School>
  11. </Test>
  12.  
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


I have the same question with SeraphimSerapis
When I get the data in xml file: Gphone always gets the last data:
For example:
This is the information of student:
Name: NTUST
Adress: 123
Age:

So I want to get the data of student in xml file. How can I get it?
This is the information of student:
Name: Jane
Adress: ABC
Age: 20

Thanks,

-Alex
songotho
Experienced Developer
Experienced Developer
 
Posts: 55
Joined: Tue Mar 03, 2009 1:59 am

Postby padde » Thu Apr 09, 2009 10:29 am

Well.. when you read the <Student> tag set a bool to true and on reading ending tag </student> set it false..
same with school tag. In the <name> tag reading case check which bool is set student or school and copy the
value of name to different variable or so.. according to the bool states.
Maybe there is a smarter solution to this.. but thats the way i solved those issues and it works like a charm for me.


Greets
Padde
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby songotho » Thu Apr 09, 2009 2:57 pm

Thanks for your answer so if can, would you modify some code below:
Code: Select all
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
       if (localName.equals("Student")) {
           this.in_student = true;
        }
       if (localName.equals("Name")) {
           this.in_name = true;
        }
        if (localName.equals("Address")) {   
           this.in_address = true;
        }
        if (localName.equals("Age")) {
           this.in_age = true;
        }       
    }
   
    public void endElement(String namespaceURI, String localName, String qName)
              throws SAXException {
        if (localName.equals("Student")) {
           this.in_student = false;
        }
       if (localName.equals("Name")) {
           this.in_name = false;
        }
        if (localName.equals("Address")) {   
           this.in_address = false;
        }
        if (localName.equals("Age")) {
           this.in_age = false;
        }
    }
   
    public void characters(char ch[], int start, int length) {
             if(this.in_race_name){
                myParsedExampleDataSet.setName(new String(ch, start, length));
             }
               if(this.in_name){
                  myParsedExampleDataSet.setAddress(new String(ch, start, length));
                }
               if(this.in_price){
                   myParsedExampleDataSet.setAge(new String(ch, start, length));
                }               
    }


I tried it so it's error.

Thanks,

--Alex
songotho
Experienced Developer
Experienced Developer
 
Posts: 55
Joined: Tue Mar 03, 2009 1:59 am

Postby padde » Thu Apr 09, 2009 6:47 pm

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
  3.  
  4.         if (localName.equals("Student")) {
  5.  
  6.            this.in_student = true;
  7.  
  8.         }
  9.  
  10.         if (localName.equals("School")) {
  11.  
  12.            this.in_school = true;
  13.  
  14.         }
  15.  
  16.         if (localName.equals("Name")) {
  17.  
  18.            this.in_name = true;
  19.  
  20.         }
  21.  
  22.         if (localName.equals("Address")) {  
  23.  
  24.            this.in_address = true;
  25.  
  26.         }
  27.  
  28.         if (localName.equals("Age")) {
  29.  
  30.            this.in_age = true;
  31.  
  32.         }      
  33.  
  34.     }
  35.  
  36.    
  37.  
  38.     public void endElement(String namespaceURI, String localName, String qName)
  39.  
  40.               throws SAXException {
  41.  
  42.         if (localName.equals("Student")) {
  43.  
  44.            this.in_student = false;
  45.  
  46.         }
  47.  
  48.         if (localName.equals("School")) {
  49.  
  50.            this.in_school = false;
  51.  
  52.         }
  53.  
  54.         if (localName.equals("Name")) {
  55.  
  56.            this.in_name = false;
  57.  
  58.         }
  59.  
  60.         if (localName.equals("Address")) {  
  61.  
  62.            this.in_address = false;
  63.  
  64.         }
  65.  
  66.         if (localName.equals("Age")) {
  67.  
  68.            this.in_age = false;
  69.  
  70.         }
  71.  
  72.     }
  73.  
  74.    
  75.  
  76.     public void characters(char ch[], int start, int length) {
  77.  
  78.         if(this.in_student) {
  79.  
  80.                 // do stuff for student
  81.  
  82.                 if(this.in_name){
  83.  
  84.                     myParsedExampleDataSet.setStudentName(new String(ch, start, length));
  85.  
  86.                 }
  87.  
  88.                 if(this.in_address){
  89.  
  90.                     myParsedExampleDataSet.setStudentAddress(new String(ch, start, length));
  91.  
  92.                 }
  93.  
  94.                 if(this.in_age) {
  95.  
  96.                     myParsedExampleDataSet.setStudentAge(new String(ch, start, length));
  97.  
  98.                 }
  99.  
  100.         }
  101.  
  102.         if(this.in_school) {
  103.  
  104.                 // do stuff for school
  105.  
  106.                 if(this.in_name){
  107.  
  108.                     myParsedExampleDataSet.setSchoolName(new String(ch, start, length));
  109.  
  110.                 }
  111.  
  112.                 if(this.in_address){
  113.  
  114.                    myParsedExampleDataSet.setSchoolAddress(new String(ch, start, length));
  115.  
  116.                 }            
  117.  
  118.  
  119.  
  120.         }
  121.  
  122.     }
  123.  
  124.  
Parsed in 0.041 seconds, using GeSHi 1.0.8.4


somethin like that should do the trick...

Greets
Padde
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby songotho » Thu Apr 09, 2009 10:25 pm

Thank padde about some codes. I'd like to work with xml file and I think that you have some experiences about xml. Would I ask you one more question:
If the xml file is not element, it is attribute. How can I do it?
For example:
<Test>
<Student>
<Name displayname = "Jane"></Name>
<Address displayname = "ABC"></Adress>
<Age value = "20"></Age>
</Student>
<School>
<Name displayname = "NTUST"></Name>
<Adress displayname = "123"></Adress>
</School>
</Test>

Thanks,

--Alex.
songotho
Experienced Developer
Experienced Developer
 
Posts: 55
Joined: Tue Mar 03, 2009 1:59 am

Top

Postby padde » Thu Apr 09, 2009 11:59 pm

something like this...

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public void startElement(String namespaceURI, String localName,
  3.  
  4.                                     String qName, Attributes atts) throws SAXException
  5.  
  6. {
  7.  
  8.         if (localName.equals("Student")) {
  9.  
  10.            this.in_student = true;
  11.  
  12.         }
  13.  
  14.         if (localName.equals("School")) {
  15.  
  16.            this.in_school = true;
  17.  
  18.         }
  19.  
  20.         if (localName.equals("Name")) {
  21.  
  22.            if(this.in_student)
  23.  
  24.                myParsedExampleDataSet.setStudentName(atts.getValue("displayname")));
  25.  
  26.            if(this.in_school)
  27.  
  28.                myParsedExampleDataSet.setSchoolName(atts.getValue("displayname")));
  29.  
  30.         }
  31.  
  32.         if (localName.equals("Address")) {  
  33.  
  34.            if(this.in_student)
  35.  
  36.                myParsedExampleDataSet.setStudentAddress(atts.getValue("displayname")));
  37.  
  38.            if(this.in_school)
  39.  
  40.                myParsedExampleDataSet.setSchoolAddress(atts.getValue("displayname")));
  41.  
  42.         }
  43.  
  44.         if (localName.equals("Age")) {
  45.  
  46.            if(this.in_student)
  47.  
  48.                myParsedExampleDataSet.setStudentAge(atts.getValue("value")));
  49.  
  50.         }      
  51.  
  52.     }
  53.  
  54.    
  55.  
  56.     public void endElement(String namespaceURI, String localName, String qName)
  57.  
  58.               throws SAXException {
  59.  
  60.         if (localName.equals("Student")) {
  61.  
  62.            this.in_student = false;
  63.  
  64.         }
  65.  
  66.         if (localName.equals("School")) {
  67.  
  68.            this.in_school = false;
  69.  
  70.         }
  71.  
  72.     }
  73.  
  74.    
  75.  
  76.     public void characters(char ch[], int start, int length) { }
  77.  
  78. }
  79.  
  80.  
Parsed in 0.039 seconds, using GeSHi 1.0.8.4


Greets
Padde
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby songotho » Fri Apr 10, 2009 5:12 am

Thanks padde about more codes. So I tried with your codes:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public void startElement(String namespaceURI, String localName,
  2.                                     String qName, Attributes atts) throws SAXException
  3. {
  4.         if (localName.equals("Student")) {
  5.            this.in_student = true;
  6.         }
  7.         if (localName.equals("School")) {
  8.            this.in_school = true;
  9.         }
  10.         if (localName.equals("Name")) {
  11.            if(this.in_student)
  12.                myParsedExampleDataSet.setStudentName(atts.getValue("displayname")));
  13.            if(this.in_school)
  14.                myParsedExampleDataSet.setSchoolName(atts.getValue("displayname")));
  15.         }
  16.         if (localName.equals("Address")) {  
  17.            if(this.in_student)
  18.                myParsedExampleDataSet.setStudentAddress(atts.getValue("displayname")));
  19.            if(this.in_school)
  20.                myParsedExampleDataSet.setSchoolAddress(atts.getValue("displayname")));
  21.         }
  22.         if (localName.equals("Age")) {
  23.            if(this.in_student)
  24.                myParsedExampleDataSet.setStudentAge(atts.getValue("value")));
  25.         }      
  26.     }
  27.    
  28.     public void endElement(String namespaceURI, String localName, String qName)
  29.               throws SAXException {
  30.         if (localName.equals("Student")) {
  31.            this.in_student = false;
  32.         }
  33.         if (localName.equals("School")) {
  34.            this.in_school = false;
  35.         }
  36.     }
  37.    
  38.     public void characters(char ch[], int start, int length) { }
  39. }
  40.  
Parsed in 0.042 seconds, using GeSHi 1.0.8.4

And this is my ParsedExampleDataSet:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class ParsedExampleDataSet {
  2.        
  3.     private String Name=null;
  4.     private String Address=null;
  5.     private String Age=null;
  6.        
  7.      private String extractedString = null;
  8.      private int extractedInt = 0;
  9.  
  10.      public String getExtractedString() {
  11.           return extractedString;
  12.      }
  13.      public void setExtractedString(String extractedString) {
  14.           this.extractedString = extractedString;
  15.      }
  16.      public int getExtractedInt() {
  17.           return extractedInt;
  18.      }
  19.      public void setExtractedInt(int extractedInt) {
  20.           this.extractedInt = extractedInt;
  21.      }
  22.      public String toString(){
  23.           return "ExtractedString = " + this.extractedString
  24.                     + "nExtractedInt = " + this.extractedInt;
  25.      }
  26.      
  27. //  ***********************************
  28.     public String getStudentName(){
  29.         return Name;    
  30.        }
  31.     public void setStudentName(String name){
  32.         this.Name=name;
  33.        }
  34.    public String getSchoolName(){
  35.         return Name;    
  36.         }
  37.    public void setSchoolName(String name){
  38.         this.Name=name;
  39.         }
  40.    public String getStudentAddress(){
  41.         return Address;    
  42.         }
  43.     public void setStudentAddress(String address){
  44.         this.Address=address;
  45.         }
  46.     public String getSchoolAddress(){
  47.         return Address;
  48.         }
  49.     public void setSchoolAddress(String address){
  50.         this.Address=address;
  51.         }
  52.     public String getStudentAge(){
  53.         return Age;
  54.         }
  55.     public void setStudentAge(String age){
  56.         this.Age=age;
  57.         }
  58.    
  59.     public String toString1(){        
  60.         return  "Student's Name: " + getStudentName() + "n" +
  61.                         "Student's Address: " + getStudentAddress() + "n" +
  62.                         "Student's Age: " + getStudentAge() + "nn" +
  63.        
  64.                         "School's Name: " + getSchoolName() + "n" +
  65.                         "School's Address: " + getSchoolAddress();
  66.     }
  67. }
  68.  
Parsed in 0.044 seconds, using GeSHi 1.0.8.4


And this is output:
Student's Name: null
Student's Address: null
Student's Age:null

School's Name: null
School's Address:null

Thanks,

--Alex.
songotho
Experienced Developer
Experienced Developer
 
Posts: 55
Joined: Tue Mar 03, 2009 1:59 am

Postby padde » Fri Apr 10, 2009 11:53 am

This sample code parse...
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package de.XMLparser;
  2.  
  3. import java.io.IOException;
  4. import java.io.InputStream;
  5. import java.util.Vector;
  6.  
  7. import javax.xml.parsers.ParserConfigurationException;
  8. import javax.xml.parsers.SAXParser;
  9. import javax.xml.parsers.SAXParserFactory;
  10.  
  11. import org.xml.sax.Attributes;
  12. import org.xml.sax.InputSource;
  13. import org.xml.sax.SAXException;
  14. import org.xml.sax.XMLReader;
  15. import org.xml.sax.helpers.DefaultHandler;
  16.  
  17. import android.app.Activity;
  18. import android.os.Bundle;
  19. import android.widget.TextView;
  20.  
  21. class ParsedExampleDataSet {
  22.     private String schoolname;
  23.     private String studentname;
  24.     private String studentage;
  25.     private String studentaddress;
  26.     private String schooladdress;
  27.  
  28.     public String toString() {
  29.         return "Student's Name: " + studentname + "n" + "Student's Address: "
  30.                 + studentaddress + "n" + "Student's Age: " + studentage
  31.                 + "nn" + "School's Name: " + schoolname + "n"
  32.                 + "School's Address: " + schooladdress;
  33.     }
  34.    
  35.     public String getSchoolName() { return schoolname; }
  36.     public void setSchoolName(String schoolname) { this.schoolname = schoolname; }
  37.     public String getStudentName() { return studentname; }
  38.     public void setStudentName(String studentname) { this.studentname = studentname; }
  39.     public String getStudentAge() { return studentage; }
  40.     public void setStudentAge(String studentage) { this.studentage = studentage; }
  41.     public String getStudentAddress() { return studentaddress; }
  42.     public String getSchoolAddress() { return schooladdress; }
  43.     public void setStudentAddress(String studentaddress) {
  44.         this.studentaddress = studentaddress;
  45.     }
  46.     public void setSchoolAddress(String schooladress) {
  47.         this.schooladdress = schooladress;
  48.     }
  49. }
  50.  
  51. class ContentHandler extends DefaultHandler {
  52.     private enum Tags {
  53.         Test, Name, Age, School, Student, Address, Entry
  54.     }
  55.    
  56.     private boolean in_schoolTag = false;
  57.     private boolean in_studentTag = false;
  58.    
  59.     private ParsedExampleDataSet DataSet;
  60.     private Vector<ParsedExampleDataSet> MyParsedExampleDataSets;
  61.    
  62.    
  63.     public ContentHandler() {
  64.         super();
  65.         this.MyParsedExampleDataSets = new Vector<ParsedExampleDataSet>();
  66.     }
  67.  
  68.     public Vector<ParsedExampleDataSet> getParsedExampleDataSets() {
  69.         return this.MyParsedExampleDataSets;
  70.     }
  71.    
  72.     public void startDocument() throws SAXException { }
  73.     public void endDocument() throws SAXException { }
  74.  
  75.     public void startElement(String n, String l, String q, Attributes a) {
  76.          switch(Tags.valueOf(l)) {
  77.              case School:
  78.                  in_schoolTag = true;
  79.                  break;
  80.              case Student:
  81.                  in_studentTag = true;
  82.                  break;
  83.              case Address:
  84.                  if(in_studentTag)
  85.                      DataSet.setStudentAddress(a.getValue("displayname"));
  86.                  if(in_schoolTag)
  87.                      DataSet.setSchoolAddress(a.getValue("displayname"));
  88.                  break;
  89.              case Age:
  90.                  DataSet.setStudentAge(a.getValue("value"));
  91.                  break;
  92.              case Name:
  93.                  if(in_studentTag)
  94.                      DataSet.setStudentName(a.getValue("displayname"));
  95.                  if(in_schoolTag)
  96.                      DataSet.setSchoolName(a.getValue("displayname"));
  97.                  break;
  98.              case Entry:
  99.                  DataSet = new ParsedExampleDataSet();
  100.                  break;
  101.          }
  102.     }
  103.      
  104.     public void endElement(String n, String l, String q) {
  105.         switch(Tags.valueOf(l)) {
  106.             case School:
  107.                 in_schoolTag = false;
  108.                 break;
  109.             case Student:
  110.                 in_studentTag = false;
  111.                 break;
  112.             case Entry:
  113.                 MyParsedExampleDataSets.add(DataSet);
  114.                 break;
  115.         }
  116.     }
  117.      
  118.     public void characters(char ch[], int start, int length) { }
  119. }
  120.  
  121. public class XMLparserSample extends Activity {
  122.     private TextView myTextView;
  123.    
  124.     public void onCreate(Bundle savedInstanceState) {
  125.         super.onCreate(savedInstanceState);
  126.        
  127.         setContentView(R.layout.main);
  128.        
  129.         Vector<ParsedExampleDataSet> test = read(getResources().openRawResource(R.raw.sample));
  130.        
  131.         String text = "";
  132.         for(int i=0; i < test.size(); i++)
  133.             text += test.get(i).toString()+"n-------------------------n";
  134.        
  135.         myTextView = (TextView) findViewById(R.id.textview);        
  136.         myTextView.setText(text);
  137.     }
  138.    
  139.     public Vector<ParsedExampleDataSet> read(InputStream in) {
  140.         SAXParserFactory spf = SAXParserFactory.newInstance();
  141.         SAXParser sp;
  142.         try {
  143.             sp = spf.newSAXParser();
  144.             XMLReader xr = sp.getXMLReader();
  145.             ContentHandler ch = new ContentHandler();
  146.             xr.setContentHandler(ch);
  147.             xr.parse(new InputSource(in));
  148.             return ch.getParsedExampleDataSets();                
  149.         } catch (ParserConfigurationException e) {
  150.         } catch (SAXException e) {
  151.         } catch (IOException e) {}
  152.         return null;
  153.     }    
  154. }
  155.  
Parsed in 0.060 seconds, using GeSHi 1.0.8.4


...this sample.xml in the res/raw folder...
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0"?>
  2. <Test>
  3.     <Entry>
  4.         <Student>
  5.             <Name displayname = "Jane"/>
  6.             <Address displayname = "ABC"/>
  7.             <Age value = "20"/>
  8.         </Student>
  9.         <School>
  10.             <Name displayname = "NTUST"/>
  11.             <Address displayname = "123"/>
  12.         </School>
  13.     </Entry>
  14.     <Entry>
  15.         <Student>
  16.             <Name displayname = "Jane2"/>
  17.             <Address displayname = "ABCD"/>
  18.             <Age value = "21"/>
  19.         </Student>
  20.         <School>
  21.             <Name displayname = "NTUST2"/>
  22.             <Address displayname = "1234"/>
  23.         </School>
  24.     </Entry>
  25. </Test>
  26.  
Parsed in 0.004 seconds, using GeSHi 1.0.8.4


... and shows the results in the TextView of this main.xml in res/layout
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.    android:orientation="vertical"
  4.    android:layout_width="fill_parent"
  5.    android:layout_height="fill_parent"
  6. >
  7. <TextView  
  8.    android:id="@+id/textview"
  9.    android:layout_width="fill_parent"
  10.    android:layout_height="wrap_content"
  11. />
  12. </LinearLayout>
  13.  
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


Greets
Padde
Last edited by padde on Tue Apr 14, 2009 10:08 am, edited 1 time in total.
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby songotho » Sun Apr 12, 2009 9:11 am

I'm very thank you about this tutorial, thank padde about xml. Maybe would I contact you to ask sth about xml again?

Thanks,

--Alex
songotho
Experienced Developer
Experienced Developer
 
Posts: 55
Joined: Tue Mar 03, 2009 1:59 am

Postby padde » Sun Apr 12, 2009 1:15 pm

Sure.. no problem :)
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby songotho » Tue Apr 14, 2009 8:41 am

Hi pedde,

I have tried with xml:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0"?>
  2. <Test>
  3.   <Tag1>
  4.     <Student>
  5.         <Name displayname = "Jane"></Name>
  6.         <Address displayname = "ABC"></Address>
  7.         <Age value = "20"></Age>
  8.     </Student>
  9.     <School>
  10.         <Name displayname = "NTUST"></Name>
  11.         <Address displayname = "123"></Address>
  12.     </School>
  13.   </Tag1>
  14.   <Tag2>
  15.      ..........................
  16.   </Tag2>
  17. </Test>
  18.  
Parsed in 0.003 seconds, using GeSHi 1.0.8.4


So this function can't get data Enum<Enum<T>>.
When I get data with the xml above, my output is null.
How can I do with multiple tags? Would you tell me about it?

Thanks,

--Alex.
songotho
Experienced Developer
Experienced Developer
 
Posts: 55
Joined: Tue Mar 03, 2009 1:59 am

Postby padde » Tue Apr 14, 2009 10:10 am

I edited my above example to cover your new needs.

Greets
Padde
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby songotho » Tue Apr 14, 2009 3:09 pm

Hi pedde,

Thanks about your edited codes so if you use difference tags: Entry1, Entry 2, .... and get data in only Entry1, the function always get data in last Entry.
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0"?>
  3.  
  4. <Test>
  5.  
  6.     <Entry1>
  7.  
  8.         <Student>
  9.  
  10.             <Name displayname = "Jane"/>
  11.  
  12.             <Address displayname = "ABC"/>
  13.  
  14.             <Age value = "20"/>
  15.  
  16.         </Student>
  17.  
  18.         <School>
  19.  
  20.             <Name displayname = "NTUST"/>
  21.  
  22.             <Address displayname = "123"/>
  23.  
  24.         </School>
  25.  
  26.     </Entry1>
  27.  
  28.     <Entry2>
  29.  
  30.         <Student>
  31.  
  32.             <Name displayname = "Jane2"/>
  33.  
  34.             <Address displayname = "ABCD"/>
  35.  
  36.             <Age value = "21"/>
  37.  
  38.         </Student>
  39.  
  40.         <School>
  41.  
  42.             <Name displayname = "NTUST2"/>
  43.  
  44.             <Address displayname = "1234"/>
  45.  
  46.         </School>
  47.  
  48.     </Entry2>
  49.  
  50. </Test>
  51.  
  52.  
Parsed in 0.004 seconds, using GeSHi 1.0.8.4


Thanks,
--Alex
songotho
Experienced Developer
Experienced Developer
 
Posts: 55
Joined: Tue Mar 03, 2009 1:59 am

Postby padde » Tue Apr 14, 2009 4:32 pm

The tag is named "Entry" not Entry plus a number.
Why you want to number those tags?

Greets
PAdde <- notice the capital A :D
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Top
PreviousNext

Return to Novice Tutorials

Who is online

Users browsing this forum: Google Feedfetcher and 6 guests