Moving on, the parsing result is fed to a Transformer by using some code in
xalan's example "SAX2SAX".
This is the first time I need to hook up SAX with transform, I would much
appreciate if anyone has more good examples.
Thanks.
Ying
-----Original Message-----
From: Sfikas, Ted [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 2:02 PM
To: '[EMAIL PROTECTED]'
Subject: RE: dtd and ent over network
Ying:
Hah! That's what I did too... Good for you.
-Ted
-----Original Message-----
From: Wu, Ying (LNG-CIS) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 10:46 AM
To: '[EMAIL PROTECTED]'
Subject: RE: dtd and ent over network
Ted:
It helps! Having resolveEntity returned a dummy dtd, I am able to parse the
xml file with a SAX parser.
Thanks a lot.
Ying
-----Original Message-----
From: Sfikas, Ted [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 11:44 AM
To: '[EMAIL PROTECTED]'
Subject: RE: dtd and ent over network
Ying:
I ran into this issue when I created an EJB that validated XML files
--- I call the EJB "DocumentValidatorBean".
Since EJBs are resident in Containers, no Java I/O is allowed;
therefore, DocumentValidatorBean must implement the "resolveEntity( String
pSystemID, String pPublicID )" method which is part of the "EntityResolver"
interface. The "EntityResolver" interface will be part of your Java parser
Class upon extending "DefaultHandler".
Although I am pulling out DTD's from an ORACLE database for the
validation of my input XML files, this may apply to your problem because
whenever I ran across an XML file that I did not want to have validated, I
applied logic in the "resolveEntity" method that took that into account.
Perhaps you could code the same type of thing for your problem( ie. whenever
you have a certain network DTD referenced in your DOCTYPE tag, you can
return an InputSource value that generically validates all XML files to be
good ).
Hope that helps!
-Ted Sfikas
-----Original Message-----
From: Wu, Ying (LNG-CIS) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 5:25 AM
To: '[EMAIL PROTECTED]'
Subject: dtd and ent over network
On NT workstation, I need to handle xml files with the doctype points to a
network driver, --
<!-- in source xml file -->
<!DOCTYPE PUB-ENTRY SYSTEM "\\box\folder\file1.dtd">
the file1.dtd itself, points to files over network --
<!-- in dtd file -->
<!ENTITY % HTMLspecial PUBLIC
"A PUBLIC ID" "//box/folder/file2.ent">
%HTMLspecial;
Both xerces parser and xalan transforming processor gave error " file:
<file:///\\box\folder\file1.dtd> <file://\\box\folder\file1.dtd>
\\box\folder\file1.dtd" not found, using -ENTITYRESOLVER with xalan process
or using setSystemID with parser did not help.
Even when using xml.parsers.SAXParserFactory.setValidating(false), the
parser still looks for the dtd file.
Thanks.
Ying
301-941-2953
-----Original Message-----
From: Voytenko, Dimitry [ <mailto:[EMAIL PROTECTED]>
mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 12:04 PM
To: '[EMAIL PROTECTED]'
Subject: RE: transforming, how to disable validation
Hi Ying,
Class javax.xml.parsers.SAXParserFactory has methods
setValidating/isValidating. They should do.
Thanks,
Dmitry
-----Original Message-----
From: Wu, Ying (LNG-CIS) [ <mailto:[EMAIL PROTECTED]>
mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 06:23
To: '[EMAIL PROTECTED]'
Subject: transforming, how to disable validation
I need to transform a xml file, which contains a doctype node:
<!DOCTYPE PUB-ENTRY SYSTEM "\\a.dtd">
The transforming process will first validate the input file.
Is there any xalan API to tell the Process do not validate, just transform?
Both command line and java code are OK, I just don't want to get into the
parser level.
Thanks,
Ying Wu
301-941-2953