You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by Jason Bishop <ja...@netrequisite.com> on 2001/04/06 23:33:41 UTC

howto: dtd via URL?

howdy folks.  Just downloaded xerces-p 1.3.3 and xerces-c 1.4.
Had a bit of a learning curve trying to understand how to use
the Dom interface from perl, but I got it last night. so, everything is
working good except I just tried to switch the dtd to an URL and I'm now
getting an error:

FATAL ERROR:
LINE:    2
COLUMN:  85
MESSAGE: An exception occured! Type:MalformedURLException, Message:The URL
used an unsupported protocol


using this xml:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE FloConnect SYSTEM
"http://floconnect.flonetwork.com/floconnect/flo30.dtd">

This is a basic thing I'm sure but I couldn't figure it out.  same xml
works with xerces-j.

platform is linux and i cut-n-pasted the build instructions for xerces-c
from the README.  If I download the dtd and use the file everything works
fine.  only the URL one is giving problems.

thank you

Jason


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: howto: dtd via URL?

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"jason bishop" <ja...@cnet.com> writes:

> Thanks goes out to all the hard work.  Its funny, I looked at the
> apache site a few weeks ago and there was a perl XML parser for
> windows on there.  So I reported back to my boss that maybe we could
> get a java environment setup instead cause there wasn't a perl XML
> parser on apache and I wasn't sure I wanted to use the cpan one.
> Then I went back to verify and bam, there was everything I wanted.

Well, that's kind of what happened. I didn't actually bother changing
the WWW site until 1.3.3 was out the door. I also haven't advertised
in any of the useful places.

> Examples were very helpful.  I was able to get the thing running
> very quickly with those.  life was good.  

Good, I'm glad. We have very limited SAX documentation, mainly because
I use DOM for everything and know nothing about SAX. We're soliciting
for useful examples, so if you have any, please feel free to donate.

> Once I wanted to start picking through DOM's though, i fell flat on
> my face.  Then again, I'm very inexperienced in XML so this is just
> part of the deal.

DOM can be a bit hairy, I suppose. I love it. Build in an memory
hierarchy of the document, and pick out the pieces that you want. With
SAX, you have to build a complicated state machine to figure out what
you need to do with the bits as they come in off the wire, but with
DOM, you always know what to do.

> Once I found Xerces_wrap.doc I was much better.  Basically
> unfamiliar with the objects.  

I left it around 'cause I thought people might like it.

> perldoc is ok, but javadoc is pretty nice when it comes to objects
> returning other objects and keeping all those things straight.
> href's work good there...

There's a very nice online documentation hierarchy for Xerces at:
http://xml.apache.org/xerces-c/apiDocs/index.html

I'd recommend using that. It's for the C++ API, but it translates to
Perl exactly.

> If I come up with anything small and useful i'll send it to the
> list.  Or maybe not.  xerces-c, j, and p all seem to have the same
> stuff in samples dir.  Did one person work on that?

Nope. They just cloned them.

> > Hmmm.... This sounds like an underlying problem with
> > xerces-c. Xerces.pm isn't touching this. I'll forward this to the
> > xerces-c-dev list and see what folks there say.
> >
> 
> I just subscribed to c list, so I'd be interested in what replys we get.
> 
> Here's the code in question:

Hmmm... This could be a perl problem. I had some funny behaviour with
a 'file://foo/bar' URL at one point, but it went away. Should be able
to follow the URL in the debugger and watch what it gets. Problem is
there's a trick to debugging perl with dynamic libraries. You need to
use gdb and perl -d together. First start 'gdb /usr/local/bin/perl',
and then start perl -d 'your-script.pl'. Then figure out what your
process ID for 'perl -d' is and from inside gdb do 'attach perl-pid'
(which should know load all the necessary dynamic libraries, and give
you a prompt). Then you can set the breakpoint in the C++ code, and
hit continue in gdb, and continue in the perl debugger, and gdb should
stop at the breakpoint in the C++ code.

> Thanks for your help.  I got kind of lost in the Xerces.pm (not
> familiar with SWIG) so didn't realize it had to be c++ parser
> showing through.  I can probably figure out if I spend a couple of
> minutes with it.  There is support, so just a matter of making it
> happy.

SWIG makes a pretty gnarly module. It's a very thin veneer over the
underlying C++ code, so we've perlified it a bit using the
postModule.pl and postSource.pl scripts.

Cheers,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: howto: dtd via URL?

Posted by jason bishop <ja...@cnet.com>.
"Jason E. Stewart" wrote:

> Hey Jason,
>
> Glad you took the time to work with Xerces.pm
>
>

