Re: does urlregexpmapping work correctly?

Jacob Kjome <[email protected]>
Newsgroups gmane.comp.java.enhydra.xmlc
Message-ID <[email protected]>
Hi Kyle,

I think you are expecting a result that you shouldn't necessarily 
expect.  The paths in the html file looks like this....

"../../images/junk.gif"
and
"../images/junk2.gif"

then you have the following regexp patterns...

-urlregexpmapping \.\./ ../ln/ -urlregexpmapping \.\./ln/\.\./ln/ ../

The first regexp will result in...

"../ln/../ln/images/junk.gif"
and
"../ln/images/junk2.gif"

Everything matches up with expectations to this point.  However, when the 
second regexp is run, you seem to have the expectation that it will act 
upon the result of the previous regexp run.  However, I believe that the 
actual behavior is to run each regexp upon the patterns found in the 
original file, not upon any result from previous regexp runs.

Does that make sense?  So, in fact, there is nothing that the second regexp 
actually matches against in the original file and, therefore, the second 
regexp will have no effect, as you have found in this experiment.

Unless it is determined that a sort of regexp "chaining" is supported by 
XMLC, this is not a bug, but expected behavior.  Mark Diekhans should be 
able to definitively determine whether this is the case or not.  If 
"chaining" isn't supported, maybe the question should be "should it be 
supported"?  If it isn't the default now, it probably shouldn't be the 
default later, otherwise  a lot of users will find unexpected 
behavior.  Maybe it could be another command-line option?  Either way, any 
addition like this won't be making it into XMLC-2.2.  Possibly it will make 
it into a future release, but we'll need help to determine both wither it 
is worth doing and how exactly to do it (not to mention determining the 
issues involved in chaining multiple regexps).

Jake

At 01:50 PM 7/30/2003 -0600, you wrote:
>Attached is a zip file containing a very simple example of the problem I 
>am seeing. In this example there is only one -urlregexpmapping args being 
>executed. I am using xmlc 2.2beta. There is a readme.txt that explains 
>setup and what I am seeing. If anyone has a few minutes to see if they see 
>the same problem, it would help.
>
>Thank you for your time,
>
>-Kyle Aaron
>
> >>> [email protected] 7/30/2003 10:41:46 AM >>>
>Hi Kyle,
>
>At 09:21 AM 7/30/2003 -0600, you wrote:
> >I have been doing more tests on the -urlregexpmapping arg to the xmlc
> >command. It seems that the xmlc command will support two -urlregexpmapping
> >args but not more. To test this, I created an index.htm that has a three
> >images in it with the urls ../images/im1.gif, ../images/im2.gif,
> >and  ../images/im3.gif. I use three -urlregexpmapping args to replace each
> >../images/im<num>.gif to be images/im<num>.jpg. Only two of the mappings
> >take place. The third is ignored.
>
>Can you attach actual test cases you used, including your options.xmlc and
>the html files (attach in a zip file)?
>
> >I have two questions:
> >Has anyone experienced this problem before and how did you resolve it?
> >Should this be listed as a bug since xmlc's documentation says that many
> >-urlregexpmapping args can be used?
>
>I would think it is a bug.  I trust you are using the latest XMLC?  That
>is, either XMLC-2.2beta1 or the latest XMLC CVS?  If not, see:
>http://forge.objectweb.org/projects/xmlc/
>
>
> >Also, for some reason the -urlregexpmapping does not support the lookahead
> >feature. This feature is supported by GNU but only with the expression
> >syntax set to Perl 5. The default xmlc is using is another syntax that
> >does not support lookahead.
>
>Any idea where this is set?  I haven't looked at how XMLC implements
>-urlregexpmapping as of yet, so any pointers would be helpful.  I don't see
>why XMLC's default shouldn't allow full functionality?  Anyone else have
>comments on this?
>
> >One last note; the most recent version of Java's regex supports both
> >lookahead and lookbehind. This could really become handy in urlmappings.
>
>I don't foresee using the JDK's regexp stuff since that wasn't added until
>j2sdk1.4, right?  I think we still want to say we are compatible with
>JDK1.3.1 (or maybe even 1.3.0).  I also don't see changing from gnu-regexp
>for the XMLC-2.2 release since we are purely in bugfix mode moving toward
>release at this time.  We could consider moving to one of the Jakarta
>regexp packages for a later XMLC release which, very likely, supports
>lookbehind.  Maybe you can investigate this?
>
>Jake
>
>
> >- Kyle Aaron
> >
> >
> >
> >
> >------------------------------------------------------------------------- 
> -----
> >This message may contain confidential information, and is intended only
> >for the use of the individual(s) to whom it is addressed.
> >
> >
> >========================================================================= 
> =====
> >
> >
> >_______________________________________________
> >XMLC mailing list
> >[email protected]
> >http://www.enhydra.org/mailman/listinfo.cgi/xmlc
>
>_______________________________________________
>XMLC mailing list
>[email protected]
>http://www.enhydra.org/mailman/listinfo.cgi/xmlc
>
>
>
>------------------------------------------------------------------------------
>This message may contain confidential information, and is intended only 
>for the use of the individual(s) to whom it is addressed.
>
>
>==============================================================================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.