|
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
|
|
|
|
|
What database are you using? If its SQL Server you can use the FORXML clause to format the resultset.
Also, why use .NET 1.1? It is very outdated, 2.0 is the minimum you should be working with.
only two letters away from being an asset
|
|
|
|
|
Hi,
I have one Merge Module (MSM) created using WISE which I want to use it in WIX.
When I created MSI using WIX which contains the above MSM and RUN the MSI then the Service EXE and the related DLL's are copied to my system Folder but the service is not Installed and started in my system.
But when I do the same steps mentioned above with WISE ( Created MSI which contains MSM) then the service is Installed and Started in my system.
Is there anything extra I need to do it in WIX in order to Install and Start the Service?
Thanks,
Narasimha.
|
|
|
|
|
Hi All,
I have to read in an xml or xsd document (XCCDF - The Extensible Configuration Checklist Description Format) and would like to create tables in the Database based on them (if they do not exist). I do NOT know what the Table names/Fields will be so I am looking to do it dynamically.
XCCDF is a specification language for writing security checklists, benchmarks, and related kinds of documents.
This is a view of the formt (xml):
<?xml version="1.0" encoding="utf-8"?>
<Benchmark id="MicrosoftSecurityComplianceManagementForWindows2008" resolved="0" xml:lang="en" xmlns="http://checklists.nist.gov/xccdf/1.1" xmlns:cdf="http://checklists.nist.gov/xccdf/1.1" xmlns:cpe="http://cpe.mitre.org/XMLSchema/cpe/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xsi:schemaLocation="http://checklists.nist.gov/xccdf/1.1 xccdf-1.1.xsd http://cpe.mitre.org/XMLSchema/cpe/1.0 cpe-1.0.xsd">
<status date="2008-05-16">draft</status>
<title>Microsoft Security Compliance Management for Windows Server 2008</title>
<description>Microsoft Security Compliance Management for Windows Server 2008</description>
<notice id="terms-of-use" xml:lang="en">
</notice>
<front-matter>
<xhtml:p>
</xhtml:p>
</front-matter>
<rear-matter>
</rear-matter>
<reference href="http://checklists.nist.gov/repository/1001.html">
<dc:title>Microsoft Security Compliance Management for Windows Server 2008</dc:title>
<dc:creator>Microsoft Solution Accelerator for Security and Compliance</dc:creator>
<dc:publisher>
</dc:publisher>
<dc:identifier>
</dc:identifier>
</reference>
...
...
Full info on these files can be found here[^]
So, any ideas how to do this dynamically?
Regards,
Dan
|
|
|
|