Hi Carsten,

Again, thanks for the quick response.  Actually, you are correct. 
I've been a bit confused as I was printing out the media type which
was not syncing up, but as you've explained, this is not used for
determining which stylesheet to apply. 

My testing yesterday threw me off because I was passing in the
'user-agent' parameter, which does not seem to be working (but that's
ok for me - as long as it works for the actual device).  

Sorry for bothering you - I'll mosy back to the user's list!

thanks,
cass


--- Carsten Ziegeler <[EMAIL PROTECTED]> wrote:
> Hm, I am not quiet sure, but it seems to me that you are using two
> different approaches for detecting the user agent: the browser
> selector
> and the "browser detection" of the xslt transformer.
> The first one (browser selector) only uses the sitemap
> configuration
> whereas the xslt transformer only uses the browser.xml. 
> So, I would suggest that you first test only the browser selector
> in 
> the sitemap, which means, you add your devices to the configuration
> and test only if the browser selector chooses your correct
> stylesheet.
> If this does not work, then it's a bug and we will fix it.
> However, if this works, the second test is if the browser.xml
> configuration
> works. For this test it's best to not use the browser selector in
> the
> sitemap and only use a simple stylesheet printing out the values.
> 
> Please correct me anyone if I am wrong, but I think you only need
> one
> of the both approaches. The browser selector is for use in the
> sitemap
> and the browser.xml for use in an stylesheet.
> 
> I hope this helps,
> 
> Carsten
> 
> 
> 
> > Cassandra Bonner wrote:
> > 
> > Hi Carsten,
> > 
> > Thank you for the response.  I have taken your advise and printed
> out
> > some debugging in both BrowserSelectorFactory as well as
> BrowserImpl.
> >  I feel that this confirms there is an issue with selecting the
> > appropriate media/browser.
> > 
> > I know that you've said browser.xml is only used by XSLT
> transformer,
> > but while selecting the media/browser in BrowserImpl, it's only
> > looking at the browsers in browsers.xml (see printout below),
> which
> > does not pick up additions to 
> > 
> > This can be tested easily by adding a new BrowserSelector,
> creating a
> > specific stylesheet for it, and passing in "user-agent='test user
> > agent'.  I have put simple changes to stylesheets for a Phillips
> and
> > Ericsson phone, but it's picking up the generic wap stylesheet. I
> > haven't included my sitemap setup as it's the same as the
> original
> > email, except that i've added an additional PHIL entry for a
> philips
> > phone.
> > 
> > Within BrowserSelectorFactory, reading from sitemap (this part
> seems
> > to work fine):
> > 
> > node attr, wap equals test :: wap
> > node attr, wap equals test :: wap
> > node attr, wap equals test :: wap
> > node attr, netscape equals test :: netscape
> > node attr, wap equals test :: wap
> > node attr, wap equals test :: wap
> > node attr, wap equals test :: wap
> > node attr, wapR380 equals test :: wapR380
> > node attr, netscape equals test :: netscape
> > 
> > 
> > BrowserImpl 
> > ===========
> > - using 380 as user-agent.  Also tested via actual wap phone and
> > issue is the same.  Notice that it only compares against the
> listings
> > in browser.xml, not the entries in sitemap.  The media type
> > determined here is than used through the fulfillment of the
> request,
> > resulting in the
> > 
> > 
> > WITHIN IN BROWSERIMPL:: COMPOSE
> > user agent = 380 (from request)
> > accept type = */* (from request)
> > user agent = UP.Browserand  userAgent = 380
> > user agent = Nokiaand  userAgent = 380
> > user agent = MSPIEand  userAgent = 380
> > user agent = MSIEand  userAgent = 380
> > user agent = MO01and  userAgent = 380
> > user agent = HandHTTPand  userAgent = 380
> > 
> > ====
> > The user agent didn't match any of the user agents in the db
> > ====
> > **It should have, 380 is one of my entries in sitemap (see below)
> > 
> > no browser match - media = */*and currentType = text/html
> > no browser match - media = */*and currentType = text/vnd.wap.wml
> > text/html  (because i'm doing this from IE, forcing user-agent
> and
> > passing in 380).
> > 
> > Here's the results when i don't pass in the user-agent.
> > 
> > WITHIN IN BROWSERIMPL:: COMPOSE
> > user agent = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
> > accept type = image/gif, image/x-xbitmap, image/jpeg,
> image/pjpeg,
> > application/vnd.ms-excel, application/msword,
> > application/vnd.ms-powerpoint, */*
> > user agent = UP.Browser and  userAgent = Mozilla/4.0 (compatible;
> > MSIE 5.01; Windows NT 5.0)
> > user agent = Nokia and  userAgent = Mozilla/4.0 (compatible; MSIE
> > 5.01; Windows NT 5.0)
> > user agent = MSPIE and  userAgent = Mozilla/4.0 (compatible; MSIE
> > 5.01; Windows NT 5.0)
> > user agent = MSIE and  userAgent = Mozilla/4.0 (compatible; MSIE
> > 5.01; Windows NT 5.0)
> > 
> >
>
====================================================================
> > Matches only bc MSIE is in browsers.xml (but it's not in my
> sitemap)
> >
>
=====================================================================
> > MATCH ::: userAgent match - ua = MSIE and userAgent = Mozilla/4.0
> > (compatible; MSIE 5.01; Windows NT 5.0)
> > text/html
> > 
> > 
> > If anyone can take a look at this and test by adding an
> additional
> > Selector in your sitemap, and an additional "when" clause for the
> new
> > user-agent, creating an "altered" stylesheet (such as an
> additional
> > statement to confirm the stylesheet is picked up) for this new
> > agent(ie media), and simply pass in "?user-agent='test useragent'
> or
> > use an actual device is possible, I think you'll confirm that the
> > issue exists.  thanks in advance,
> > 
> > cass
> > 
> > 
> > --- Carsten Ziegeler <[EMAIL PROTECTED]> wrote:
> > > Hi Cass,
> > > 
> > > I just evaluated the browser selector and in my test case it
> worked
> > > as expected.
> > > The Browser selector
> > > (org.apache.cocoon.selection.BrowserSelectorFactory)
> > > does not use the browser.xml (This is used by the xslt
> > > transformer).
> > > 
> > > The browser selector uses the configuration of the sitemap, so
> your
> > > changes to the sitemap.xmap should be used. You can verify this
> by
> > > looking at the compiled sitemap which is located in the working
> > > directory of your servlet engine.
> > > 
> > > I would suggest that you change the BrowserSelectorFactory: Add
> > > some
> > > debugging methods to the generateMethodSource() which print out
> the
> > > queried user agent and the values tested against (the pattern
> > > array).
> > > This should show very quickly if there is a bug in the selector
> or
> > > not. (I can't test it here, as I only have the usual html
> browsers
> > > at hand).
> > > 
> > > HTH
> > > 
> > > 
> > > Carsten
> > > 
> > > Open Source Group                        sunShine -
> b:Integrated
> > >
> ================================================================
> > > Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100
> Paderborn
> > > www.sundn.de                          mailto:
> [EMAIL PROTECTED]
> > >
> ================================================================
> > > 
> > > 
> > > > Cassandra Bonner wrote:
> > > >
> > > >
> 
=== message truncated ===


__________________________________________________
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to