This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of DevSecOps Adventures: A Game-Changing Approach with Chocolate, LEGO, and Coaching Games and have Dana Pylayeva on-line!
See this thread for details.

Veronica Damian

Ranch Hand
+ Follow
since Feb 04, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Veronica Damian

hi,

I have an intriguing date-formatting problem.. the code we normally use (http://www.mayacove.com/misc/xslt_date.txt) is not working with an RSS-feed..

in RSS feed the date for some entries contain the word "yesterday", and it's messing up how the date is displayed (no month 03, something like that, is how date is displayed..)
(I know word "yesterday" in date is causing this b/c problem occurs only for dates with word "yesterday" in them..)

I was wondering if anybody has any suggestions as to what the solution here would be.. what kind of formatting I need in XSLT...

thank you very much..
thank you very much.. that's what I thought (since for 'and' it's 'and'..;)
but it's being ignored..
ok, thanks again..

Originally posted by Paul Clapham:
Yes, you can. And if you were trying to ask how, well, the XSLT "or" operator is "or".

hi,

can you do conditionals with "or" in XSLT? (equiv. of "||" in a java conditional...)

I don't think <xsl:choose> would accomplish same goal, as I don't want to have to repeat content in XSLT..

I want to say IF a certain param in custom-tag equals this or that or that other THEN put this content here..

thank you very much..
hi, I need to test for a param in custom tag..

<xsl:if test="ARTICLE/MAPPING/KEYSET/SECONDARY='NEWS STORY 1'">

