|
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
|
|
|
|
|
Dan Madden wrote: So, any ideas how to do this dynamically?
Could you be more specific. Your post seems to be asking for a complete solution rather than answers to specific questions. You have also not provided any development environment information.
led mike
|
|
|
|
|
How can I set an transparent background using HTML. Give me a example of code for that....
|
|
|
|
|
you can set a transparent on bodytag as background.But first make a transparent image for it.
Cheers!!
Brij
|
|
|
|
|
When catching an XmlSchemaValidationException, the debugger shows hidden members like ‘Res’ = ‘Sch_InvalidElementContentExpecting’ and string Args[] with the expected elements. I would like to access these hidden members so that I can create my own error message in my native language. Does anybody know how to retrieve this information? Code fragment: invoked after call to XmlDataDocument.Validate:
private void ValidationCallBack(Object sender, ValidationEventArgs args)
{
if (args.Exception.GetType() == typeof(XmlSchemaValidationException))
{
XmlSchemaValidationException ex = args.Exception as XmlSchemaValidationException;
textBoxValideer.Text += node.Name + " " + ex.Message + "\n";
}
else
{
textBoxValideer.Text += "\n?";
}
}
M.A
|
|
|
|
|
Hi,
I'm trying to figure out how to extract data from an ASP.NET generated table.
Here's an excerpt of the HTML:
<body>
...
<table cellspacing="1" cellpadding="3" border="0" id="ctl00_ContentPlaceHolderDroit_GridView1" style="border-width:0px;width:690px;">
...
<tr class="txt_general" style="background-color:#F4F4F4;"> // <--- Row that contains the data that is repeated
<td style="width:70px;" rowspan="1" colspan="1">
<img src="../Photo.ashx?id=1576120" style="height:58px;width:70px;border-width:0px;" /> // <-- I want to extract the photo ID
</td>
<td rowspan="1" colspan="1">
<span id="ctl00_ContentPlaceHolderDroit_GridView1_ctl02_lblPrice">87 000$</span> // I want to extract the price. The ID increments ct103_lblPrice would be the next row.
<br clear="none" />
</td>
</tr>
...
</table>
</body>
Can someone help me with this problem?
|
|
|
|
|
We are in the process of centralizing everything - data, apps, 3rd party imports, SSIS jobs, etc. Most of the home grown apps are going to need to be completely overhauled, and the 3rd party stuff and SSIS jobs can all use XML.
If you were going to use a development platform going forward to get things off the ground and you were starting from scratch, what would you use? We currently write everything in C# and rely heavily on AD for application permissions and access.
Any suggestions would be welcome. I was thinking that since we're moving to a bigger focus on BI and possibly moving to Sharepoint for a lot of our internal work, that Flex, Adobe Air, Laszlo Systems or some other XML RIS technology might be a good way to look.
All of this is internal, don't have to worry about being public.
Thanks!
|
|
|
|