joseph cooper

Ranch Hand
+ Follow
since Nov 08, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by joseph cooper

On the internet you can find artiles like

Bobby Woolf: WebSphere SOA and J2EE in Practice
http://www.ibm.com/developerworks/blogs/page/woolf
15 years ago
It looks like the xmlparserv2 (2002) was upgraded to xerces parser (2004).
1. I found a xmlparserv2.jar.
2. I can get the output listed. It seems the fo tags are being ignored. The output is displaying name, speciality, and a list of drugs all on different lines. What I was looking for was two columns displaying something like this:



Hopefully these code tags will display the two columns.

3. Not all the source code is there. This is a massively huge xsl document. I had added in xmlns:fo="http://www.w3.org/1999/XSL/Format" in the xsl:stylesheet version="1.0" line and the fo tags down in the code where I needed the formatting to happen.

I am a relative newbie to xsl so I hope that I have answered these questions correctly.
The fo tags that I have added do not seem to be reconized. I can get an output without the formatting happening. What I am trying to do is create two parallel columns. Can anyone see anything that I have missed. Any help would be greatly appreciated.

<!-- code -->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master page-height="300mm" page-width="300mm" master-name="PageMaster">
<fo:region-body margin="" />
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="PageMaster">
<fo:flow flow-name="xsl-region-body">
<fo:table table-layout="fixed" width="100mm">
<fo:table-column column-number="1" column-width="75mm"/>
<fo:table-column column-number="2" column-width="50mm"/>
<fo:table-body>
<xsl:for-each select="distinctphysician">
<fo:table-row>
<fo:table-cell text-align="left">
<xsl:for-each select="col1">
<fo:block>
<xsl:value-of select="$newlineChar"/>
<xsl:value-of select="physician"/>
<xsl:value-of select="$newlineChar"/>
<xsl:value-of select="speciality"/>
<xsl:value-of select="$newlineChar"/>
</fo:block>
</xsl:for-each>
<fo:block/>
</fo:table-cell>
<fo:table-cell text-align="left">
<xsl:for-each select="col2">
<fo:block>
<xsl:value-of select="drugname"/>
<xsl:value-of select="$newlineChar"/>
</fo:block>
</xsl:for-each>
<fo:block/>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>

<!-- output -->
Harper, John MD
Internal Medicine
Calan

Smith, Bob MD
Cardiologist
Coumadin
Jantoven
Lortab
Moban
Noxafil
Valium
Valtrex
I might of accidently ran across the answer using xsl-fo.
I need to create a html page and an xsl version of the same page. I ran across a valign command that would allow me to list two parallel columns on the html page. I was trying to figure out a comparible way to do this in xsl?

I am a relitive newbie to xsl and xslt so my lingue is probably not completely correct.

<!-- html page -->
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<TBODY>
<xsl:for-each select="distinctphysician">
<TR>
<TD valign="top" width="37%">
<xsl:for-each select="col1">
<br/>
<xsl:value-of select="physician"/>
<br/>
<xsl:value-of select="speciality"/>
</xsl:for-each>
</TD>
<TD valign="top">
<xsl:for-each select="col2">
<br/>
<xsl:value-of select="drugname"/>
</xsl:for-each>
</TD>
</TR>
</xsl:for-each>
</TBODY>
</table>

<!-- xsl page -->
<xsl:for-each select="distinctphysician">
<xsl:for-each select="col1">
<xsl:value-of select="$newlineChar"/>
<xsl:value-of select="physician"/>
<xsl:value-of select="$newlineChar"/>
<xsl:value-of select="speciality"/>
<xsl:value-of select="$newlineChar"/>
</xsl:for-each>
<xsl:for-each select="col2">
<xsl:value-of select="$newlineChar"/>
<xsl:value-of select="drugname"/>
</xsl:for-each>
<xsl:value-of select="$newlineChar"/>
</xsl:for-each>

output to be listed in two parallel columns:
Smith, Bob MD Coumadin
Cardiologist Jantoven
Lortab
Moban

Any help to set me upon the correct path would greatly be appreciated.
Is there some type of function within xslt that can draw a line across a webpage?

I am a newbie. This is the only thing I can think of. I have searched the internet and have not come up with anything useful.