but: I have three of these, generated with a loop (so secondary key can be either NEWS STORY 1, NEWS STORY 2, or NEWS STORY 3.. how do I test for if secondary key CONTAINS string 'NEWS STORY' without having to test for entire NEWS STORY 1 or 2 or 3?

(I need a sort of 'indexOf' way of doing this instead of '.equals'.....;)

thank you very much...
hi, I'm having a problem with Javamail.. I can send email only to one recipient.. if I try to send to more than one recipient I get an error..

message.setRecipient(Message.RecipientType.TO, to);
message.addRecipient(Message.RecipientType.TO, toW);

I get an error unless I remove 2nd line...


(I don't want to add both recipients in one stmt because the 2nd one will go inside a conditional; whether email gets sent to 2nd address will depend on whether user checks a checkbox in the form..)

if I use addRecipient() for both addresses, thus:

message.addRecipient(Message.RecipientType.TO, to);
message.addRecipient(Message.RecipientType.TO, toW);

I also get an error.. only way I don't get an error is if I leave only one of the two stmts..

I put everything in a try-stmt now.. so what happens now is it doesn't throw an error, but it still doesn't tell me why email doesn't get sent..

try {
InternetAddress from = new InternetAddress(sEmail, sName);
message.setFrom(from);
InternetAddress to = new InternetAddress(sMe);
InternetAddress toW = new InternetAddress(sMeW);
message.setRecipient(Message.RecipientType.TO, to);
// message.addRecipient(Message.RecipientType.TO, toW);
// email doesn't get sent if I leave above line..
message.setSubject(Subj);
message.setText(sMessage);
Transport.send(message);

} catch (Exception ex) { // also tried:
} catch (MessagingException ex) { // b/c this is
// exc thrown by Transport.send() method..
// in both cases I don't know why email isn't getting sent..
System.out.println("error attempting to send email");
}

what do I have to do to find out why email isn't getting sent?

thank you very much..
17 years ago
hi,

I'm trying to send email to two addresses... thus have:

message.setRecipient(Message.RecipientType.TO, to);
message.addRecipient(Message.RecipientType.TO, toW);

I get an error unless I remove 2nd line...

(I don't want to add both recipients in one stmt because the 2nd one will go inside a conditional; whether email gets sent to 2nd address also will depend on whether user checks a checkbox in the form..)

if I use addRecipient() for both addresses, thus:

message.addRecipient(Message.RecipientType.TO, to);
message.addRecipient(Message.RecipientType.TO, toW);

I also get an error.. only way I don't get an error is if I leave only one of the two stmts..

thank you very much...
17 years ago
no no no.. I don't need to pass XSLT param to tag, I need to pass param grabbed from query string in url to XSL stylesheet...

this is what it is:

AffData = request.getParameter("AffiliateData");

this param I need to pass to XSL specified in the tag (tag is in same JSP where code is to grab param..)

<placeContent:DisplayTopArticles ... styleSheet="/xsl/dta_body.xsl">

how to I pass param grabbed from query string in url to stylesheet specified in custom tag..

thank you very much..
PLEASE.. PRETTY PLEASE.. I need an answer.......

thank you very much..



Originally posted by Veronica Damian:
hi,

I need to pass a param in query string of url and pass it to a link that's in XSL..

http://www.mysite.com/attendees.jsp?eventid=<valueHere>

there is a custom tag that prints dynamic content w/an XSL stylesheet..

<placeContent:DisplayTopArticles ... styleSheet="/xsl/dta_body.xsl">

we cannot alter structure of XML (by adding a tag or a param to an existing tag), so... how to pass 'eventid' param to the XSL stylesheet specified in this tag?

thank you very much..

hi,

I need to pass a param in query string of url and pass it to a link that's in XSL..

http://www.mysite.com/attendees.jsp?eventid=<valueHere>

there is a custom tag that prints dynamic content w/an XSL stylesheet..

<placeContent:DisplayTopArticles ... styleSheet="/xsl/dta_body.xsl">

we cannot alter structure of XML (by adding a tag or a param to an existing tag), so... how to pass 'eventid' param to the XSL stylesheet specified in this tag?

thank you very much..
ok, I asked guy at my webhosting, this is what finally worked:

/chroot/home/<myuid>/<mydomain>/tomcat/webapps/india/delhi/images



many thanks for yr help...
17 years ago

Originally posted by Joe Ess:


No to both of your questions. File can resolve relative paths. It does not take URL's of the format "http", but will take URL's of the format "file:". Are you deploying your app to a Unix server? They use different file path roots and seperators.

It is a Bad Idea to try to use hard-coded file locations in web applications. They are just too easy to break. javax.servlet.ServletContext has methods to obtain information about your deployment. Have a look and let us know what you find out.




yes but what separators do I need if dir I want is in current dir?

oh brother.. looking at javax.servlet.ServletContext you mentioned, not sure what method counts how many files in a dir..

thank you..
17 years ago
File dir = new File("C:\\apache-tomcat-5.5.17\\webapps\\india\\delhi\
\images");

this works fine in my machine locally, but on my website.. if, say,
I'm in dir where 'images' dir is, this doesn't work...

File dir = new File("images")

starting @ root of webapp also doesn't work...

File dir = new File("/india/delhi/images");

names of directors are good, they are all lowercase...

have conditional to test...

if (imgsList == null)
out.println("null");

always prints 'null' on my website...

do paths in this constructor have to be absolute? so on my website
path would have to start with "http..."???

is this an access problem? all I want to do is count how many images are in 'images' dir..

thank you...
17 years ago
pls see screenshot here to see what I mean..

http://www.mayacove.com/ss_error.gif

thanks..
thank you for your suggestion, but this is clearly an XSL problem.. if I view src-code and display that in browser it looks fine.. (also syntax of generated HTML code is fine..)

(it also displays fine if I test in StylusStudio..)

thank you..
I'm going crazy here.. have spent over an hour trying to trouble-shoot this.. records are overlapping (displaying on top of other..) ONLY in IE.. in FF they display fine.. xsl code:

<table border="0" cellpadding="0" cellspacing="0" width="421">
<tr><td>
<div class="hdrLinkDiv"><a href="/ws/content_display/sponsors/{CONTENT_KEY}" class="hdrLink"><xsl:value-of select="ARTICLE/HEADLINE" /></a>
</div>
<div class="sectionHdr"><xsl:if test="ARTICLE_EXTRA/TEMPLATE_SPEC/ADDITIONAL_INFORMATION/DATE!=''"><xsl:value-of select="ARTICLE_EXTRA/TEMPLATE_SPEC/ADDITIONAL_INFORMATION/DATE"/> - <xsl:value-of select="ARTICLE_EXTRA/TEMPLATE_SPEC/ADDITIONAL_INFORMATION/HEADLINE_TIME"/> <br/></xsl:if>
Sponsored By: <a href="{ARTICLE_EXTRA/TEMPLATE_SPEC/ADDITIONAL_INFORMATION/SPONSOR_LINK}" class="hdrLink2"><xsl:value-of select="ARTICLE_EXTRA/TEMPLATE_SPEC/ADDITIONAL_INFORMATION/SPONSOR_NAME"/></a><br/>
Partner: <a href="{ARTICLE_EXTRA/TEMPLATE_SPEC/ADDITIONAL_INFORMATION/BRAND_LINK}" class="hdrLink2"><xsl:value-of select="ARTICLE_EXTRA/TEMPLATE_SPEC/ADDITIONAL_INFORMATION/BRAND_NAME"/></a></div>
</td><tr>

<tr><td>
<div class="readMoreDiv3"><a href="/ws/content_display/event/{CONTENT_KEY}" class="readMore">Read More</a> <a href="/ws/content_display/event/{CONTENT_KEY}"><img src="/ws/images/read_more_arrow.gif" border="0" /></a><a href="/ws/content_display/event/{CONTENT_KEY}" class="readMore">
</a> | <a href="{ARTICLE_EXTRA/TEMPLATE_SPEC/ADDITIONAL_INFORMATION/REGISTER_URL}" target="_blank" class="readMore">Register Now</a></div>
</td></tr></table>
<br clear="all"/>

records are displaying on top of each other...

would appreciate some help/suggestions..

thank you very much..