.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Convert XML to Xslt problem

Posted By:      Posted Date: October 20, 2010    Points: 0   Category :ASP.Net

That is my sample xml.


<gender code="F"/>



It is ok to get age with 

    <xsl:attribute name="Age">

        <xsl:value-of select="age"/>


how can i get the

View Complete Post

More Related Resource Links

Line Break Problem in XSLT


Hi All,

I want to add line break in the xslt but it not working.

Below is the code for adding the line break.

</P> <P>
&lt;xsl:variable name="Collection7"&gt;</P> <P>&nbsp; &lt;xsl:value-of select="$13932"/&gt;&lt;xsl:text&gt;&amp;#xa;&lt;/xsl:text&gt;</P> <P>&nbsp; &lt;xsl:value-of select="$31042"/&gt;&lt;xsl:text&gt;&amp;#xa;&lt;/xsl:text&gt;</P> <P>&lt;/xsl:variable&gt;</P> <P>&lt;td&gt;&lt;xsl:value-of select="$Collection7"/&gt;&lt;/td&gt; </P> <P>&lt;/code]</P> <P>I have tried the below code as well:</P> <P>&lt;xsl:variable name="newline"&gt;
&lt;/xsl:variable&gt;</P> <P>or</P> <P>&lt;xsl:variable name="break"&gt;&amp;lt;br&amp;gt;&lt;/xsl:variable&gt;</P> <P>or </P> <P>addign &lt;br/&gt;</P> <P>then also it not adding the line break.</P> <P>But If I write code like below then it is adding the line break and it works fine.</P> <P>

Crystal Report vs 2003 convert to vs 2008 parameter problem


Hi friend,

I have a project develop with Visual Studio 2003, when i convert the project to Visual Studio 2005 is work well. But when i convert to Visual Studio 2008, the crystal report when have pass parameter will prompt the parameter field to re-type then show the report.

But in this converted project i create a new report and pass the parameter is ok. That means i wan re-do all report @.@??

Does someone can help me solve this problem??

Thank you

convert to XSLT Dataview option not offered

I'm working in Designer on Dispform.aspx trying to convert the original LVWP to a DVWP but the option to "Convert to XSLT Dataview" when I right-mouse click is not visible. Any other attempts to add a DVWP to the page have failed with "Unable to display this web Part." What steps am I missing. Thanks Marcus

Cannot convert from 'int' to 'System.Data.OracleClient.OracleParameter' - Problem with OracleHel

Hi I downloaded the OracleHelper.cs & I use VisualStudio 2008,I'm suppose to pass values to a stored procedure which accepts 2 parametersWhen i pass from codebehind it says,Cannot convert from 'int' to 'System.Data.OracleClient.OracleParameter'Cannot convert from 'string' to 'System.Data.OracleClient.OracleParameter'The best overloaded method match for 'DataWrapper.ExecuteNonQuery(string, System.Data.CommandType, string, params System.Data.OracleClient.OracleParameter[])' has some invalid argumentsI'm posting mycode,Using STORED PROCEDURE,OracleHelper.ExecuteNonQuery (con, CommandType.StoredProcedure, "sample", Int32.Parse(TextBox1.Text),TextBox2.Text); Plz help !______________________________________If possible,  tell me a solution for this error too !http://forums.asp.net/t/1598804.aspx

problem to convert special character in export to csv

I am using FIleStream object to write .csv file from dataTable/Dataset.It is working fine. But when i got special character in my DataTable like $, @, # ect. it will convert these convert in encoded form( which can't be readable i.e.  â,¬ etc). FileStream flStream;astrFileName = HttpContext.Current.Server.MapPath("~/files/FtpFiles/Download/") + astrFileName + ".csv";if (File.Exists(astrFileName)){flStream = new FileStream(astrFileName, FileMode.Truncate, FileAccess.Write);}else{flStream = new FileStream(astrFileName, FileMode.Create, FileAccess.Write);}StreamWriter objSw = new StreamWriter(flStream);DataTable objDt = idtInstance;//Get No Of Column in GridView int NoOfColumn = objDt.Columns.Count;//Create Header for (int i = 0; i < NoOfColumn; i++){objSw.Write(objDt.Columns[i]);//check not last column if (i < NoOfColumn - 1){objSw.Write("||");}}objSw.Write(objSw.NewLine);//Create Data foreach (DataRow dr in objDt.Rows){//if (dr["GCMSCaseNumber"].ToString() == "14222")//{// string desc = dr["Updates"].ToString();//}for (int i = 0; i < NoOfColumn; i++){string sData = dr[i].ToString();sData = sData.Replace("<br>", " ");sData = sData.Replace("<br/>", " ");sData = sData.Replace("\n", " ");sData = sData.Replace("\t", "

Problem setting variable/param in XSLT for XML control in .NET 4.0

I am using an XML control in VS2010 with .NET 4.0.I am trying to sort XML data into a table. I have a drop list with the sort key, and a button that is supposed to display the table with a new sort.Here is the code the button calls:</p><p></p><p style="text-align: left;" mce_style="text-align: left;"><font class="Apple-style-span" face="Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace"><span class="Apple-style-span" style="border-collapse: collapse; line-height: 13px;" mce_style="border-collapse: collapse; line-height: 13px;" mce_fixed="1"></span></font></p><p><font class="Apple-style-span" face="Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace"></font></p><p><font class="Apple-style-span" face="Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace"><div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste">private void PopulateXML( Xml MyXML)</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: h

