|
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
|
|
|
|
|
When I use the VS2005 xsd gui (which I love) to build a schema what's the simplest way to generate a valid, unpopulated xml file? Do I have to write some C# code or is there a menu-driven tool that I'm missing.
Thanks.
|
|
|
|
|
Hello All,
I am transfroming xml file into word documnet from the xslt that i have generated . I am creating tables on the word document with some data, the problem is i have to create tables adajacent to each other, but xsl is creating table one below the other .. Any hint what setting i would have missed ??
Thanks and Regards
Ron
|
|
|
|
|
Ron.S wrote: I am transfroming xml file into word documnet from the xslt that i have generated
So your xslt is generating wordml? If yes then....
Ron.S wrote: but xsl is creating table one below the other .. Any hint what setting i would have missed ??
means you are not correctly generating wordml to it's specification. You need to find out the correct wordml you need and then change your xslt to generate it, yes?
|
|
|
|
|
i made the p2p application by using web service and vb.net code.
but i am not get a idea of making the cient of any p2p network.,pleae help me...........
|
|
|
|
|
I am working on a project that involves a great number of SQL queries in XSL documents. one in particular returns * in the query. Here is my dilema. I know for a fact one of the columns is an image pathway, and i need to access it, however, i do not know that the column name is, AND i do not have access to the DB.
What I need, if possible, is somethis that might allow me to expose the column names returned by the "select *" statement. Is this possible? Or am I stuck waiting for emails that may or may not answer what i need from the guy who contracted me?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
You can query the database metadata to get this information. However, if you don't have access to the database then I'm afraid you're stuck.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|