<TD width="60%" align= "left">
<font>
<xsl:value-of select="concat('-------------------------------------------------------------------------------', ' ')"/>
</font>
</TD>
I am fairly new to xslt/html and I do not have all the lingo down. Yes I have the text of the url and I am wanting the url to appear as a hyperlink on the web page. I can now get the link to show up on the web page, but when I click on the link I get a "page cannot be displayed" error. I also tried to have the hyperlink open the site on a new page. I am receiving an error "Cannot find 'file:///C:DEV/IBM/wid6.0.1/JavaProject/ResultFormat/log/link'. Make sure the path or Internet addres is correct." I do not know where the path is coming from but the internet address is correct. From the IE I can open the page myself.

Is there something else that needs to be added?

Thanks for the help in advance

I added this

code:

Element link = xmlDoc.createElement("link");
link.appendChild(xmlDoc.createTextNode(memberOfClientList.link));
client.appendChild(link);

xslt:

<TD width="93%">
<font color="blue">
<!--<a href="link" target="_blank">-->
<a href="link">
<xsl:value-of select="link"/>
</a>
</font>
</TD>
I am being passed a text version of an URL address. This address prints on the worksheet. I need to change the code to activate the address on the worksheet when selected.

I have been trying to figure out where is the best location to make the change. Do I convert the address to an URL address in the java code and then display it or do I continue to pass the text version of the address to the xslt code and make the conversion there?

java code:
//millmanlink = "http://www.google.com/";
Element millmanlink = xmlDoc.createElement("millmanlink");
millmanlink.appendChild(xmlDoc.createTextNode memberOfClientList.millmanLink));
client.appendChild(millmanlink);

and some xslt code that prints this address on the worksheet

xslt code:
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<TBODY>
<TR>
<TD width="99%">
<font color="blue">
<xsl:value-of select="millmanlink"/> <!-- target=_blank -->
</font>
</TD>
</TR>
</TBODY>
</table>
I am trying to return an URL created from a string. I am getting an error on the return statement "site cannot be resolved". I am assuming that site is not being reconized as an URL? I am not seeing how to resolve this. Any help would be appreciated.


URL createURL(String urlString)
throws MalformedURLException
{
final String openNewInternetWindow = " target=_blank";
try
{
urlString = "http://www.google.com/";
urlString = urlString + openNewInternetWindow;
URL site = new URL(urlString);
}
catch(MalformedURLException me)
{
throw new MalformedURLException(me.getMessage());
}
return site;
} //createURL
16 years ago
The result of the first pass through the loop is to set the first physician into the distinct physician list. The data that I am dealing with in not normalized data. There could be multiple physicians with the same name. When a physician is found that is not in the distinct list than it is added it to the list. This is actual code. There are other conditions going on that are not relivant to the physician problem and that code has been commented out.
16 years ago
I am trying to create a distinct physician list from a previous physician list. A lot of other code was removed to try to focus on the problem of the overlaying of the physician names. If a second name is found in the physician list then do not add it to the distinct list. It finds distinct physician names. The problem is when it is added to the distinct list that the array gets overlaid by the present information.
16 years ago
I am trying to add physician names to an arraylist. Everytime I add in a new physician name it copies over all the physician names to the lastest name. I can not seem to figure out where the problem lies. The first physician I add in for [0] is Bob Smith MD. This is okay. The second physician I add in for [1] is Harry Jones MD. Any help would be appreciated.

debugger output lookes like this:
"aDistinctPhysicianList"=ArrayList
elementData = Object[10]
[0]=RxDbDrugRecord
physician="Harry Jones MD"
[1]=RxDbDrugRecord
physician="Harry Jones MD"

ArrayList distinctPhysicianList(ArrayList physicianList)
{
RxDbDrugRecord distinctPhysician = null;
ArrayList aDistinctPhysicianList = null;
aDistinctPhysicianList = new ArrayList();
int resultSet = 0;

for (int i=0;i<physicianList.size(); i++)
{
RxDbDrugRecord aPhysicianList = (RxDbDrugRecord) physicianList.get(i);
if (i==0)
{
distinctPhysician = new RxDbDrugRecord();
distinctPhysician.resultSet = resultSet;
distinctPhysician.physician = aPhysicianList.physician;
}
else
{
if (distinctPhysician.physician.equals(aPhysicianList.physician))
{
//do some logic
}
else
{
distinctPhysician.resultSet = resultSet+=1;
distinctPhysician.physician = aPhysicianList.physician;
}
}
aDistinctPhysicianList.add(distinctPhysician.resultSet, distinctPhysician);
}
return aDistinctPhysicianList;
} //distincePhysicianRecord
16 years ago
The xml might of been helpfull to follow my logic eaiser.

