You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Stuart D Jackson <st...@jhu.edu> on 2000/06/26 18:06:19 UTC
quick questions - Creating a DOM Tree in memory
I am having some problems using Xerces and I was hoping someone could help
me. Here is an overview of what I am doing: I am querying a database,
and I want to turn the results into a DOM tree in memory to use with XSL.
Here are my questions.
1) Is there a tool/class that will turn a ResultSet into a DOM?
2) I can set attribute values for an Element, but I cannot set the value
of the node. In other words, I can get it to do:
<column attributeName="index"></column>
but I can't it to do:
<column>index</column>
3) To test the DOM, I am printing it out using an OutputFormat:
OutputFormat format = new OutputFormat( documnet1 );
format.setLineWidth(8192);
format.setPreserveSpace(true);
format.setIndent(4);
XMLSerializer ser = new XMLSerializer(System.out, format);
ser.serialize( domparser1.getDocument() );
The problem with this is that it does not print out any spaces or line
breaks between the elements:
<sql_result><column name="index"></column><column
name="val1"></column></sql_result>
instead of:
<sql_result>
<column name="index"></column>
<column name="val1"></column>
</sql_result>
If anyone has any ideas on how to fix these problems, I would really
appreciate it. Thanks a lot.
-Stuart Jackson