|
Hi All
Export to excel data from ultrawebgrid rows, Each data row contain one worksheet in excel sheet like as
row1 data contain sheet1
row2 data contain sheet2
row3 data contain sheet3
this opertaion getting at a time on pressing one button.
we have pressing one button ultrawebgrid rows data to export excel sheet, In excel sheet each worksheet contain one grid row deatails, for example grid have 10 rows ,pressing any button, In excel sheet 10 worksheets will occure and each worksheet contain 1 row data of grid pls send me a solution for this example
|
|
|
|
|
I am looking to edit an XSLT that has 2 nested for-each calls in order to group items based on the value of a subnode of each item.
The innnermost for-next processes each item for html display. I'm using choos-when-otherwise combo to check the position() for the current group. If the position = 1 it is displayed differently than the other items.
What I'd like to do is put the first item contents into an HTML table row and then put ALL of the remaining items for the current group into the next table row.
My problem is I can't put <tr> or <td> tags into the xsl:otherwise node because they are inserted for every item, and I can't seem to put the html tags outside the xsl:otherwise section or use conditions (position=2) because then the html tags don't match up and the xslt document won't validate.
I'm new to XSL and must be missing something... ideas anyone?
==================================================
<xsl:key name="items-by-category" match="item" use="category" />
<xsl:template match="rss/channel">
<xsl:for-each select="item[count(. | key('items-by-category', category)[1]) = 1]">
<xsl:for-each select="key('items-by-category', category)">
<xsl:choose>
<xsl:when test="position() = 1">
<tr><td>item output format style 1</td></tr>
</xsl:when>
<xsl:otherwise>
item output format style 2 - includes all remaining items in the group
but I want to put all of these into a single TD as above, not each one in a separate TD?
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
======================================================
Lefty
|
|
|
|
|
hi, you probably have to use <xsl:value-of select="<td>" > etc., you can't have malformed HTML literaly in XSLT.
ps. I write this from head so sintax is probably wrong, but I hope you get the idea.
David
|
|
|
|
|
Hi
I want to delete node from xml file
this is example of xml file
<audit_list>
<control_type>xxx
<control_group group="xxx1">
<control_sub_group sub_group="yyy1">
<activity>
<control_activity>zzzz</control_activity>
<comment>large</comment>
</activity>
</control_sub_group>
<control_sub_group sub_group="xxx2">
<activity>
<control_activity>ccccc</control_activity>
<comment>medium</comment>
</activity>
<activity>
<control_activity>bbbb</control_activity>
<comment>large</comment>
</activity>
</control_sub_group>
<control_group group = "xxx2">
<control_sub_grop sub_group = "">
.....
this is my command to delete node but I get some error that I can't solv
please help me?
I want to delete node <activity> which have text of <control_activity> = ........ (get from user)
Dim listname As String
If rdo_type1.Checked Then
listname = "audit_list.xml"
ElseIf rdo_type2.Checked Then
listname = "audit_list_application.xml"
End If
'==============
Dim objdomdocument, objxmldomnode, objelement, strxpath, objCurrNode
objdomdocument = CreateObject("Microsoft.XMLDOM")
objdomdocument.async = False
objdomdocument.load(Server.MapPath(listname))
'==========
objCurrNode = objdomdocument.documentelement.firstchild
'==========
strxpath = "audit_list/control_type/control_group[@group = '" + lst_group.SelectedItem.Text.ToString() + "']/control_sub_group[@sub_group = '" + lst_subgroup.SelectedItem.Text.ToString() + "']/control_activity/activity"
objelement = objdomdocument.selectSingleNode(strxpath)
Dim i As Integer
Dim t_attribute As String
Dim x_text As String
Dim j As Integer
Dim x_nodelist
Dim a As Integer
For i = 1 To 50
t_attribute = objCurrNode.childnodes(i).getattribute("group")
If t_attribute = lst_group.SelectedItem.Text.ToString() Then
objCurrNode = objCurrNode.childnodes(i)
For j = 1 To 50
x_nodelist = objCurrNode.childnodes(j).getelementsbytagname("control_activity")
For a = 0 To x_nodelist.length
x_text = x_nodelist.item(a).firstchild.nodevalue
If x_text = lst_activity.SelectedItem.Text.ToString() Then
objCurrNode.childnodes(j).childnodes.item(a).removechild(objelement)
Exit For
End If
Next
Next
End If
Next
objdomdocument.save(Server.MapPath(listname))
thank you.
|
|
|
|
|
If you find a node you want to remove, then you need to do theNode.ParentNode.RemoveChild(theNode). Something like that, the syntax is not exactly right.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
plase suggest me more, I don't understand
I can remove node <control_sub_group> by using command below
Dim listname As String
If rdo_type1.Checked Then
listname = "audit_list.xml"
ElseIf rdo_type2.Checked Then
listname = "audit_list_application.xml"
End If
'==============
Dim objdomdocument, objxmldomnode, objelement, strxpath, objCurrNode
objdomdocument = CreateObject("Microsoft.XMLDOM")
objdomdocument.async = False
objdomdocument.load(Server.MapPath(listname))
objCurrNode = objdomdocument.documentelement.firstchild
strxpath = "audit_list/control_type/control_group[@group = '" + lst_group.SelectedItem.Text.ToString() + "']/control_sub_group[@sub_group = '" + lst_subgroup.SelectedItem.Text.ToString() + "']"
objelement = objdomdocument.selectSingleNode(strxpath)
Dim i As Integer
Dim t_attribute As String
For i = 1 To 50
t_attribute = objCurrNode.childnodes(i).getattribute("group")
If t_attribute = lst_group.SelectedItem.Text.ToString() Then
objCurrNode.childnodes(i).removechild(objelement)
Exit For
End If
Next
objdomdocument.save(Server.MapPath(listname))
I think command strxpath = ....... it can get me a node <control_sub_group>
but now I want to delete node <activity> that use <control_activity> to be condition
I'm not sure if I want to delete node <activity> I can use strxpath or not/
or I should use another command?
please revise my syntax or suggest me more
thank you
|
|
|
|
|
Ah.. maybe you need to remove the inner child nodes before you can remove a node that has children of it's own ?
I was saying that if you use an XPath to find the actual node you want to remove, you can remove a node using itself as the point of reference, because there is a ParentNode property you can use to get the node one higher than the one you're at. That way, you don't have to search for nodes based on the node you want to remove being a child, but just search for the node you want.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
command ---
strxpath = "audit_list/control_type/control_group[@group = '" + lst_group.SelectedItem.Text.ToString() + "']/control_sub_group[@sub_group = '" + lst_subgroup.SelectedItem.Text.ToString() + "']"
objelement = objdomdocument.selectSingleNode(strxpath)
command above I can use parentchild.removechild(objelement) but
command ---
strxpath = "audit_list/control_type/control_group[@group = '" + lst_group.SelectedItem.Text.ToString() + "']/control_sub_group[@sub_group = '" + lst_subgroup.SelectedItem.Text.ToString() + "']/activity/control_activity"
this command not specific activity that I want to delete the activity node that i want to delete it depend on control_activity.value
this command how can i specific node activity that have node <control_activity> xxxx </control_activity>
I'm not sure do you understand my problem,I'm sorry if I make you confuse
Thank you.
|
|
|
|
|
I admit that I am unlikely to read carefully the huge amount of code you posted. If you're wanting to remove based on the parent node, then you don't need what I suggested.
Perhaps if you explained what error you are getting, it would be easier to help you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
error message is
" Object variable or with block variable not set "
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vamsgobjnotset.asp[^]
On to your code:
For j = 1 To 50
Why 50 ? Are VB arrays 1 based ? ( Nothing would surprise me ). This will give you an error if you have less than 50 elements, and not search them all if you have more
x_nodelist = objCurrNode.childnodes(j).getelementsbytagname("control_activity")
For a = 0 To x_nodelist.length
x_text = x_nodelist.item(a).firstchild.nodevalue
If you look at your schema, control_activity does not have any child nodes, which is why this blows up, with the error you describe.
If x_text = lst_activity.SelectedItem.Text.ToString() Then
objCurrNode.childnodes(j).childnodes.item(a).removechild(objelement)
and therefore, it won't even get this far.
Exit For
End If
Next
Next
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you very much for your kindness, but I still can't solve my problem
|
|
|
|
|
Hi - I was just looking at your x-path - -
audit_list/control_type/control_group[@group = '" + lst_group.SelectedItem.Text.ToString() + "']/control_sub_group[@sub_group = '" + lst_subgroup.SelectedItem.Text.ToString() + "']/control_activity/activity
1) I notice that: you have "activity" as child of "control-activity" while your xml is the other way around: "control-activity" is the child of "activity".
2) if this is corrected - then to remove the activity node:
Something like this:
//first get all the nodes that have control-activity = to user input
dim contActNodes, contActNode, actNode
contActNodes=objdomdocument.selectNodes("//control-activity[.='user-input']")
for each contActNode in contActNodes
//parent node of control-activity is activity
actNode = contActNode.ParentNode
//to remove activity, you need to get to the parent of activity
actNode.PerentNode.RemoveChild(actNode)
next
|
|
|
|
|
I have a XML file eg
<Root>
<Data>SomeData</Data>
<Data>More ...<Data>
</Root>
I now need to add another Data Item , I'm using XmlTextWriter.
How can I open the file without parsing the XML and add another Data item ?
and avoid having multiple root items.
Im using Windows CE so XMLDoc is too expensive, and I would like to avoid seeking through the stream to find </Root>
Thanks
.n<strike>u</strike>etter
|
|
|
|
|
|
Thanks, thought of using a seperate file, thats what I will do, but its ugly.
.nuetter
|
|
|
|
|
Is there a SAX implimentation on CE ? SAX is a model for passing through large documetns without loading them into memory.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
Is there a SAX implimentation on CE ?
Quick look at MSDN shows that there is SAX on CE.
Christian Graus wrote:
SAX is a model for passing through large documetns without loading them into memory.
So does XmlReader /XmlWriter .
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
dnh wrote:
So does XmlReader/XmlWriter.
Does it ? That's the best solution then, I would have thought.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I am a bit confused. I believe XmlReader is very fast if you want to "pull" elements/nodes etc out of the file and do something with it as this is forward-read-only stream. But according to the original question, how do you "add" a node in such a scenario?
Never mind - I looked at the article: Efficient Techniques for Modifying Large XML Files.
One other way to go would be using XPathDocument - There is a nice sample here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxml/html/sysxmlVS05.asp
|
|
|
|
|
hi,
i am having word data of whis is list style type having bullet, numbering and symbol formatting in different hierarchy.how could i capture that from word ml.
in wordml every data information is treated and present in <w:p>
wht is the soln to this.
RAM waiting for reply.
|
|
|
|
|
I have a chatting software in ASP and XML but my system is not configured to run it because The code is using DOM component object programming and i have to install this component to run it.I want to know from where i can install this component.
waiting...
EsHbAn BaHaDuR
|
|
|
|
|
It comes with the latest version of IE.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Well I have IE 6 version which is i think latest version of IE upto now.But it doesnot works.If u think that u have latest version of IE then i would send it to u to check that is it working properly.
waiting for ur courtesy.
EsHbAn BaHaDuR
|
|
|
|
|
u actaully need to download MSXML v4.0 SP2 from the Microsoft website or just google around for MSXML v4.0 SP2 and ur done with it.
Your dom application should work fine.
Regards
Wilbur J. Pereira
http://groups-beta.google.com/group/DotNetStarters
"If they love me let them, for the heck of it.If they don't, who da heck cares about it"
|
|
|
|