- <drug>
<filldate>03/2008</filldate>
<drugname>Coumadin</drugname>
<genericname>WARFARIN</genericname>
<medicationpriority>HIGH</medicationpriority>
<lastmedicationpriority></lastmedicationpriority>
</drug>
- <drug>
<filldate>04/2008</filldate>
<drugname>Coumadin</drugname>
<genericname>WARFARIN</genericname>
<medicationpriority>HIGH</medicationpriority>
<lastmedicationpriority>HIGH</lastmedicationpriority>
</drug>
- <drug>
<filldate>04/2008</filldate>
<drugname>Calan</drugname>
<genericname>VERAPMIL</genericname>
<medicationpriority>MEDIUM</medicationpriority>
<lastmedicationpriority>HIGH</lastmedicationpriority>
</drug>
- <drug>
<filldate>04/2008</filldate>
<drugname>Calan</drugname>
<genericname>VERAPMIL</genericname>
<medicationpriority>MEDIUM</medicationpriority>
<lastmedicationpriority>MEDIUM</lastmedicationpriority>
</drug>
16 years ago
I am working with j2re1.4.2_12 and xslt 1.0.

I am trying to create elements to be printed by the front end. I have a need to be aware of the previous medication priority in the druglist while working with the current list so the worksheet can be generated correctly.

Here is my java code:
(this code is not correct and is giving me an error of previousDrugList1 cannot be resolved on previousmedicationpriority.
The error is at this statement: previousmedicationpriority.appendChild(xmlDoc.createTextNode(previousDrugList1.medicationPriority)); )

I have looked for xslt functions that might be able to help but I did not find any. I then assumed that I needed to create a solution in the middle tier and pass it to the presentation tier.

void generateDrugElements(Element element, Document xmlDoc)
{
if(drugList != null)
{
for(int i=0;i<drugList.size();i++)
{
RxDbDrugRecord drugList1 = (RxDbDrugRecord) drugList.get(i);
if (i==0)
{
RxDbDrugRecord previousDrugList1 = (RxDbDrugRecord) drugList.get(i);
}
else
{
RxDbDrugRecord previousDrugList1 = (RxDbDrugRecord) drugList.get(i-1);
}

Element drug = xmlDoc.createElement("drug");
element.appendChild(drug);

Element filldate = xmlDoc.createElement("filldate");
filldate.appendChild(xmlDoc.createTextNode(drugList1.fillDate));
drug.appendChild(filldate);

Element drugname = xmlDoc.createElement("drugname");
drugname.appendChild(xmlDoc.createTextNode(drugList1.drugName));
drug.appendChild(drugname);

Element genericname = xmlDoc.createElement("genericname");
genericname.appendChild(xmlDoc.createTextNode(drugList1.genericName));
drug.appendChild(genericname);

Element medicationpriority = xmlDoc.createElement("medicationpriority");
medicationpriority.appendChild(xmlDoc.createTextNode(drugList1.medicationPriority));
drug.appendChild(medicationpriority);

if (i==0)
{
Element previousmedicationpriority = xmlDoc.createElement("lastmedicationpriority");
previousmedicationpriority.appendChild(xmlDoc.createTextNode(""));
drug.appendChild(previousmedicationpriority);
}
else
{
Element previousmedicationpriority = xmlDoc.createElement("lastmedicationpriority");
previousmedicationpriority.appendChild(xmlDoc.createTextNode(previousDrugList1.medicationPriority));
drug.appendChild(previousmedicationpriority);
}

Element druggroup = xmlDoc.createElement("druggroup");
druggroup.appendChild(xmlDoc.createTextNode(drugList1.drugGroup));
drug.appendChild(druggroup);
}
}
} //generateDrugElements
16 years ago