|
Hi and Thanks!
Thanks Frank! The code works perfectly! Problem Solved!
Thanks Again!
MrWolfy
|
|
|
|
|
You're welcome. In case you can read German or French, this is where I learnt it all:
http://selfhtml.org/
I hardly ever use websites in my native language when it comes to software development cause anglophone sites are abundant and (when they have a forum) well populated, but this one is so good I took it on as my default HTML and XSL reference.
|
|
|
|
|
wow, I did not understand that was what he was asking at all. Nice catch!
led mike
|
|
|
|
|
Hi,
I want to create an XML Editor Tool in C#.NET (similar to what we currently have in Visual Studio).
I want this editor tool to be integrated in my project.
The intention in creating the tool is that I want to view and edit the XML in this tool itself. I should
be able to directly modify the XML in this XML editor and thereby persist it back. And the changes should be
reflected accordingly.
It should have a collapse-Expand feature. And if possible it should also support Syntax based colours.
Hence, the tool should be able to open any XML in the proper format(proper parsing check should be there)
and edit them and save it back.
I currently work in VS 2008 in C#.
It will be really helpful if someone put the code in implementing the same and thanks in advance for any kind of suggestions.
Thanks,
Deb
|
|
|
|
|
Hi debobrata
You could use an open source text editor component called FireBall. It has features like syntax highlighting for different languages XML being one of them and it also supports collapse-expand feature. You can open any XML with file with it. As for the validation, I'm afraid you gonna have to implement that your self but the rest should be easy enough.
Regards
tptshepo
|
|
|
|
|
Hi,
Can you please provide me the link for the "FireBall" text editor component so that i can download the source code for the same. And whether the source code is available for download or not.
I was trying googling for the same, but was not able to download the source code.
Please help me in that. Atleast i need to check the editor with the source code and then i can revert you back whether it has been helpful for me or not.
Thanks and Regards,
Deb
|
|
|
|
|
|
XML Notepad[^] (from MS) is now open source. Maybe it'll help you.
|
|
|
|
|
the source code I got for the XML Notepad from the Codeplex.com is not building.
Can you please zip and send me the entire source code for the XML Notepad in my email id
which is debobrata.bose@gmail.com
Thanks and Regards,
Deb
|
|
|
|
|
Hi,
I have a problem that i have three XSD for validate a XML. I use VC++
for validate the xml
IXMLDOMSchemaCollectionPtr pSchemaCache;
pSchemaCache.CreateInstance(__uuidof(XMLSchemaCache40));
//Add schema to schemacache
hr = pSchemaCache->add(L"",_variant_t(_T("Path\\xdm1.xsd")));
//xdm1.xsd is the XSD in which i import the other two xsd.
this code always fail I don't know why this is happend, can anyone know the reason,pleasse help me.
Thanks & regards
Vicky00000
|
|
|
|
|
I have a table in database :
CREATE TABLE [LeftMenu] (
[NodeID] [int] NOT NULL ,
[ParentNodeID] [int] NULL ,
[FK_LangID] [int] NULL ,
[Text] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[lastlevel] [bit] NULL ,
[linkLevel] [bit] NULL ,
CONSTRAINT [PK_LeftMenu] PRIMARY KEY CLUSTERED
(
[NodeID]
) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
and i want to generate XML file from this table with relation between 'NodeID' column and 'ParentNodeID' to fill ASP.net 2 Menu Control or TreeView Control
like this example:
<menu>
<sub NodeID="1" ParentNodeID="" Text="aaa" />
<sub NodeID="2" ParentNodeID="" Text="aaa" >
<sub NodeID="3" ParentNodeID="2" Text="aaa" >
<sub NodeID="20" ParentNodeID="3" Text="aaa" />
<sub NodeID="20" ParentNodeID="3" Text="aaa" />
</sub>
<sub NodeID="10" ParentNodeID="2" Text="aaa" />
<sub NodeID="12" ParentNodeID="2" Text="aaa" />
</sub>
<sub NodeID="4" ParentNodeID="" Text="aaa" />
<sub NodeID="5" ParentNodeID="" Text="aaa" />
<sub NodeID="6" ParentNodeID="" Text="aaa">
<sub NodeID="14" ParentNodeID="6" Text="aaa" />
</sub>
<sub NodeID="7" ParentNodeID="" Text="aaa" />
<sub NodeID="8" ParentNodeID="" Text="aaa" />
<sub NodeID="9" ParentNodeID="" Text="aaa" />
</menu>
plz reply me.
Thank you
Abdullah Abdelhay
|
|
|
|
|
HI
Run this in a console app and change the connection string!
<pre>
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace MenuGen
{
class Program
{
public static string Crlf = System.Environment.NewLine;
private class LeftMenuNode
{
public int NodeID = 0;
public string ParentNodeID = string.Empty;
public int FK_LangID = 0;
public string Text = string.Empty;
public bool LastLevel = false;
public bool LinkLevel = false;
public List<LeftMenuNode> SubMenus;
public LeftMenuNode()
{
SubMenus = new List<LeftMenuNode>();
}
}
//get the menu data from the database
static void GetDBMenus(ref DataSet ds)
{
string sql = "SELECT * FROM LeftMenu";
SqlCommand cmd = new SqlCommand(sql, new SqlConnection(@"data source=***;initial catalog=***;Integrated Security=True"));
cmd.CommandType = CommandType.Text;
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
ds.Clear();
using (adapter)
{
adapter.Fill(ds);
}
}
static void Main(string[] args)
{
DataSet dsMenus = new DataSet("Menu");
//get the list of menus
GetDBMenus(ref dsMenus);
//make sure we have a table to work with
if (dsMenus.Tables.Count == 0)
return;
//kick off the menu gen process
BuilMenuXML(ref dsMenus);
//now that we've buld a class structure we can work with
//all we have to do now if
}
static void BuilMenuXML(ref DataSet ds)
{
int tab = 0;
string xml = string.Empty;
xml = "<Menu>"
+ Crlf;
//populate our custom menu class
List<LeftMenuNode> menus = new List<LeftMenuNode>();
foreach (DataRowView row in ds.Tables[0].DefaultView)
{
LeftMenuNode menuItem = new LeftMenuNode();
menuItem.NodeID = Convert.ToInt32(row["NodeID"]);
menuItem.ParentNodeID = Convert.ToString(row["ParentNodeID"] == DBNull.Value ? "" : row["ParentNodeID"]);
menuItem.Text = Convert.ToString(row["Text"]);
tab++;
xml += TabChar(tab)
+ "<Sub NodeID=" + menuItem.NodeID.ToString()
+ " ParentNodeID=" + menuItem.ParentNodeID.ToString()
+ " Text=" + menuItem.Text
+ ">"
+ Crlf;
//build sub menu items
BuilSubMenuItem(menuItem, ref ds, ref tab, ref xml);
xml += TabChar(tab)
+ "</Sub>"
+ Crlf;
tab--;
//add main menu
menus.Add(menuItem);
}
xml += "</Menu>"
+ Crlf;
System.Diagnostics.Debug.Write(xml);
//output xml
Console.Write(xml);
Console.ReadLine();
}
//build sub menus - we need the dataset so we can search for sub menus
static void BuilSubMenuItem(LeftMenuNode node, ref DataSet ds, ref int tab, ref string xml)
{
//get a list of sub menus for the node we just passed at the top
DataView view = new DataView(ds.Tables[0], "ParentNodeID = " + node.NodeID,
"ParentNodeID", DataViewRowState.CurrentRows);
//add sub menus to the collection
foreach (DataRowView row in view)
{
LeftMenuNode menuItem = new LeftMenuNode();
menuItem.NodeID = Convert.ToInt32(row["NodeID"]);
menuItem.ParentNodeID = Convert.ToString(row["ParentNodeID"]);
menuItem.Text = Convert.ToString(row["Text"]);
tab++;
xml += TabChar(tab)
+ "<Sub NodeID=" + menuItem.NodeID.ToString()
+ " ParentNodeID=" + menuItem.ParentNodeID.ToString()
+ " Text=" + menuItem.Text
+ ">"
+ Crlf;
//build sub menus for this sub menu
BuilSubMenuItem(menuItem, ref ds, ref tab, ref xml);
xml += TabChar(tab)
+ "</Sub>"
+ Crlf;
tab--;
//add sub menu to collection
node.SubMenus.Add(menuItem);
}
}
private static string TabChar(int instance)
{
string text = "";
if (instance == 0) { return ""; }
for (int i = 0; i < instance; i++)
{
text += (char)9;
}
return text;
}
}
}
</pre>
|
|
|
|
|
Hi all,
I want to collect some data(not all) from an xml file and write them into a csv file. I used a xsl file formatting for that. Here is my xml file content.
<br />
<?xml version="1.0" encoding="ISO-8859-1"?><br />
<MAIN><br />
<CATALOG><br />
<PLANT Tag="no"><br />
<LIGHT>Time may differ</LIGHT><br />
<PRICE>$2.44</PRICE><br />
</PLANT><br />
<PLANT Tag="no"><br />
<LIGHT>Fixed time</LIGHT><br />
<PRICE>$9.37</PRICE><br />
</PLANT><br />
</CATALOG><br />
<CHAT><br />
<SOME>Some Text</SOME><br />
<MORE>More Text</MORE> <br />
</CHAT><br />
</MAIN><br />
<br />
I want to get data on CATALOG element. So here is my style sheet.
<br />
<?xml version="1.0"?><br />
<xsl:stylesheet version = "1.0"<br />
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"><br />
<xsl:output method="text"/><br />
<!--<xsl:strip-space elements = "CATALOG"/>--><br />
<xsl:template match="/MAIN/CATALOG/PLANT"><br />
<!--<xsl:text/><xsl:value-of select="normalize-space(PLANT)"/>"<xsl:text/>--><br />
<xsl:value-of select="normalize-space(LIGHT)"/>";"<xsl:text/><br />
<xsl:value-of select="normalize-space(PRICE)"/>" <xsl:text/><br />
<xsl:text disable-output-escaping = "yes" ></xsl:text><br />
</xsl:template><br />
</xsl:stylesheet><br />
But what happened here is, data on CHAT element also added to the file. I only want data on <LIGHT> and <PRICE> elements. But my style sheet gives data on <SOME> and <MORE> elements. How can I correct this.
Please help me too fix this. I'm stuck with this for two days.
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi All,
I am sending a SOAP based XML file to a web service.For that I have to validate this XML file to it's schema(XSD) file. But I am getting error like
The 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' element is not declared
However there is a envelop in the XML file.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
</soap:Header>
<soap:Body>
</soap:Body>
</soap:Envelope>
Please assist me about this issue.
Regards
|
|
|
|
|
Hi all,
I've written a xsl file to convert xml content to word document. It's working fine. Now I want to change the font type. All text written in Times New Roman type, and I want to change them into Arial. How can I do it?
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I have an Test.xml file. I need to convert it to sql table and save all data by C#.How can i do it ??
|
|
|
|
|
Hi
You can convert the xml file into DataTable. From that you can easily save that data to the SQL table.
Regards
|
|
|
|
|
So, how can i save datatable to the sql table ? ?
|
|
|
|
|
|
thanks..
|
|
|
|
|
If i've a huge xml file and i want copy that data into sql server ce table. How can i do to store it faster?
|
|
|
|
|
Hai,
my xml format:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="PersonalDetails.xsl"?>
<!-- Edited by XMLSpy® -->
<PersonalDetails>
<Record>
<Name input="false">
<value>Saraswathi</value>
</Name>
<Address input="true">
<value>KML</value>
</Address>
<Age input="false">
<value>56</value>
</Age>
<Sex input="false">
<value>F</value>
</Sex>
<DOB input="false">
<value>24-07-1952</value>
</DOB>
</Record>
<Record>
<Name input="false">
<value>Latha</value>
</Name>
<Address input="false">
<value>KML</value>
</Address>
<Age input="false">
<value>28</value>
</Age>
<Sex input="false">
<value>F</value>
</Sex>
<DOB input="true">
<value>24-07-1980</value>
</DOB>
</Record>
<Record>
<Name input="false">
<value>hari</value>
</Name>
<Address input="false">
<value>KML</value>
</Address>
<Age input="false">
<value>58</value>
</Age>
<Sex input="true">
<value>M</value>
</Sex>
<DOB input="false">
<value>24-07-1950</value>
</DOB>
</Record>
</PersonalDetails>
And my xsl of that xml is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/>
<xsl:template match="/">
<html>
<body>
<h2>Personal Details</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Name</th>
<th align="left">Address</th>
<th align="left">Age</th>
<th align="left">Sex</th>
<th align="left">DOB</th>
</tr>
<xsl:for-each select="PersonalDetails/Record">
<xsl:sort select="Name"/>
<tr>
<td>
<input type="text">
<xsl:attribute name="id">
<xsl:value-of select="Name"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="Name"/>
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="value"/>
</xsl:attribute>
</input>
</td>
<td>
<xsl:value-of select="Address"/>
</td>
<td>
<xsl:value-of select="Age"/>
</td>
<td>
<xsl:value-of select="Sex"/>
</td>
<td>
<xsl:value-of select="DOB"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I got the textboxes in the name field..
but the output(Name) didn't have the value....
|
|
|
|
|
Hi all, I've used the VS XSD tool to handle the XML input/output. All seems well, however; the XML that needs to be delivered is on a different technology platform and it can't understand self closing tags like so: < myelement />. It only understands < myelement >< /myelement >.
My problem is that I can't seem to enforce this using the XSD. Is there a way to do this? This happens on empty elements. I tried setting the default value to "" or " " and that didn't do the trick.
Thanks all in advance.
|
|
|
|
|
Ok I found one solution:
1) Don't return the tag at all if element is empty.
LOL the obvious right. It's very silly for a parser not to understand self closing tags, but it's our client's app that is going to read our generated XML. While this works, I'm still very interested on other solutions as well.
Thanks all in advance.
|
|
|
|
|
Anyone knowledgeable with transforms? Is there a quick way to convert all of the True/False entries our VB developers used to true/false so I can serialize/deserialize?
Thanks!
ed
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|