Data Type Convert problem?

1/2 is inputed by user, I hope to get the result 0.5, but both Method1 and Method2 get the result 0 How can I do? Thanks! BTW, I can't require user to input 1.0/2.0      Method1:     double my = 1/2;Method2:     double my = Convert.ToDouble(1/2);  

SQL convert problem / question


Hi all

Can somebody explain the following behavior:
The first and second query are quite clear but I
do not understand why the third query does not work ??

Thanks a lot for your comments !

Best regards
Frank Uray

-- Working
FROM [dbo].[GeoDataTest]

Interesting Problem WPF Visual to Image Convert.


I am converting the Canvas to Image By using

renderBitmap = new RenderTargetBitmap(desiredWidth, desiredHeight, 96d, 96d, PixelFormats.Pbgra32);// PixelFormats.Pbgra32);
                    //RenderOptions.SetEdgeMode(drawingVisual, EdgeMode.Aliased);
                    RenderOptions.SetBitmapScalingMode(drawingVisual, BitmapScalingMode.HighQuality );
                    drawingVisual.SnapsToDevicePixels = true;
                    var dv = new DrawingVisual();
                    using (DrawingContext ctx = dv.RenderOpen())

                        var vb = new VisualBrush(drawingVisual);

Problem with xmlns when I convert object to XML and XML to object back


Hi, I am facing a strange problem.

I have a class object which I am accessing through webservice call.

Now actually that class has a property with type of Array inside that class and that array is the array of same class object. Means in reality, I have detailed tree structure as per how data gets fill up in that class object.

This is how my XML is and my actual code.

string xml_For_Obj = "";

                xml_For_Obj = "<xml version=\"1.0\" encoding=\"utf-16\">  ";
                xml_For_Obj += "    <ComponentObject xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">";
                xml_For_Obj += "        <BundledComponents xmlns=\"http://MySite.com/ISI/OtherWebService/Components\">";
                xml_For_Obj += "            <ComponentObject>";
                xml_For_Obj += "                <SKU>Test Sku Name</SKU> ";
                xml_For_Obj += "                <SubGroup>Test SubGroup</SubGroup> ";
                xml_For_Obj += "                <Quantity>70</Quantity> ";
                xml_For_Obj += "                    <BundledComponents >";

decimal place problem in convert string to double


Hi guys, i have a strange error creaping into my web app but am unsure as to how to fix it.  When i run this code on my debug workstation it works fine but when i transfer it to my server things seam to go wrong.

dev station (windows 7) + VS2010
regional and language settings all set to uk
server (windows 2008r2)
regional and language settings all set to uk

What seams to be happening is that when converting a string to a double it works correctly on the dev environment but moves the decimal place to the end on the server.

example code(vb)

dim lat as string = "52.983829"
dim long as string = "-0.036500"

dim latint as double = lat
dim longint as double = long

now on the dev server the value of latint is 52.983829 as you might expect but on when published to the server it becomes 52983829.0

the same with longint on the dev staion it is -0.036500 but on the server it becomes -36500.0

i get equally confusing problems if i try to change it to an integer instead.


can anyone help point be in the right direction?

how to convert simple html to asp.net control( server side useing C#,Jquery,xml,xslt)


input form 
<FORM METHOD=POST ACTION="mailto:someone@$nailmail.com" ENCTYPE="text/plain"> <table border=0 cellspacing=0 cellpadding=2> <tr> <td colspan=2> <font size=2 face="arial" color="#000000"> <INPUT type="text" name=URL size=17 value="http://"> :Your URL<BR> <INPUT type="text" name=user size=17> :Your Username<BR> <INPUT type="text" name=email size=17> :Your E-mail </font> </td> </tr> <tr> <td> <font size=1 face="arial" color="#000000"> <INPUT name=subscribe type=radio value="yes" CHECKED> subscribe<BR> <INPUT name=subscribe type=radio value="no"> unsubscribe<BR> </font> </td> <td> <SELECT name="choices" size=1> <OPTION selected> OPTIONS <OPTION> OPTION 1 <OPTION> OPTION 2 <OPTION> OPTION 3 <OPTION> OPTION 4 <OPTION> OPTION 5 </SELECT> </td> </tr> <tr> <td colspan=2> <font size=1 face="arial" color="#000000"> <INPUT type=checkbox name="html" value="sendme" CHECKED> i can recive email as html<BR> <INPUT type=checkbox name="receipt"

picture library convert dataview webpart problem?



I have picture library,I need to customize the same,for that i need to convert picture library to dataview webpart.

There is no option to convert the picture library listview webpart directly to dataview.

what i did i have added the my picture library in webpart zone then after i was trying to convert to dataview webpart.but it giving error like below:

this web part does not have valid XSLT stylesheet;

Error:A name was started with an invalid character, /_layouts/images/

please help me on same

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend