I only see two nodes that have attributes, the <book> node
and the <price> node. But your answer is
"Number of attribute nodes: 3". Why?
In DOM, everything is a node. So, the
attribute "isbn" with value "1-2345-6789-0" is one
node (of type attribute).
Then there is another attribute node for the attribute
"year" (with value "1994"), and
a third attribute node with name "currency"
and value "USD".
So, we do not mean the number of ELEMENT nodes that have
attributes, but we actually mean the number of attribute=value
definitions that appear in the document.
When I try to use the dictionary XML file to test my program, I get:
"Exception in thread 'main'
java.lang.OutOfMemoryError : Java heap space". How can I solve this
problem?
You can increase the java heap size by using the -Xmx command line.
In general:
java -Xms<initial heap size> -Xmx<maximum heap size>
The Defaults are:
java -Xms32m -Xmx128m
So, try running your program with
java -Xmx512m ...
That should hopefully give you enough heap size.
(btw, our reference implementation does run on the dictionary file
without heap space problem. So, you might have been too wasteful
with memory; maybe you are using more recursion than necessary?!)
It is OK if your program needs, say -Xmx512m, in order to handle
the
large dictionary file.
But if you need more than 512m, then there is definitely something
wrong with your program (and you won't get maximum points then).
I will work from home; how can I submit the assignment?
You have to transfer your source file to a machine at CSE
(for instance, using the "scp" command).
The you should log into a CSE machine (for instance, using
the "ssh" command); from there (in the directory
where you have the file you want to submit) do
give cs4317 ass1 <yourfile>
This will submit your file to the course account.
CRICOS Provider Number: 00098G