I'm stuck with using JDK 1.1.7 and I want to get the fully qualified DNS name of the machine my JVM is running on. If I use the following code:
java.net.InetAdress ia = java.net.InetAdress.getLocalHost();
String addr = ia.getHostName();
The addr is not qualified. Does any know of a way of doing...
Checked Xerces-J 2.0.0 and crimson 1.1.3 and chiph is correct. The property names I gave must be out of date.
The correct names are:
http://xml.org/sax/properties/lexical-handler
http://xml.org/sax/properties/declaration-handler
The usual property name for the Lexical Handler is:
"http://xml.org/sax/handlers/LexicalHandler"
It depends on which parser you are using.
Likewise, for the DeclHandler:
"http://xml.org/sax/handlers/DeclHandler"
The choice of XML representation depends on what you are doing. SAX is good if you are working with large documents because document models store the entire document in memory. Generally, a document model is easier to code for. JAXP can be used to invoke SAX and DOM. JDOM and dom4j are more...
I'll repost the previous answer - I didn't preview my post before submitting it and the escape sequence examples were printed incorrectly.
You should always use the escape sequence '&' for ampersands in XML. Other characters that are usually escaped are:
< <
> >
' '
" "...
You should always use the escape sequence '&' for ampersands in XML. Other characters that are usually escaped are:
< <
> >
' '
" "
Alternatively, you can use CDATA. For example:
<root>
<![CDATA[
&><'"
]]>
</root>
Further to what Mr. Tom said, JDOM have some samples of how to turn a JDBC ResultSet into a JDOM. The resulting JDOM can be output as XML using the org.jdom.output.XMLOutputter class.
http://cvs.jdom.org/cgi-bin/viewcvs.cgi/jdom-contrib/samples/
I found the answer to my own query. The javax.xml.transform.Transformer now has a setErrorListener(...) method. Once an ErrorListener is attached to the Transformer object, any SAXExceptions thrown in my pipe will be passed on through the Transformer to the ErrorListener.
I have a system doing the following:
SAX Pipe(input) -> SAXSource -> Xalan -> SAXResult -> SAX Pipe(output)
If I get an exception in the SAX Pipe(output), I want to pass a SAXException back down the program stack. Xalan currently swallows my SAXExceptions. Does anyone know of a feature that I...
When you include the DTD line, the XML parser will usually look for the file that is specified. If possible, leave out this line. Otherwise you have to conatact camelotherald.com and ask them to make the dtd file available over the web - it is currently not to be found in its specified location.
I'm quite new to XSL and all the tutorials seem to be oriented towards XML -> HTML conversions - I want XML -> XML.
I have something like:
<name>
<first>Joe</first>
<last>Soap</last>
</name>
I want to convert this to:
<name first="Joe" last="Soap"/>
I've tried...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.