Cirip Tomas wrote:
> Why? Where is it getting "d:\tc\" from? I parse XML Document using following
> code
Without a base systemId to work with, the parser tries to locate
the DTD by using the current working directory of the application
to expand the relative systemId. To avoid this and use your ow
The 2nd Edition of Java & XML by Brett McLaughlin (O'Reilly) is a must for
all Java/XML developers. It uses xerces for most of the examples.
Cheers!
-Original Message-
From: RichardBondi [mailto:[EMAIL PROTECTED]
Sent: Friday, February 15, 2002 8:05 AM
To: [EMAIL PROTECTED]
Subject: Book
It gives you the fully resolved URI. This lets you know exactly where it's
looking for that dtd file. If that is not the location of the dtd file, then
that is why you have the entity resolver in the first place. Return the
InputSource that points to the correct location of the file.
If you always
Hi again,
hope that will not be quallified as spamming
;-)
I think the problem starts earlier. I have a System.out.println("Hello");
statement at the beginnig of the method resolveEntity(String publicId, Sring
systemId). The Statement is never reached, so I think the method is never
called,
Yes. But why is parser asking for entity "file:///d:/tc/test.dtd"? If I have
only "test.dtd" in XML document it should bring only "test.dtd" in systemId
and give me a chance to resolve it in custom EntityResolver, or not? Or do I
have to remove "file:///d:/tc/" from systemId? That's strange, isn't
Marcus,
Try this:
schema = new InputSource("file:///F:/ZHW/test/ReqSchema.xsd");
That worked for me in a similar situation while trying to resolve the path
to my dtd location, so maybe it will work for you in this case. If not, I
defer to higher authority (ie: someone else who has a clue ;-)
i assume that you are running your program from the directory d:\tc,
correct?
On Fri, 15 Feb 2002, Cirip Tomas wrote:
> Hi all,
>
> I still have a problem with entity resolver:
>
> here is a fraction of XML document
>
>
>
>
>
> anyway I get systemId="d:\tc\test.dtd" in resolveEntity method
Hi Paul,
your ansewer came very fast. Thank you!
Actually I tried that with the MyResolver class:
here is the code:
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import java.io.FileReader;
import java.io.FileNotFoundException;
public class MyResolver implements EntityResolver{
Hi all,
I still have a problem with entity resolver:
here is a fraction of XML document
anyway I get systemId="d:\tc\test.dtd" in resolveEntity method of my
EntityResolver.
when I specify
I get systemId="d:\tc\xml\test.dtd"
Why? Where is it getting "d:\tc\" from? I parse XML Document
Marcus
Rather than adding the resolveEntity method to your processor, you need to
create a new MyEntityResolver class that implements the EntityResolver
interface, and override the single resolveEntity method. Then pass a new
instance of this class to the parser.setEntityResolver() method. Exa
thank you laura for helping!
well, i picked up that with the EntityResolver. The class DefaultHandler
in org.xml.sax.helpers does implements this Method. So I have overwritten
(extends ; sorry my English) the
public InputSource resolveEntity(String publicId, String systemId) throws
SAXExcepti
When people use the term "recursion" with regard to xml schemas, what they
usually mean is elements that (either directly or indirectly) can contain
themselves--more properly, cyclicity in the digraph defined by the schema.
How about this:
http://www.w3.org/2001/XMLSchema"; elementFormDefault="
Hi all,
could someone please give me a hint. I am using the xerces DOM parser like
this:
parser = new org.apache.xerces.parsers.DOMParser();
parser.setFeature( "http://xml.org/sax/features/validation";, true );
I am parsing a xml document that refers to an external dtd. Although i
enable the
fea
Hello,
We want to be able to programatically analyse the content model of a
schema, with a view to creating e.g. an empty form where the user can enter
a new instance of the document.
So far, the only route we have seen which looks likely to provide that is
the DOM Level 3 Abstract Schem
Is there a book on xerces?
Thanks,
r:b:
_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional c
> it's certainly solvable, but it's not currently on anybody's list of
> things to do AFAIK.
Yes, it's solvable, and yes, it's on my todo list.
The solution would be straightforward: storing line/column numbers in DOM
nodes. But the real change is pretty big: for every single place where we
repor
Thanks; that helps set the context. Pushing the more extreme forms of fixup
into a later XNI module does sound entirely reasonable.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
publicId is null because you didn't specify one; systemId is null because
it's a bug of Xerces-2. Downloading the latest jar files
(http://gump.covalent.net/jars/latest/xml-xerces2/) should solve the
systemId problem.
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]
Hi All,
I try to write my own EntityResolver for DOMParser. I create instance of
DOMParser use setEntityResolver. Anyway, when it reaches resolveEntity
method both publicID, systemID parameters are null. What am I doing wrong?
Thank you
Tomas
XML document is:
I think having an HTML parser available is definitely a Good Idea.
One question: A huge percentage of the files out there which claim to be
HTML aren't, or at least aren't correct HTML. Browsers are generally very
forgiving and attempt to read past those errors but exactly how they
recover va
Hi Andy,
I have a need to spider various government web site to detect changes in
their pages and walk the links recursively. Ideally I'd like to use you HTML
parser as part of this process.
I've tried using GNU's wget, but it doesn't handle several types of dynamic
web site well.
Do you think t
Joseph Kesselman/CAM/Lotus wrote:
> One question: A huge percentage of the files out there which claim to be
> HTML aren't, or at least aren't correct HTML. Browsers are generally very
> forgiving and attempt to read past those errors but exactly how they
> recover varies from browser to browse
oh no. i was afraid you would say that. your suggestion would have
significant reprecussions.
i agree that it's probably less difficult if one thinks outside the
XMLSchema box, but as of now, this needs to be 100% XMLSchema.
On Fri, 15 Feb 2002, Eddie Robertsson wrote:
> > so, A,AB,ABA,ABAB,...
> so, A,AB,ABA,ABAB,... etc are legal
I think this would be hard to implement in W3C XML Schema alone. However by
embedding Schematron rules within the XML Schema this would be trivial to do.
I've put up a draft paper describing this technique at [1].
Cheers,
/Eddie
[1] http://www.topologi.com/p
24 matches
Mail list logo