|
http://www.topxml.com/php_xml_dom/default.asp
|
|
|
|
|
thanks WhiteSky
---------------------
Areff Bahrami(KAVEH)
Areff.HB@Gmail.com
---------------------
|
|
|
|
|
http://www.w3schools.com
for beginner in XML
"I find that the harder I work, the more luck I seem to have."
|
|
|
|
|
How to add Images into my <question> or <answer>? My code is as below.
-----------------------------------------------------------------------------
<quiz xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="quiz.xsd">
<mchoice>
<question>When you create a new document, it always displays behind the Toolbox. Which of the following actions will ensure it always opens flush with the Toolbox?</question>
<answer>Using the keyboard shortcut key Ctrl+N [Cmd+N] to always create a new document</answer>
<answer>Making sure the Options bar is not parked flush with the top of the screen; allowing a gap of a few pixels in between</answer>
<answer>Holding down the Alt [Opt] key as you click the OK button in the New dialog</answer>
<answer correct="yes">Moving the Toolbox a few pixels away from the edge of the screen</answer>
</mchoice>
|
|
|
|
|
Yeah u found the solution use this line of code
<![ CDATA [[img]../pic.jpg[/img]]]>
|
|
|
|
|
Hi,
VS 2005 / C#
Simple situation: A DataTable with some columns and rows added. But when using the WriteXML method to create an XML file from this table it gives me the following output:
<?xml version="1.0" encoding="utf-8"?>
<DocumentElement>
<Batch_Table>
<Height>18</Height>
<Width>75</Width>
<Program>1</Program>
<Length1Min>18</Length1Min>
<Length1Max>60</Length1Max>
<Price1>1000</Price1>
</Batch_Table>
<Batch_Table>
<Height>25</Height>
<Width>125</Width>
<Program>2</Program>
<Length1Min>12</Length1Min>
<Length1Max>40</Length1Max>
<Price1>1200</Price1>
<Length2Min>40</Length2Min>
<Length2Max>60</Length2Max>
<Price2>1300</Price2>
</Batch_Table>
...and so on. The problem is that each row/record of the table is named as the TABLE (which is called "Batch_Table"). This is wrong! How can I fix this?
Thanks.
/Magnus
|
|
|
|
|
how to get microsoft.xmldom?
I dont find this activex
can you help me
thanks
|
|
|
|
|
WhiteSky wrote: how to get microsoft.xmldom?
this is the syntax.....
obj = new ActiveXObject('Microsoft.XMLDOM');
or
obj = new ActiveXObject('MSXML2.DOMDocument.4.0');
use either of the two in ur scripts
sathy
|
|
|
|
|
I need to 'Microsoft.XMLDOM'
|
|
|
|
|
Hi,
I am having an XML file which has two elments id & StartDate, Iam using Visual C# > XMLTextReader Object "reader" to read this file, if the nodetype is text and the elementname is startdate then write the startdate by converting it. If you see the below code hope every thing gets clear
Insted of getting the value I want to search if the XmlNodeType is text then I want to get the datatype (i.e. date or string or int32 etc.) of the element insted of the value
System.IO.Stream objStream = new System.IO.MemoryStream();
DataSet objDs = new DataSet();
objDs = getData();
XmlTextReader reader = new XmlTextReader(objDs.GetXml(), XmlNodeType.Element, null) ;
Response.ContentType = "text/xml";
XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, System.Text.Encoding.UTF8);
writer.Indentation = 4;
writer.WriteStartDocument();
string elementName = "";
while(reader.Read())
{
switch(reader.NodeType)
{
case XmlNodeType.Element:
writer.WriteStartElement(reader.Name);
elementName = reader.Name;
break;
// In the below case I have a problem I want to get the datatype of the node insted of the data
case XmlNodeType.Text:
if(elementName == "StartDate")
writer.WriteString(XmlConvert.ToDateTime(reader.Value).ToString());
else
writer.WriteString(reader.Value);
break;
case XmlNodeType.EndElement:
writer.WriteEndElement();
break;
}
|
|
|
|
|
The type of the element is defined in the schemas, there is no way to get this information from the xml document alone.
Denevers
|
|
|
|
|
hi all,i'm creating a mobile appliction with ms vs2005 release edition, im using a webservice from www.webservicex.com and i get the exception with the details :
Status :System.Net.WebExceptionStatus.ConnectFailure
System.Net.WebException was unhandled
Message="Could not establish connection to network."
StackTrace:
at System.Net.HttpWebRequest.finishGetResponse()
at System.Net.HttpWebRequest.GetResponse()
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
at DeviceApplication2.net.webservicex.www.lengthUnit.ChangeLengthUnit()
at DeviceApplication2.Form1.button1_Click()
at System.Windows.Forms.Control.onclick()
at System.Windows.Forms.Button.onclick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at DeviceApplication2.Program.Main()
&here's my code:
private void button1_Click(object sender, EventArgs e)
{
net.webservicex.www.lengthUnit l = new
DeviceApplication2.net.webservicex.www.lengthUnit();
double x = l.ChangeLengthUnit(120, DeviceApplication2.net.webservicex.www.Lengths.Feet, DeviceApplication2.net.webservicex.www.Lengths.Meters);
MessageBox.Show(x.ToString());
}
please tell me where is the error (i'm deploying it using the device emulator and the active sync program)
|
|
|
|
|
Hi,
I wonder if anyone can offer some advice on the best way to accomplish this:
I have an existing asp.net app that displays products from a catalogue, data stored in access. My friend has provided an xml feed from their database so that I can incorporate their data into my app, without the need to duplicate the data. How would I go about building a feed mechanism where by I can display their data whenever a user loads my app?
I would guess this is a common requirement.
Many Thanks
Kieran
|
|
|
|
|
am i getting u right ...
u friend as provided an access for u to get the datas as xml ....
and u r askin how get tht data and display it in ur app???
if tht is the case u write a webservice for tht ... to get the datas from there....
if not provide some more details
sathy
|
|
|
|
|
Hi everybody,
I'm looking for an activex control (or anything that could be interfaced easily with MFC) which provides XML code editing with the following features:
- syntax highlight
- auto completion
- auto validation of the syntax
Something real simple like the VS.Net XML Editor.
I've searched for one during many hours, but unsuccessfully...
Thanks
|
|
|
|
|
could anyone please suggest how to convert a .mat file to xml
|
|
|
|
|
I have the following code sequence:
MemoryStream memStream= new MemoryStream();
XmlTextWriter xmlWriter= new XmlTextWriter(memStream, System.Text.Encoding.UTF8);
doc.Save(xmlWriter, myCommand );
string xmlCmd= System.Text.Encoding.ASCII.GetString(memStream.ToArray());
System.Console.WriteLine( "xmlCmd= {0}", xmlCmd );
Here's the command it creates:
o;?<mycommand xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
...="" lots="" of="" valid="" xml="" here
<="" mycommand="">
Why the 'o;?' characters in front of the command?
|
|
|
|
|
Hi,
could anybody help with this?
I want to replicate this hard coded xml by drawing the data from a sql database.
I have had some sucess but I would like to omit "PR_Ref" entry from the resulting dataset,
but I do need it for the foreignkey/primarykey. I'm not sure if the string conversion is
correct either.
I need to read the resulting dataset to a string. This is the original hard coded bit:
______________________________________________________________________________________________
string xmlData;
xmlData = "<newdataset>";
xmlData += " <group>";
xmlData += " <name>Project 1";
xmlData += " <blockcolor>#ff0000";
xmlData += " <block>";
xmlData += " <href>activity.aspx?ActID=7";
xmlData += " <startdate>2005-04-01T00:00:00.0000000+01:00";
xmlData += " <enddate>2005-04-03T00:00:00.0000000+01:00";
xmlData += " <name>First part";
xmlData += " ";
xmlData += " <block>";
xmlData += " <href>activity.aspx?ActID=13";
xmlData += " <startdate>2005-04-06T00:00:00.0000000+01:00";
xmlData += " <enddate>2005-04-06T00:00:00.0000000+01:00";
xmlData += " <name>blah, blah";
xmlData += " ";
xmlData += " ";
xmlData += " <group>";
xmlData += " <name>Project 2";
xmlData += " <blockcolor>#ff0000";
xmlData += " <block>";
xmlData += " <href>activity.aspx?ActID=14";
xmlData += " <startdate>2005-04-06T00:00:00.0000000+01:00";
xmlData += " <enddate>2005-04-09T00:00:00.0000000+01:00";
xmlData += " <name>blah, blah";
xmlData += " ";
xmlData += " <block>";
xmlData += " <href>activity.aspx?ActID=15";
xmlData += " <startdate>2005-04-06T00:00:00.0000000+01:00";
xmlData += " <enddate>2005-04-09T00:00:00.0000000+01:00";
xmlData += " <name>blah";
xmlData += " ";
xmlData += " ";
xmlData += "";
______________________________________________________________________________________________
This is my attempt
____________________________________________________________________________________________
DataSet myds = new DataSet();
OleDbDataAdapter myGroupAdapter;
OleDbDataAdapter myBlockAdapter;
DataColumn primaryKey = new DataColumn();
DataColumn ForeignKey = new DataColumn();
OleDbConnection myConn = new OleDbConnection("Provider=SQLOLEDB.1; Persist Security Info=False; Data Source=xxx; Initial Catalog=xxx;User ID=xx;Password=xxxxxx;");
myGroupAdapter = new OleDbDataAdapter("select PR_NAME, blockcolor, PR_Ref from PM_PROJECT", myConn);
myBlockAdapter = new OleDbDataAdapter("Select href, Sub_Start, Sub_End, Sub_Name, PR_Ref from SUBTASK", myConn);
myGroupAdapter.Fill(myds, "group");
myBlockAdapter.Fill(myds, "block");
primaryKey = myds.Tables["group"].Columns["PR_Ref"];
ForeignKey = myds.Tables["block"].Columns["PR_Ref"];
DataRelation relation = new DataRelation("group", primaryKey, ForeignKey);
relation.Nested = true;
myds.Relations.Add(relation);
string xmlData = Convert.ToString((DataSet)myds);//not sure if this bit works
//I tested it with this:
myds.WriteXml("TestXML.txt")
___________________________________________________________________________________________
This was the resulting output
<newdataset>
<group>
<pr_name>Test Project
<blockcolor>#ff0000
<pr_ref>1
<block>
<href>activity.aspx?ActID=7
<sub_start>2006-02-02T00:00:00+00:00
<sub_end>2006-02-03T00:00:00+00:00
<sub_name>Start Test
<pr_ref>1
<block>
<href>activity.aspx?ActID=7
<sub_start>2006-02-03T00:00:00+00:00
<sub_end>2006-02-05T00:00:00+00:00
<sub_name>second sub for
<pr_ref>1
<block>
<href>activity.aspx?ActID=7
<sub_start>2006-02-03T00:00:00+00:00
<sub_end>2006-02-07T00:00:00+00:00
<sub_name>3rd test
<pr_ref>1
<group>
<pr_name>second Test
<blockcolor>#ff0000
<pr_ref>2
<block>
<href>activity.aspx?ActID=7
<sub_start>2006-02-01T00:00:00+00:00
<sub_end>2006-02-08T00:00:00+00:00
<sub_name>first/second
<pr_ref>2
Sorry the post is so long. Does anybody have any ideas??
Thanks
Ironstrike
|
|
|
|
|
Output didnt copy properly, sorry again about the long post
<newdataset>
<group>
<pr_name>Test Project
<blockcolor>#ff0000
<pr_ref>1
<block>
<href>activity.aspx?ActID=7
<sub_start>2006-02-02T00:00:00+00:00
<sub_end>2006-02-03T00:00:00+00:00
<sub_name>Start Test
<pr_ref>1
<block>
<href>activity.aspx?ActID=7
<sub_start>2006-02-03T00:00:00+00:00
<sub_end>2006-02-05T00:00:00+00:00
<sub_name>second sub for
<pr_ref>1
<block>
<href>activity.aspx?ActID=7
<sub_start>2006-02-03T00:00:00+00:00
<sub_end>2006-02-07T00:00:00+00:00
<sub_name>3rd test
<pr_ref>1
<group>
<pr_name>second Test
<blockcolor>#ff0000
<pr_ref>2
<block>
<href>activity.aspx?ActID=7
<sub_start>2006-02-01T00:00:00+00:00
<sub_end>2006-02-08T00:00:00+00:00
<sub_name>first/second
<pr_ref>2
|
|
|
|
|
I have an xsd file that I use to validate inbound xml files and it works fine as long as the elements are in the same order. But what I would like is for it to validate the element exists rather than it exists in a specific order.
For example I want both of these to be validated as true:
<Customer>
<LastName>Smith</LastName>
<FirstName>John</FirstName>
</Customer>
- or -
<Customer>
<FirstName>John</FirstName>
<LastName>Smith</LastName>
</Customer>
The elements FirstName and LastName under customer need to exist, I just don't care which order they are in. Is there something in the xsd that can be set to make it work this way?
Thanks in advance,
Al
|
|
|
|
|
Dear All,
Can You Help me to come accross my problem.
I need to convert the Excel file in the following format to Xml file Specified below...
Taskid Name OutlineLevel Colvalue
110i Design 3 L4_R_D04.002
111i Coding 3 L4_R_D04.004
112i Testing 3 L4_R_D04.006
<tasks>
<task Taskid="110i" Name="Design" Oulinelevel="3">
<colValue>L4_R_D04.002</colValue>
</task>
<task Taskid="111i" Name="Coding" Oulinelevel="3">
<colValue>L4_R_D04.004</colValue>
</task>
..........
</tasks>
Thanks n Regards,
Ramya.R
-- modified at 23:58 Thursday 23rd February, 2006
|
|
|
|
|
Any idea on xsl watermark.
|
|
|
|
|
You create your watermark with HTML. XSL can transform XML data into an HTML document that has a watermark.
|
|
|
|
|
Hi,
I need to add attribute information defined in xsd file to my resx file, which contains already defined schema and other information. For example I have defined attribute 'Page' in XSD file then I need to add this attribute in my resx file. Suggest me how to acheive this..I have already imported the underlying XSD file through "schemalocation"...
I guess I made myself clear.............
|
|
|
|
|
Hi!
When creating a new XmlDocument with DOM I stumbled upon the following problem. Wanting to display the xml-structure (containing namespaces) the XmlDocument.NameTable used in XmlNamespaceManager(xmlDocument.NameTable) is different when I try to display the XmlDocument directly after creating it than it is when saving the XmlDocument to file, reopening and THEN displaying it. The result is that the NameSpaceManager doesn't underestand the namespaces in SelectSingleNode & selectNode methods.
Saving to file and reopening before running the two methods works fine, and I notice in debugging that the length of the XmlDocument.NameTable is different(longer) than before saving/reopening to/from file. How can I manipulate the XmlDocument.NameTable in order for the NameSpaceManager to understand the namespaces without having to save and reopen the file? Or is my problem elsewhere ? This was the only difference I could find. The innerXml of the xmlDocument is 100% identical in both cases.
Hopefully awaiting a helping hand.
C
|
|
|
|