Thanks goes out to all the hard work.  Its funny, I looked at the apache site a
few weeks ago and there was a perl XML parser for windows on there.   So I
reported back to my  boss that maybe we could get a java environment setup
instead cause there wasn't a perl XML parser on apache and I wasn't sure I
wanted to use the cpan one.  Then I went back to verify and bam, there was
everything I wanted.  Examples were very helpful.  I was able to get the thing
running very quickly with those.  life was good.  Once I wanted to start
picking through DOM's though, i fell flat on my face.  Then again, I'm very
inexperienced in XML so this is just part of the deal.


>
> Any advice of how we could make this easier on folks? Maybe some nice
> example apps??
>
>

Once I found Xerces_wrap.doc I was much better.  Basically unfamiliar with the
objects.  perldoc is ok, but javadoc is pretty nice when it comes to objects
returning other objects and keeping all those things straight.  href's work
good there...

If I come up with anything small and useful i'll send it to the list.  Or maybe
not.  xerces-c, j, and p all seem to have the same stuff in samples dir.  Did
one person work on that?


> Hmmm.... This sounds like an underlying problem with
> xerces-c. Xerces.pm isn't touching this. I'll forward this to the
> xerces-c-dev list and see what folks there say.
>

I just subscribed to c list, so I'd be interested in what replys we get.

Here's the code in question:

BinInputStream* LibWWWNetAccessor::makeNew(const XMLURL&  urlSource)
{
    XMLURL::Protocols  protocol = urlSource.getProtocol();
    switch(protocol)
    {
        case XMLURL::HTTP:
        {
            BinURLInputStream* retStrm = new BinURLInputStream(urlSource);
            return retStrm;
            break;
        }

        //
        // These are the only protocols we support now. So throw and
        // unsupported protocol exception for the others.
        //
        default :
            ThrowXML(MalformedURLException,
XML4CExcepts::URL_UnsupportedProto);
            break;
    }
    return 0;
}


So its just a matter of making getProtocol() happy.  I'll futz with it a little
bit later tonight...

Thanks for your help.  I got kind of lost in the Xerces.pm (not familiar with
SWIG) so didn't realize it had to be c++ parser showing through.  I can
probably figure out if I spend a couple of minutes with it.  There is support,
so just a matter of making it happy.

Jason



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: howto: dtd via URL?

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"jason bishop" <ja...@netrequisite.com> writes:

> "Jason E. Stewart" wrote:
> 
> > Hmmm.... This sounds like an underlying problem with
> > xerces-c. Xerces.pm isn't touching this. I'll forward this to the
> > xerces-c-dev list and see what folks there say.
> >
> 
> yup.  you got me.  I had messed up my compile of xerces-c.  Didn't have some of
> the headers I needed and netacccessor/socket stuff failed to compile.  thanks
> for your help.  Everything is working.

Excellent! Glad to hear it was simple.

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: howto: dtd via URL?

Posted by jason bishop <ja...@netrequisite.com>.
"Jason E. Stewart" wrote:

> Hmmm.... This sounds like an underlying problem with
> xerces-c. Xerces.pm isn't touching this. I'll forward this to the
> xerces-c-dev list and see what folks there say.
>

yup.  you got me.  I had messed up my compile of xerces-c.  Didn't have some of
the headers I needed and netacccessor/socket stuff failed to compile.  thanks
for your help.  Everything is working.

Jason



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: howto: dtd via URL?

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
Hey Jason,

Glad you took the time to work with Xerces.pm

"Jason Bishop" <ja...@netrequisite.com> writes:

> howdy folks.  Just downloaded xerces-p 1.3.3 and xerces-c 1.4.
> Had a bit of a learning curve trying to understand how to use
> the Dom interface from perl, but I got it last night. 

Any advice of how we could make this easier on folks? Maybe some nice
example apps??

> so, everything is
> working good except I just tried to switch the dtd to an URL and I'm now
> getting an error:
> 
> FATAL ERROR:
> LINE:    2
> COLUMN:  85
> MESSAGE: An exception occured! Type:MalformedURLException, Message:The URL
> used an unsupported protocol
> 
> 
> using this xml:
> <?xml version="1.0" standalone="no"?>
> <!DOCTYPE FloConnect SYSTEM
> "http://floconnect.flonetwork.com/floconnect/flo30.dtd">
> 
> This is a basic thing I'm sure but I couldn't figure it out.  same xml
> works with xerces-j.

Hmmm.... This sounds like an underlying problem with
xerces-c. Xerces.pm isn't touching this. I'll forward this to the
xerces-c-dev list and see what folks there say. 

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org