|
Hi,
I need to pass Html code in one of the xml tags but i am having a problem when trying to parse the xml code. I tried replacing the < and > with & lt; and & gt; (with no spacing) but all in vain. I am parsing the code with javascript functions. Does anyione a way by which i can solve this problem please? Thanks for your time
|
|
|
|
|
Use a CDATA section
only two letters away from being an asset
|
|
|
|
|
Hi,
I am trying a sample program...to create source code from a simple flow chart prepared in visio(not UML models). Please give me any ideas, to start it or let me know are there any tools available to do my job.
Thanks in advance
By,
sree
sree
|
|
|
|
|
hi ,
i want to understand the contents of schema ?
Code:
<schema xmlns=""http:
targetNamespace="http://www.example.com/name"
elementFormDefault="qualified">
<element name=""name""></element>
i know why i use namespace "xmlns=”http://www.w3.org/2001/XMLSchema" but what is this mean "xmlns:target=”http://www.example.com/name”" and what is targetNamespace and the difference between it and normal namespace ? and also what is mean by "elementFormDefault=”qualified”" i read that u can modify the default specifying how element should be qualified but i can not understand what is the effect of it if i add it in my schema? plz give me simple explain if u can help me.
|
|
|
|
|
|
Happy New Year,
Strange one to start the year off, any help would be appreciated.
I have a Winform Project calling a web service. passing in an XML string.
When I pass through my XML to the webservice, it works fine and gets inserted into the dataset without a problem, however as soon as I include an email address within the XML the dataset does not create correctly?
Dim strXML As String = "<parameters><parameterline><details><machineid>Pal0066</machineid><printer>Printer1</printer><username>TomUser</username>"
strXML &= "<reportname>CanteenBilling</reportname><receiptmethod>Email</receiptmethod><format>PDF</format>"
strXML &= "<emailto>email@problemishere.co.uk</emailto><emailcc></emailcc><emailbcc></emailbcc><emailsubject></emailsubject>"
strXML &= "<emailbody></emailbody></details><reportparameters><location>1</location></reportparameters></parameterline></parameters>"
ConvertXMLIntoDS(StrXML)
Private Function ConvertXMLIntoDS(ByVal strXML As String) As Data.DataSet
Dim ds As New Data.DataSet
Dim reader As System.IO.StringReader
Try
reader = New System.IO.StringReader(strXML)
ds.ReadXml(reader)
ConvertXMLIntoDS = ds
Catch ex As Exception
'RunReports.AddLog("ConvertXMLIntoDS - Error")
'RunReports.AddError(ex, methodBase.Name)
Finally
If Not IsNothing(ds) Then
ds.Dispose()
ds = Nothing
End If
If Not IsNothing(reader) Then
reader.Dispose()
reader = Nothing
End If
End Try
End Function
|
|
|
|
|
tomkettering wrote: the XML the dataset does not create correctly?
"does not create correctly" means what?
The following C# produces the email address as expected.
string sxml = "<root><mail>hello@mymail.com</mail></root>";
DataSet ds = new DataSet();
ds.ReadXml(new System.IO.StringReader(sxml));
Console.WriteLine(ds.Tables[0].Rows[0].ItemArray[0].ToString());
led mike
|
|
|
|
|
|
hi all
I want to generate the .xsd for xml document
the format of xml would be say
<menu>
<mainmenu>
<childmenu> ///optional 0 to n
<submenu />
.
.
.
<childmenu>....
</childmenu>
<submenu>
.
.
.
</submenu></childmenu></mainmenu>
.
.
.
.
</menu>
|
|
|
|
|
There is a tool "XML Schema Definition Tool as xsd.exe" provided by the microsoft with its SDK.You can found it at "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin".It can generate schema of a xml file and a lot more.
just give this command with your xml file and outfile directory.It'll generate the schema file of your xml.
To know more Click here[^]
Cheers!!
Brij
|
|
|
|
|
Hai all,
i am developing an application which is used to create Xml document depend upon input given by user, in C#.My application contains datagridview and one of its column name is "text".
After creating xml,my xmldocument looklike
<text>
<strong>What Tools Will I Need?</strong><br />* 3/8-drive socket set<br />* 3/8-drive SAE deep-well sockets<br />
</text>
But i need it in THIS format
<text>
<![CDATA[ <strong>What Tools Will I Need?</strong><br />* 3/8-drive socket set<br />* 3/8-drive SAE deep-well sockets<br / ]]>
</text>
if anybody know ,help me
|
|
|
|
|
hi,
i want to know what is the problem if i do not used the DTD in my xml document, i want example in real world ?
when i use DTD and Schema ?
|
|
|
|
|
|
Hi.
I know there must be many ways to skin this cat, but I've invested a little time in xflat and I was wondering if someone has the experience to point out what I'm doing wrong?
if someone else knows a better/simpler way to convert the data from flat file to xml I'd appreciate a suggestion also.
thanks
Jeff
My flat file data format consists of records that are pipe delimited
and all start with a 2 digit code, here is what 2 files might look like:
file1
05|vendor1code|vendor1desc|vendor1code2
05|vendor2code|vendor2desc|
05|vendor3code|vendor3desc|vendor3code2
05|vendor4code|vendor4desc
05|vendor5code|vendor5desc|vendor5code2
10|AA000222|NULLSERVER|D: |\otherdir\information\AA000222\
22|part9100|HANDLE|XX00|internalnum3|SMALL HANDLE|0
22|part44|GINORMOUS LEG|AA00|||0
file2
05|vendor1code|vendor1desc|vendor1code2
05|vendor6code|vendor6desc|
05|vendor9code|vendor9desc|vendor9code2
10|XY000034|NULLSERVER|C: |\mydir\information\XY000034\
22|part0100|ROTOR|XX00|internalnum12|big ROTOR|1
22|part100-7|BIG FRAME|XX00|||0
The first part of my 'real' data file is like this:
05|CH07|CHICAGO RAWHIDE|
05|XD00|XOULD|
05|XP00|XOULDS SUMPS|
10|XY000034|NULLSERVER|C<code>: </code>|\mydir\information\XY000034\
22|part0100|ROTOR|XX00|internalnum12|big ROTOR|1
22|part100-7|BIG FRAME|XX00|||0
and my flat xfl file (the schema for xflat input) is like this:
<br />
<?xml version='1.0'?><br />
<XFlat Name="navigator_mld_schema" Description="Schema for mld flat file"><br />
<SequenceDef Name="manuals" Description="Manual MLD flat file"><br />
<ChoiceDef Name="import_record" Description="Import Data Of One Record Type" MinOccur="0" MaxOccur="11" MapToXml="No" ><br />
<RecordDef Name="oem_05" FieldSep="|" RecSep="\N"><br />
<FieldDef Name="order_code" DataType="Integer" ValidValue="05" MapToXml="No" NullAllowed="No"/><br />
<FieldDef Name="vendor" MapToXml="No"/><br />
<FieldDef Name="description" MapToXml="No"/> <br />
</RecordDef><br />
<RecordDef Name="location_10" FieldSep="|" RecSep="\N"><br />
<FieldDef Name="order_code" DataType="Integer" ValidValue="10" MapToXml="No" NullAllowed="No"/><br />
<FieldDef Name="manual" MapToXml="No"/><br />
<FieldDef Name="server" MapToXml="No"/><br />
<FieldDef Name="drive" MapToXml="No"/><br />
<FieldDef Name="path" MapToXml="No"/> <br />
</RecordDef><br />
<RecordDef Name="mfgrpart_item_22" FieldSep="|" RecSep="\N"><br />
<FieldDef Name="order_code" DataType="Integer" ValidValue="22" MapToXml="No" NullAllowed="No"/><br />
<FieldDef Name="part" NullAllowed="Yes" MapToXml="No"/><br />
<FieldDef Name="partdescription" NullAllowed="Yes" MapToXml="No"/><br />
<FieldDef Name="vendor" NullAllowed="Yes" MapToXml="No"/> <br />
<FieldDef Name="item" NullAllowed="Yes" MapToXml="No"/><br />
<FieldDef Name="description" NullAllowed="Yes" MapToXml="No"/><br />
<FieldDef Name="stocked" MapToXml="No" /><br />
</RecordDef><br />
</ChoiceDef><br />
</SequenceDef><br />
</XFlat><br />
==========================================
When I run xflat I get this:
Licensed copy of XML Convert 2.2.
Copyright (C) 1999 - 2007 Unidex, Inc. All rights reserved.
You may use this software only if you have read the license agreement
and accept its terms.
For more information, please visit http://www.unidex.com/.
Error parsing the flat file.
Description: Unrecognizable record.
The error occurred in file:/C:/Downloads/Utilities/XQuery/XMLConvert/xmlconvert/testdata/gp000034.dxx at record number 1.
The character offset of this record (from the beginning of the file) is 1.
The bad record begins with:
05|CH07|CHICAGO RAWHIDE|
05|XD00|XOULD
I dumped the data file to make sure there were really 13 10 line feeds at the end of each line, so I'm not sure what could be going wrong.
thanks alot
Jeff
|
|
|
|
|
I want to read the following xml schema file
and I want to take/pickup only elements name like ID,Trademark and model
<?xml version="1.0" encoding="utf-8" >
<NewDataSet>
<xs:element name="Cars">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="0"/>
<xs:element name="Trademark" type="xs:string" minOccurs="0"/>
<xs:element name="Model" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</NewDataSet>
I have this code
Try
Dim reader As New Xml.XmlTextReader("C:\xml\XMLFile2.xml")
Dim s As String = ""
While readee.Read
If reader.AttributeCount < 2 Then
s = reader.LocalName <---------------Returns element
End If
End If
End While
Catch ex As Exception
End Try
In above code the line reaturns the 'element' keywod
but I want 'ID','tradeMark','Model' insted of element keyword...
How can I do this ?
|
|
|
|
|
first read the attribute name,type.. etc.Then read the value of those attributes .The value will return which you want.
Cheers!!
Brij
|
|
|
|
|
How to read atrribute Name and type ?
|
|
|
|
|
I want to read the following xml schema file
and I want to take/pickup only elements name like ID,Trademark and model
<newdataset>
<xs:element name="Cars" xmlns:xs="#unknown">
<xs:complextype>
<xs:sequence>
<xs:element name="ID" type="xs:int" minoccurs="0">
<xs:element name="Trademark" type="xs:string" minoccurs="0">
<xs:element name="Model" type="xs:string" minoccurs="0">
I have this code
Try
Dim reader As New Xml.XmlTextReader("C:\xml\XMLFile2.xml")
Dim s As String = ""
While readee.Read
If reader.AttributeCount < 2 Then
s = reader.LocalName <---------------Returns element
End If
End If
End While
Catch ex As Exception
End Try
In above code the line reaturns the 'element' keywod
but I want 'ID','tradeMark','Model' insted of element keyword...
How can I do this ?
|
|
|
|
|
Why duplicate post?
Cheers!!
Brij
|
|
|
|
|
I have the code of readin gxml file
Dim reader As New Xml.XmlTextReader("C:\XMLFile2.xml")
Dim s As String = ""
While reader.Read()
s = s + reader.Name
End While
Now from above code,the reader reads every single word of the schema..
But I want to read only Nodes and its child node of the schema and store it into s..
How can I read only the element and its child nodes ?
|
|
|
|
|
Use the ReadElementXXX methods rather than Read(). Better yet, use and XMLDocument or XDoxument in 3.5.
only two letters away from being an asset
|
|
|
|
|
Hi,
I am developing a web service in C#.Net1.1 and a new bee to .NET.
I have developed a web method to retrieve the data from database and I want to sent the response in the form of XML.I want to manipulate the dataset to get the desired XML.But I dont know how to do that?
Can somebody help me in formatting the XML. Also, once I will format the XML, what return type I should use in web method to get XML file as output.
Thanks in advance.
Example:
Current XML:
<newdataset>
-
<modelnumber>P750
- <table1>
<serialnumber>7501430
- <table2>
<balance>448.9300
Required XML:
xml version="1.0" ?>
<pbpaccount>
<account>
<account>123445
<status>
<numberofmeters>
<accountbalance>
|
|
|
|
|
In which format you want the XML.
You need to first learn basic XML.You'll get the answer
Check the link
[^]">
Cheers!!
Brij
|
|
|
|
|
Thanks for repling.
I know basics of XML. In my post earlier Tags didnt come.
I want to cutomize the tags according to the requirement rather than getting the Tags for the default database.
|
|
|
|
|
You can change the format of XML from one to another using XSLT for that you need XSLT style sheet.
Check the link
Click[^]">
Cheers!!
Brij
|
|
|
|