Hi all.
I noticed the following while using Xindice 1.1b3 under Windows 2000 Professional and Java 1.4.2_01.
I added several documents to a collection. The content of each document is like the following:
<Element type="Route"><Name>name_of_the_process_element</Name> ... </Element>
First I retrieve some documents with the following code:
String xpath = "//Element[TopLevel='true']";
ResourceSet resourceSet = null;
try {
resourceSet = queryService.query(xpath);
ResourceIterator resourceIterator = resourceSet.getIterator();
pe = new ProcessElement[(int) resourceSet.getSize()];
int i = 0;
while (resourceIterator.hasMoreResources()) {
XMLResource resource = (XMLResource) resourceIterator.nextResource();
pe[i].setName(DOMParser.toDocument((String)resource.getContent()).getElementsByTagName("Name").item(0).getFirstChild().getNodeValue() );
++i;
}
} catch (XMLDBException e) {
System.err.println("XML:DB Exception occured " + e.errorCode + " " + e.getMessage());
System.err.println(e);
} catch (XindiceException e) {
System.err.println(e);
}
this all works fine
When I afterwards execute the following
ProcessElement child = new ProcessElement();
try {
XMLResource resource = (XMLResource)processes.getResource(id);
Document doc = DOMParser.toDocument((String) resource.getContent());
child.setName(DOMParser.toDocument((String)resource.getContent()).getElementsByTagName("Name").item(0).getFirstChild().getNodeValue() );
} catch (XMLDBException e) {
System.err.println("XML:DB Exception occured " + e.errorCode + " " + e.getMessage());
System.err.println(e);
} catch (XindiceException e) {
System.err.println(e);
}
I notice that the name isn't complete. By debugging in Eclipse I found out that the content of the element "Name" hast been splitted up into two child elements of the type TextImpl. So, by using the getFirstChild() method I only get one part of it.
I also noticed that the splitting takes place just after 64 characters of the file.
Yes, I could paste all the child elements of the type TextImpl together, but is there also another way?
Thanks
Martin