Revision 1581
Added by Jing Tao over 21 years ago
src/edu/ucsb/nceas/metacat/CatalogMessageHandler.java | ||
---|---|---|
50 | 50 |
private Vector updates = new Vector(); |
51 | 51 |
private Vector indivUpdate = new Vector(); |
52 | 52 |
String currentTag = new String(); |
53 |
StringBuffer textBuffer = new StringBuffer(); |
|
53 | 54 |
|
54 | 55 |
/** |
55 | 56 |
* This method starts a new vector for each updatedDocument tag. |
... | ... | |
62 | 63 |
{ |
63 | 64 |
indivUpdate = new Vector(); |
64 | 65 |
} |
66 |
textBuffer = new StringBuffer(); |
|
65 | 67 |
} |
66 | 68 |
|
67 | 69 |
/** |
... | ... | |
70 | 72 |
public void endElement(String uri, String localName, String qName) |
71 | 73 |
throws SAXException |
72 | 74 |
{ |
75 |
if(currentTag.equals("entry_type") || currentTag.equals("source_doctype") |
|
76 |
|| currentTag.equals("target_doctype") || currentTag.equals("public_id") |
|
77 |
|| currentTag.equals("system_id")) |
|
78 |
{ |
|
79 |
|
|
80 |
indivUpdate.add((textBuffer.toString()).trim()); |
|
81 |
} |
|
73 | 82 |
if(localName.equals("row")) |
74 | 83 |
{ |
75 | 84 |
updates.add(new Vector(indivUpdate)); |
... | ... | |
81 | 90 |
*/ |
82 | 91 |
public void characters(char[] ch, int start, int length) throws SAXException |
83 | 92 |
{ |
84 |
if(currentTag.equals("entry_type") || currentTag.equals("source_doctype") |
|
85 |
|| currentTag.equals("target_doctype") || currentTag.equals("public_id") |
|
86 |
|| currentTag.equals("system_id")) |
|
87 |
{ |
|
88 |
//System.out.println("parser adding: " + (new String(ch, start, length)).trim()); |
|
89 |
indivUpdate.add((new String(ch, start, length)).trim()); |
|
90 |
} |
|
93 |
textBuffer.append(new String(ch, start,length)); |
|
91 | 94 |
} |
92 | 95 |
|
93 | 96 |
public Vector getCatalogVect() |
Also available in: Unified diff
Revise code to handle text node were splited into two nodes.