[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: rexml dtd parser

Nilez Parker

8/19/2008 2:11:00 PM

I have had the same problems using the dtd parsing section of rexml. I
got past all the errors only to find that it's not really parsing all
parts of the dtd. The parse_helper isn't even written quite correctly as
a parser -- it ends up catching only the ElementDeclarations, then
possibly a few things after the last ElementDeclaration. Anyway, it
looks like it's not a fully-written feature of rexml yet. I decided
since I need it I'll have to write my own ruby DTD-parser. I might be
putting it on github as a gem (check back at http://github.co...
later).

By the way, does ANYBODY out there know of a real dtd parser in ruby? I
need one that will parse a dtd and actually understand the lists of
attributes and child elements and such. (If none show up, watch for
mine, I probably won't post it to this list, but it'll be on github.)

~Daniel

Nathan Taylor wrote:
> I seem to have some personal confusion with how to correctly utilize the
> rexml/dtd library. I am using ruby version 1.8.6 and when I orginally
> tried
> to use the code I received some unknown method errors. I modified the
> code
> in the case statement contained in dtd.rb from the notation
> when ElementDecl.PATTERN_RE
>
> to when ElementDecl::PATTERN_RE
>
> I no longer received these errors. However, I am now receiving the
> following error.
>
> uninitialized constant REXML::DTD::EntityDecl::PATTERN_RE
>
> When I look at the code in entitydecl.rb I see the following line;
>
> md = source.match( PATTERN_RE, true )
>
> However PATTERN_RE is not declared or intialized in the entitydecl.rb
> file.
> Am I implementing the library wrong or is this code still bugged?
>
> Any help is much appreciated.
>
>
> Below is a snapshot of how I am trying to use this library.
>
>
> #!/usr/bin/ruby -dw
>
> require "rexml/dtd/dtd"
> require "pathname"
>
>
>
> dtdarg = ARGV[0]
>
> def dtdparse(dtdfile)
> path = Pathname::new(dtdfile)
> if path.relative? then
> dtdfile = File::expand_path(dtdfile)
> end
> dtddata = REXML::DTD::Parser::parse(dtdfile)
> puts dtddata
> end
>
>
> dtdparse(dtdarg)

--
Posted via http://www.ruby-....

5 Answers

Mitchell Holman

1/20/2012 3:35:00 AM

0

Jason@nospam.com (Jason) wrote in
news:Jason-1901121242340001@67-150-174-173.lsan.mdsg-pacwest.com:

> In article
> <dfritzin-69F121.07212419012012@news.eternal-september.org>, David
> Fritzinger <dfritzin@nospamtome.hotmail.com> wrote:
>
>>
>> I believe the head of the Swift Boaters were the same people who got
>> McCain out of the 2000 race by spreading rumors before the South
>> Carolina primary that McCain had fathered a black child. Real
>> honorable people you believe, Jason.
>
> I believed them.


Name one claim of the Swiftboaters that has been proven.

Put it right here:





DanielSan

1/20/2012 8:58:00 AM

0

On 1/20/2012 12:58 AM, Jason wrote:
> In article<Xns9FDFA8D1181A6nomailcomcastnet@216.196.121.131>, Mitchell
> Holman<nomailcomcast.net> wrote:
>
>> Mitchell Holman<nomailcomcast.net> wrote in
>> news:Xns9FDED42681409nomailcomcastnet@216.196.121.131:
>>
>>> Mitchell Holman<nomailcomcast.net> wrote in
>>> news:Xns9FDE4998232BAnomailcomcastnet@216.196.121.131:
>>>
>>>> Jason@nospam.com (Jason) wrote in news:Jason-1701122354170001@67-150-
>>> 174-
>>>> 64.lsan.mdsg-pacwest.com:
>>>>
>>>>> In article<Xns9FDDD624E89F7nomailcomcastnet@216.196.121.131>,
>>> Mitchell
>>>>> Holman<nomailcomcast.net> wrote:
>>>>>
>>>>>> Jason@nospam.com (Jason) wrote in
>>>>>> news:Jason-1701121423480001@67-150-171-48.lsan.mdsg-pacwest.com:
>>>>> I continue to believe
>>>>> the Swift Boat people were telling the truth.
>>>>
>>>>
>>>> Why? Kerry's crewmates said he acted
>>>> with heroism, the soldier he rescued said
>>>> he acted with heroism, the US Navy said
>>>> he acted with heroism - what proof do you
>>>> have that says differently?
>>>
>>>
>>>
>> Pity Jason refuses to answer this one.
>>
>>
>>
>
> I don't remember the details--I just remember that I was a fan and
> supporter of the Swift Boat People mainly because I shared their world
> view.

You mean a world view based upon lies?

Jason

1/20/2012 8:59:00 AM

0

In article <Xns9FDFDA599A4D4nomailcomcastnet@216.196.121.131>, Mitchell
Holman <nomailcomcast.net> wrote:

> Jason@nospam.com (Jason) wrote in
> news:Jason-1901121242340001@67-150-174-173.lsan.mdsg-pacwest.com:
>
> > In article
> > <dfritzin-69F121.07212419012012@news.eternal-september.org>, David
> > Fritzinger <dfritzin@nospamtome.hotmail.com> wrote:
> >
> >>
> >> I believe the head of the Swift Boaters were the same people who got
> >> McCain out of the 2000 race by spreading rumors before the South
> >> Carolina primary that McCain had fathered a black child. Real
> >> honorable people you believe, Jason.
> >
> > I believed them.
>
>
> Name one claim of the Swiftboaters that has been proven.
>
> Put it right here:

I don't remember all of the details. It's an old story.


Mitchell Holman

1/20/2012 1:06:00 PM

0

Jason@nospam.com (Jason) wrote in news:Jason-2001120059080001@67-150-171-
47.lsan.mdsg-pacwest.com:

> In article <Xns9FDFDA599A4D4nomailcomcastnet@216.196.121.131>, Mitchell
> Holman <nomailcomcast.net> wrote:
>
>> Jason@nospam.com (Jason) wrote in
>> news:Jason-1901121242340001@67-150-174-173.lsan.mdsg-pacwest.com:
>>
>> > In article
>> > <dfritzin-69F121.07212419012012@news.eternal-september.org>, David
>> > Fritzinger <dfritzin@nospamtome.hotmail.com> wrote:
>> >
>> >>
>> >> I believe the head of the Swift Boaters were the same people who got
>> >> McCain out of the 2000 race by spreading rumors before the South
>> >> Carolina primary that McCain had fathered a black child. Real
>> >> honorable people you believe, Jason.
>> >
>> > I believed them.
>>
>>
>> Name one claim of the Swiftboaters that has been proven.
>>
>> Put it right here:
>
> I don't remember all of the details. It's an old story.


Then why did you bring up the Swiftboaters
AND your continuing support for them?

YOU said they were correct.

Well, what were they correct about?




David Fritzinger

1/20/2012 3:10:00 PM

0

In article
<Jason-2001120059080001@67-150-171-47.lsan.mdsg-pacwest.com>,
Jason@nospam.com (Jason) wrote:

> In article <Xns9FDFDA599A4D4nomailcomcastnet@216.196.121.131>, Mitchell
> Holman <nomailcomcast.net> wrote:
>
> > Jason@nospam.com (Jason) wrote in
> > news:Jason-1901121242340001@67-150-174-173.lsan.mdsg-pacwest.com:
> >
> > > In article
> > > <dfritzin-69F121.07212419012012@news.eternal-september.org>, David
> > > Fritzinger <dfritzin@nospamtome.hotmail.com> wrote:
> > >
> > >>
> > >> I believe the head of the Swift Boaters were the same people who got
> > >> McCain out of the 2000 race by spreading rumors before the South
> > >> Carolina primary that McCain had fathered a black child. Real
> > >> honorable people you believe, Jason.
> > >
> > > I believed them.
> >
> >
> > Name one claim of the Swiftboaters that has been proven.
> >
> > Put it right here:
>
> I don't remember all of the details. It's an old story.

Run, Jason, run!