|
Dear All,
Here is a xsl to transform the xml by grouped by "cost_type" and displays
group summary "avg hourly cost" for each cost_type, by matching to
respective <gpr_aggr> node of XML file. For purpose of matching to a specific <grp_aggr> node, I used <xsl:variable>.
Can somebody help me out with this transform and tell me why the 2nd
<xsl:value-of> meant to display value of <grp_aggr> node matching with
respective cost_type, is not matching with any node.
Any timely solution is appericiated.
Desired Output
-------
Cost-type Hourly-Cost CTC
Billable
200 378000
150 0
50 0
Avg HCost: 133
Avg HCost: 133 (----> showing blank in actual output)
Actual
100 189000
Avg HCost: 133
Avg HCost:129 (----> showing blank in actual output)
XML
------
<root>
<recordset>
<record>
<hourly_cost>200
<ctc>378000
<cost_type>Billable
<record>
<hourly_cost>150
<ctc>0
<cost_type>Billable
<record>
<hourly_cost>50
<ctc>0
<cost_type>Billable
<record>
<hourly_cost>100
<ctc>189000
<cost_type>Actual
<group id="1" colname="cost_type" colvalue="Billable">
<grp_aggr id="1">133
<grp_aggr id="2">1000
<grp_aggr id="3">61944.5454
<group id="2" colname="cost_type" colvalue="Actual">
<grp_aggr id="1">129
<grp_aggr id="2">589
<grp_aggr id="3">111474.2857
XSLT
-------
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html">
<xsl:key name="key_1" match="record" use="cost_type">
<xsl:template match="text()">
<xsl:template match="//recordset">
<xsl:for-each select="./record[count(.|key('key_1',cost_type)[1]) =
1]">
<xsl:for-each select="key('key_1', cost_type )">
<xsl:variable name="variable_1" select="cost_type">
Cost type | Hourly Cost | CTC | <xsl:value-of select="cost_type"> | | <xsl:value-of select="Hourly_Cost"> | <xsl:value-of select="CTC"> | | |
Avg HCost: <xsl:value-of
select=" group[@colvalue="Billable" ]="" grp_aggr[@id="1" ]"="">
| | |
Avg HCost:<xsl:value-of
select=" group[@colvalue="$variable_1]/grp_aggr[@id='1']"/">
|
|
|
|
|
|
I have encountered a problem with a session variable I have been trying to use.
I create the variable in the global.asa file along with other variables.
var ID = 0;
I have a one page that does validation for my site with the following type of code
<br />
if( page1 )<br />
insert record...<br />
Session("ID") = RecordSet("id");<br />
Redirect("page2.asp");<br />
else if( page2 )<br />
var temp = Session("ID");<br />
<br />
Anyone have any insite into this? I use other session variables and they through this and other variables and there doesn't seem to be a problem.
|
|
|
|
|
Hmmmm... please be more specific about how you are SETTING your Session("ID") in your global.asa file. From the nfo you gave, it seems for the if(page1) you are setting your Session("ID") there, and for (page2) no Session("ID) exists because you seem to be setting it in the if(page1) part. Like I said, I can not really help until you post the section of your global.asa file where you are creating your Session("ID").
---][--SqrL--][---
|
|
|
|
|
Global.asa
var ID = 0;
function Session_OnStart()
{
Session("ID") = 9;
}
On page 1 I can do the following
Response.Write(Session("ID")); // Outputs 9
Session("ID") = 10;
Response.Redirect("page2.asp");
On page2 I get this
Response.Write(Session("ID")); // Outputs 9 not 10
|
|
|
|
|
How do you do a linebreak with the vbscript in asp?
|
|
|
|
|
Response.Write vbCrLf
Cheers,
-Erik
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My thoughts are my own and reflect on no other.
|
|
|
|
|
Does it enyone know how can I call printPreview in IE 5.5+?
|
|
|
|
|
IOleCommandTarget::Exec with OLECMDID_PRINTPREVIEW
or
IWebBrowser2::ExecWB with IDM_PRINTPREVIEW which calls the above anyway.
|
|
|
|
|
Hi ,
I have a dll , which displays a dialog box. and I need to
invoke this dialog through a HTML page. There would be a
string send from the HTML to the dialog , and after processing, from the Dialog back to the HTML page.
Can someone please tell how can I achieve this.
Thanks
Sanksy
sp
|
|
|
|
|
If this is an ActiveX/COM dll then it is not a problem. After the dll has been properly installed or download to the client machine you just have your page instantiate the object. Such as <object> tag or from scripting CreateObject or CreateActivexObject.
Is there something special about your dialog? You could use a popup or hta from the browser with needing to have a dll downloaded/installed.
|
|
|
|
|
Thanks for the help.
If the DLL happens to be a Normal DLL, so in such case how
do I handle it?
Thanks -n- Regards,
sanjay
|
|
|
|
|
I saw siteserver using two cookies. One is SITESERVER=ID=someguid and the other one is SITESERVER=GUID=someguid.
I know the second one is the guid attribute of the user. What is the first one for? I got to compute the ID myself, and do anyone of you know how to compute this ID?
Any help will be highly appricicated.
Regards,
Ravi
|
|
|
|
|
|
I am using the fileSystemObject in ASP to list the contents in a directory. Is there any EASY way to sort the files alphabetically?
thanks,
Todd
|
|
|
|
|
You could read the filenames into an array and sort the array.
|
|
|
|
|
I have a problem with a combo box on an HTML page.
The items in the combo box are larger than the control and the users can't read the
entire strings.
I'd like to be able to design the drop-down part of the combo larger
than the fixed part. How should i do?
Thanks!
|
|
|
|
|
Here's an example:
<select style=width:200;>
<option>Drums</option>
<option>Guitar</option>
<option>Computers</option>
<option>Basketball</option>
<option>Dancing</option>
</select>
Later,
Caleb
|
|
|
|
|
Has anyone run across any good SVG tutorials, introductions or other information on how to start working with it, either on the web or in books? Any reference suggestions would be greatly appreciated.
Laura
http://groups.yahoo.com/group/CppDesign
|
|
|
|
|
Maybe this info will be of help. It is from the Seattle XML SIG website. Kurt's website has SVG examples and help.
Kurt Cagle is the author of the XML Developers Handbook and coauthor of the new Professional XSL book by Wrox. He is currently writing a book on SVG programming for APress. Mr. Cagle is the president of Cagle Communications, an XML and Web Consulting Company in Olympia, Washington, with a website at http://www.kurtcagle.net , and is a member of both OASIS and the Washington Software Alliance.
Cheers,
-Erik
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My thoughts are my own and reflect on no other.
|
|
|
|
|
I am having a problem with my menu at http://www.cwd.htmlplanet.com. I am having a compatibily error with my CSS, which most of my menu is done with. In IE my page looks how I want it to look, it looks something like this:
___________________
|Header (background |
| is blue) |
|___________________|
|Content ( bgwhite) | <----- Border is Blue
| |
| |
| |
|___________________|
Althought in Netscape it has the header (background blue) with a white border and then the blue border. It looks something like this:
____________________
| ________________ <|------White border around header
| |Header (bg blue)| |
| |________________| |
| |
|Content ( bgwhite) | <----- Border is Blue
| |
| |
| |
|____________________|
Remember you can see what it looks like here http://www.cwd.htmlplanet.com
I would really like some help! If not I think I will just make a Netscape page and an IE page.
If you have any ideas that would help me I would like to know!
Thank you
Michael Zimmer
mzimmer88@hotmail.com
|
|
|
|
|
MSIE's CSS implementation is full of bugs, most likely Netscape 6 or Mozilla shows your pages like they should be according to CSS standards. Anyway, first you should validate your HTML and CSS code and fix any syntax errors. Use W3C's HTML validator and CSS validator
|
|
|
|
|
Can anybody find an error in this statement?
SELECT Username,Subject,TimeDate,Posts,WhoLast,WhenLast FROM MessageList WHERE Forum = 'general'
It used to read in all entries but now it seems to not read in any entries at all. Thanks in advance.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Hi, i always wondered and still wonder how the DHTML feature in the Code Project Forums work.
Someone gave me the following code but i don't think that's what i wanted.
function Toggle(node) {
var elmref;
if (Selected != "") {
elmref = eval("document.all('" + Selected + "_h1')");
if (elmref) elmref.style.display = 'none';
elmref = eval("document.all('" + Selected + "_h0')");
if (elmref) elmref.bgColor = '#FEF9E7';
}
Selected = this.name;
elmref = eval("document.all('" + this.name + "_h1')");
if (elmref) {
if (elmref.style.display=='none') elmref.style.display='';
else elmref.style.display = 'none';
}
elmref = eval("document.all('" + this.name + "_h0')");
if (elmref) {
elmref.bgColor = '#99CCFF';
}
window.navigate("#xx" + Selected + "xx");
return false;
}
If this is the code, can someone explain this to me ?
If this is not the code, then can anyone show me a example on how do this.
Thank You !
|
|
|
|
|
How to full screen the window of the internet explorer when click a button in the web page.
Thanks
|
|
|
|
|