Hi,
That code snippet at the web site you listed did not work for me. I tried it
with and without Xerces2.
My publicID was always null. So, I changed the code to be as follows:
docBuilder.setEntityResolver(new EntityResolver()
{
public InputSource resolveEntity(java.lang.String publicId, java.lang.String
systemId)
throws SAXException, java.io.IOException
{
return new InputSource(new ByteArrayInputStream("<?xml version='1.0'
encoding='UTF-8'?>".getBytes()));
}
});
This works under Xerces2 but throws an exception using Sun's JDK XML libraries.
But since I use Xerces2, I'm happy again. <grin>
Although, at that link someone commented that when they write out the XML data
the DTD is lost. Since, I was thinking of adding the ability to edit the XML
in the JTree, I guest I will have this problem too.
Paul, did you try this code snippet out yet?
later
Roger...
Quoting Paul Franz <[EMAIL PROTECTED]>:
> RE: [jdjlist] Re: XML QuestionCheck the URL:
>
> http://forum.java.sun.com/thread.jsp?forum=34&thread=284209
>
> I gotta love Google
> ----- Original Message -----
> From: Greg Nudelman
> To: jdjlist
> Sent: Thursday, October 30, 2003 2:35 PM
> Subject: [jdjlist] Re: XML Question
>
>
> Quoting Roger...
> > Well, I was thinking of hacking the XML data to remove the "<!DOCTYPE ...
> >"
> > tag (internal to my program only).
>
> That would likely be my approach as well. No, not pretty at all, and not
> too quick with Java either (Perl anyone?) :-)
>
> If someone knows of a better "Java" way to do this, I as well would be
> curious to hear it.
>
> Greg
>
> -----Original Message-----
> From: Roger Lacroix [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 30, 2003 11:20 AM
> To: jdjlist
> Subject: [jdjlist] Re: XML Question
>
>
>
> Hi,
>
> The XML data is flowing through a variety of MQSeries queue managers
> (including
> Windows, Unix and even the mainframe). There are hundreds of queue
> managers in
> our environment.
>
> The purpose of the tool is for programmers, QA testers, etc.. to quickly
> view
> the XML data as it flows through our environment. I do not want to
> download
> the different DTDs (hundreds, if not thousands) from all of the boxes and
> then
> have to manage the local DTDs and give them out to users. This would
> become a
> nightmare.
>
> Well, I was thinking of hacking the XML data to remove the "<!DOCTYPE ...
> >"
> tag (internal to my program only). It is not pretty, but at least it will
>
> allow XML data to be displayed in a JTree with an error.
>
> later
> Roger...
>
> ---
> You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
> [EMAIL PROTECTED]
> http://www.sys-con.com/fusetalk To unsubscribe from all mailing lists,
> click:
>
> http://sys-con.com/[EMAIL PROTECTED]
con.com
>
> ---
> You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
> [EMAIL PROTECTED]
> http://www.sys-con.com/fusetalk
>
>
> To unsubscribe from all mailing lists, click:
> http://sys-con.com/[EMAIL PROTECTED]
con.com
>
---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk
To unsubscribe from all mailing lists, click:
http://sys-con.com/[EMAIL PROTECTED]