|
eroi wrote: but it is very time consuming.
What is time consuming?
led mike
|
|
|
|
|
Developing, programming, no problem with performance.
|
|
|
|
|
Hi, I need help please! Don'T really know XSLT
I have an HTML code that works:
I try and add it to an xslt file but it moans about the javascript.
Please Anyone Assist!
The existing xslt have an image ALT used as an tooltip, the problem is that the users have lengthy tooltips & the alt dissapears after a few seconds which they don't want.
I found a workaround for a tooltip which works great in HTML now I'm trying to add the code to the xslt but having the problems of the script. Tried CDate but the code turns gray untill the end of the script but other scripts in the xslt is black.
Your can copy this cope directly in HTML and it works, I'm trying to add this anyware in xslt to just to get it going then i will remove the alt & add onmouseover image like the <a>: I tried to highlight th errors i get (red) as i see in my xslt file but in HTML it works fine, with the CDATA its totally gray.
<html>
<head>
<style type="text/css">
#dhtmltooltip{
position: absolute;
width: 150px;
border: 2px solid black;
padding: 2px;
background-color: lightyellow;
visibility: hidden;
z-index: 100;
/*Remove below line to remove shadow. Below line should always appear last within this CSS*/
filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135);
}
</style>
</head>
<body>
<div id="dhtmltooltip"></div>
<SCRIPT TYPE='text/javascript'>
<!--<![CDATA[ -->
var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}
function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20
var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"
//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}
function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}
document.onmousemove=positiontip
<!--]]>-->
</SCRIPT>
<tr>
<td>
<a href="ajax.htm" onMouseover="ddrivetip('JavaScriptKit.com JavaScript tutorials','yellow', 300);" onMouseout="hideddrivetip();">?</a>
</td>
</tr>
</body>
</html>
|
|
|
|
|
hi.. if i have a project done in c# and i want to import that into my wpf project ..
i have 3 tabs.. when i open one of the tab.. the c# project display there .. is that possible???
|
|
|
|
|
Hi all,
I am developing an application in VB.Net, which uses XML file to feed configuration information. Application will need different configuration information during run time which needs to be fetched from XML file. Please let me know to achieve this task what will be the best approach:
Deserialization: Deserialize entire XML file into an object, and keep this object in memory during the entire life of application. Get the configuration information form this object property.
Using XPath query: as and when the configuration information is required by the application, it sends a query to XML file to fetch the required information.
Experts, please comment on this.
Thank you,
Regards, Krishnaraj
|
|
|
|
|
Support for using XML files for application settings is provided in the .NET BCL. You have not stated what type of application you have but this might help[^]
|
|
|
|
|
hi i used to use c# to display my uploaded picture
if (openFileDialog_select_picture.ShowDialog() == DialogResult.OK)<br />
{<br />
pictureBox_contact.Image = Image.FromFile(openFileDialog_select_picture.FileName);<br />
<br />
<br />
pictureBox_contact.SizeMode = PictureBoxSizeMode.CenterImage;<br />
pictureBox_contact.BorderStyle = BorderStyle.Fixed3D;<br />
<br />
}
but how do i do that in wpf.. ?
i cant do pictureBox.Image or .SizeMode....
|
|
|
|
|
You will probably have better luck asking this in the C# forum. Even though WPF uses an XML dialect (XAML) this really isn't an XML question per se.
WPF doesn't have a PictureBox control, instead you need to use the Image control and set the Source property. Take a look at this blog post[^] for more information.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
How to get the value of "hw" and "pos", xml file:
<?xml version="1.0" ?>
<Root>
<w c5="NN1" hw="factsheet" pos="SUBST">FACTSHEET </w>
<w c5="DTQ" hw="what" pos="PRON">WHAT </w>
<w c5="VBZ" hw="be" pos="VERB">IS </w>
<w c5="NN1" hw="aids" pos="SUBST">AIDS</w>
<w c5="NN1" hw="aids" pos="SUBST">AIDS </w>
<w c5="VVN-AJ0" hw="acquire" pos="VERB">Acquired </w>
</Root>
Here is a piece of code:
MSXML2::IXMLDOMDocumentPtr pDoc;
HRESULT hr;
hr = pDoc.CreateInstance(__uuidof(MSXML2::DOMDocument40));
if (FAILED(hr)) {
MessageBox("err");
return;
}
pDoc->load("d:\\a01.xml");
MSXML2::IXMLDOMNodeListPtr pNodeList;
MSXML2::IXMLDOMNode *DOMNode=NULL;
CString strContest;
try {
pNodeList=pDoc->getElementsByTagName("w");
int j=pNodeList->length;
for(int i=0;i<pNodeList->length;++i) {
pNodeList->get_item(i,&DOMNode);
strContest=(LPCSTR)DOMNode->Gettext();
MessageBox(strContest);
}
} catch(_com_error &err) {
CString strErr=(LPCTSTR)err.Description();
MessageBox(strErr);
}
|
|
|
|
|
You have to use the attributes property (i.e the get_attributes method) and then the getNamedItem on the returned NodeMap, check out the C++ sample of the getNamedItem documentation:
http://msdn2.microsoft.com/en-us/library/ms767592.aspx[^]
it does almost exactly what you need (it retrieves an attribute of the documentElement, but the same applies to a standard node).
Please note that you can also do a more intensive use of the smart pointers to make code more concise.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
|
A little more information would be good to get an answer to this, such as what progamming language? For .NET, you can use the XmlDocument class from the System.Xml namespace.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
XML parser
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
I have a newbie question...
I would like to save the format of a text, i thought writing another file to keep all this info but I thought i could do it with a xml file only, but i don't know how to use XML.
How could i do that every time i save a file i can save its format in the xml file?
thanks all
Luis E Tineo S
|
|
|
|
|
XML is a structured text format. Your text data needs to have some structure to it, preferably hierarchical, for you to consider storing it as XML. Otherwise you'd be better off just storing it in a text file.
kingletas wrote: but i don't know how to use XML.
There's plenty of resources on the web for learning XML. Alternatively, buy a book.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I need to create a generic XSLT to extract the third level elements of an XML file without having to specify the element names in the XPath.
The XML file looks like that
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
.
.
.
</catalog>
I need to put the Elements names like title, artist, etc. in a table as header and the element text Empire Burlesque, Bob Dylan in a table cell.
Can someone assist me with this please it seems I cannot get it right myself. Here's what I am trying but doesn't work
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<!-- The heading -->
<div>
Results
</div>
<br/>
<!-- Define the table itself -->
<table width="100%" border="1">
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="*">
<xsl:for-each select="*">
<xsl:sort select="*"/>
<tr>
<td><xsl:value-of select="*"/></td>
</tr>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Thanks
Tony
|
|
|
|
|
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<body>
<!-- The heading -->
<div>
Results
</div>
<br/>
<!-- Define the table itself -->
<table width="100%" border="1">
<tr>
<xsl:for-each select="/*/* [position()=1] /*">
<th>
<xsl:value-of select="name()"/>
</th>
</xsl:for-each>
</tr>
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="/*/*">
<tr>
<xsl:for-each select="*">
<td>
<xsl:value-of select="."/>
</td>
</xsl:for-each>
</tr>
</xsl:template>
</xsl:stylesheet>
|
|
|
|
|
Thanks for that it works. However when I am trying to add <xsl:sort select="*"/> after the <xsl:for-each select="*"> to sort by the first item doesn't work. Am I missing something?
Thanks
|
|
|
|
|
Hi all,
I need to create a generic XSLT to extract the third level elements of an XML file without having to specify the element names in the XPath.
The XML file looks like that
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
.
.
.
</catalog>
I need to put the Elements names like title, artist, etc. in a table as header and the element text Empire Burlesque, Bob Dylan in a .
Can someone assist me with this please it seems I cannot get it right myself. Here's what I am trying but doesn't work
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<!-- The heading -->
<div>
Results
</div>
<br/>
<!-- Define the table itself -->
<table width="100%" border="1">
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="*">
<xsl:for-each select="*">
<xsl:sort select="*"/>
<tr>
<td><xsl:value-of select="*"/></td>
</tr>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Thanks
Tony
|
|
|
|
|
|
The C version: http://downloads.sourceforge.net/vtd-xml/c_tutorial_by_code_examples.zip?use_mirror=easynews
The C# version: http://downloads.sourceforge.net/vtd-xml/CSharp_tutorial_by_code_examples.zip?use_mirror=superb-east
The Java version: http://downloads.sourceforge.net/vtd-xml/Java_tutorial_by_code_examples.zip?use_mirror=superb-east
Schemaless Java-XML databinding with VTD-XML
http://www.onjava.com/pub/a/onjava/2007/09/07/schema-less-java-xml-data-binding-with-vtd-xml.html?page=last&x-showcontent=text&x-maxdepth=0
Index XML documents with VTD-XML
http://webservices.sys-con.com/read/453082.htm
Improve XPath Efficiency with VTD-XML
http://www.devx.com/xml/Article/34045
|
|
|
|
|
Hi all,
My question is very simple;
I have two arrays :
double[] arr1 = new double[] {1,2,3};
double[] arr2 = new double[] {10,20,30};
I want to store to and than read these arrays back from an XML file.
Could someone please send a small piece of code written in C#.
Thanks.
Cengiz EKEN.
|
|
|
|
|
ceken wrote: I want to store to and than read these arrays back from an XML file.
Could someone please send a small piece of code written in C#.
That's not how things work here. We don't do your work for you.
Anyway, you need to be more specific about what you want to do. How should your XML be structured?
I suggest that you do some more research, attempt to solve the problem yourself and post again if you encounter any further difficulties.
I've just noticed that you posted the same message[^] 2 days ago and were given some help. Why have you posted it again? Why have you failed to act upon the advice you had previously received?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
Regarding the help posted 2 days ago, The solution offered in that transaction was not the way that i need, because I used that method before.
As for your questions;
<br />
<code><br />
<duttest><br />
<test1><br />
<arr1>500,525,550,575,600,17425,18000,</arr1><br />
<arr2>4.08,6.96,8.91,7.79,7.72,2.34,4.56</arr2><br />
</test1><br />
</duttest>
My xml document is given above. I write my arrays comma delimited to xml file but when the array size is large,say 1000000, it becomes cumbersome to write and read back. Because I have to use text processing. So, to overcome such text processing;
Is there a way to store to and than read these arrays back from an XML file.
Regards
Cengiz EKEN
|
|
|
|
|
Hi,
Regarding the help posted 2 days ago, The solution offered in that transaction was not the way that i need, because I used that method before.
As for your questions;
<duttest>
<test1>
<arr1>500,525,550,575,17875,17900,17925,17950,17975,18000,</arr1>
<arr2>25.998,28.776,22.487,21.561,21.537,</arr2>
</test1>
</duttest>
My xml document is given above. I write my arrays comma delimited to xml file but when the array size is large,say 1000000, it becomes cumbersome to write and read back. Because I have to use text processing. So, to overcome such text processing;
Is there a way to store to and than read these arrays back from an XML file.
Regards
Cengiz EKEN
|
|
|
|