DataView from XML

I have an XML doc that has an element called date. This 
has a date in the following format "1/6/2004". I am using 
a filter sting such as "date > myDate" myDate is in the 
same format and is a date datatype. Everything worked 
fine until the new year, now i am having a problem if I 
put in a date from last year. It will not get any rows 
from '04. I also use a schema that has the following:
"<xs:element name="date" type="xs:date"/>"
Does anyone have any idea how to solve this problem?
Thanks,
Andy
0
anonymous (74721)
1/6/2004 2:35:07 PM
dotnet.xml 7266 articles. 0 followers. Follow

3 Replies
619 Views

Similar Articles

[PageSpeed] 50

Andy wrote:

> I have an XML doc that has an element called date. This 
> has a date in the following format "1/6/2004". I am using 
> a filter sting such as "date > myDate" myDate is in the 
> same format and is a date datatype. Everything worked 
> fine until the new year, now i am having a problem if I 
> put in a date from last year. It will not get any rows 
> from '04. I also use a schema that has the following:
> "<xs:element name="date" type="xs:date"/>"

Actually 1/6/2004 is not valid value of xs:date data type at all. To 
compare such homemade-formatted date values one has to convert it to 
YYYYMMDD format, which can be compared merely numerically.
-- 
Oleg Tkachenko
XML Insider
http://www.tkachenko.com/blog
0
Oleg
1/6/2004 3:04:16 PM
>-----Original Message-----
>Andy wrote:
>
>> I have an XML doc that has an element called date. 
This 
>> has a date in the following format "1/6/2004". I am 
using 
>> a filter sting such as "date > myDate" myDate is in 
the 
>> same format and is a date datatype. Everything worked 
>> fine until the new year, now i am having a problem if 
I 
>> put in a date from last year. It will not get any rows 
>> from '04. I also use a schema that has the following:
>> "<xs:element name="date" type="xs:date"/>"
>
>Actually 1/6/2004 is not valid value of xs:date data 
type at all. To 
>compare such homemade-formatted date values one has to 
convert it to 
>YYYYMMDD format, which can be compared merely 
numerically.
>-- 
>Oleg Tkachenko
>XML Insider
>http://www.tkachenko.com/blog
>.
>

Thank you for the help. I am working with vb.net, but i 
am not seeing a way to format a date as yyyymmdd with the 
FormatDateTime function. Any idea if there is a simple 
function to change the date to that format, or is that 
something i have to do using datepart?
0
anonymous (74721)
1/6/2004 5:42:32 PM
Andy wrote:

> Thank you for the help. I am working with vb.net, but i 
> am not seeing a way to format a date as yyyymmdd with the 
> FormatDateTime function.

Under .NET take a look at DateTime type. It includes everything for date 
time manipulations. You can parse your date value using DateTime.Parse() 
method and then compare dates using DateTime.Compare() method.
-- 
Oleg Tkachenko
XML Insider
http://www.tkachenko.com/blog
0
Oleg
1/6/2004 7:32:07 PM
Reply:

Similar Artilces:

Timeout when xml validating?
Hello. I have a document schema which imports the schema of four other documents. The problem is that when validating a document in the multiple import scenario, I get a timeout and then it complains that one of the individual documents root element is not defined. Is there a way to up the timeout value for validating through xmlvalidatingreader? Or another way? This is not exactly an http request, where you can physically set a timeout property. Thanks in advance. Adam *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for i...

Re: Re: api to check wheter xml is well formed #3
You mean XmlTextReader Ashish wrote: > Are there any functions in .Net which can be used to verify whether xml is > well formed? That's quite unusual requirement. Usually, when XML is built using XML API such as XmlTextWriter you don't need to check if it's well-formed - you can trust standard API. When your XML is loaded into in-memory store, such as XmlDocument - it's well-formed by definition. And when you just have a string or file and want to check it's well-formdness, use XmlTestReader: XmlReader r = new XmlTextReader(...); try { while (r.Read()); ...

multiple filters when filtering a dataview
Hi, I am trying to filter out data in dataview. I have two filters I want to apply, and the following code below seems to only ever keep the last filter working. How can I get both filters to work ??? Dim odv As New DataView Dim oPickTablecnt As DataTable odv = New DataView(PutTable) odv.RowFilter = "sku = '" & m_article & "'" odv.RowFilter = "Completed = false" oPickTablecnt = odv.ToTable() RemainingPuts = oPickTablecnt.Rows.Count Thanks "Aussie Rules" ...

premade config.xml or msp files?
you know how you can make either a config .xml file or and msp file that is customized with options you select. Is there a spot to download premade ones that perhaps fall into certain categories for instance "high security" or "minimal prompts to the end user" just as an example ...

wondering if it's possible to create some sort of form I can use to create an XML document
Hi, I'm wondering if it is possible to use Word to create a form I can use to create XML documents. Basically what I would want is something where I can input certain information that will be used in a few different places in a document and other information that will go in one place. For example (the places where I would want to type in information are in brackets): enter title: [TEXT INPUT] <?xml version="1.0" encoding="UTF-8" ?> <article><document> <category>[PULL DOWN MENU]</category> <Meta_Data> <Title>[IN...

XML for finding artist items
Website one has a big catalog of my favourtie (but some usually I haven't heard of) artists names and album titles but Website two only provides songs but it is very complete. How do I use xml to link up these 2 websites? I want to build up a database in mySQL for example like this. Thanks Artist Songs songs contents checked Madonna papa don't preach @sldiufyhisufyiua y Madonna ........... Michael Jackson Smooth Criminal osoifoasrjajoijf n Yes....

Some basic questions about XML
Hello I'm trying to learn XML by reading a book. There is some text in the book that I don't understand so I try to ask you out there. My first question is does this statement mean that the character string from is placed into the attribute with name type <contect type = "from"> What is the difference between these two statements This first statement is an empty statement. 1. <flag gender = "F" /> //Does this mean that you store the character F in the attribute gender 2. <flag gender = "F"> //Does this also mean that you ...

accessing XML data
Hi, I need to import data from XML to Access97 , what is the best way??? Is there any ODBC solution?? Thanx! Domac This was written with Access 2000 in view, but the idea should work. Check out the article at DBJ. http://www.databasejournal.com/features/msaccess/article.php/3310901 -- Danny J. Lesandrini dlesandrini@hotmail.com http://amazecreations.com/datafast "Domac" <dd.cc@cc.cc> wrote ... > Hi, > > I need to import data from XML to Access97 , what is the best way??? > > Is there any ODBC solution?? > > Thanx! > Domac > ...

XML
I am using the following code to generate XML and it is working just how I want it to except that I would like to include a customized header and footer. My preference was to write the text in order using a write file command in an access database. I am unsure how to include the XML content from the stored procedure. Can anyone point me in the right direction? TIA, Mary ALTER PROCEDURE [dbo].[mc_selEncounterReporting] -- Add the parameters for the stored procedure here @BatchID as int AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering wi...

Writing to XML
Hi all, I have a small problem in writing XML file from VB.net. I am trying to write the XML file using dataset. I am able to write the XML in sequential way(one node after other). I can write in the hierarchial(tree) structure also but only by using datagrid. But I would like to write the XML file without using datagrid but just the grid. I am sending the sample. Could u please tell me how I can write hierarchially using dataset but without using the datagrid. Best regards, Kelly 1.) do you mean by "writing an XML file"? Do you mean saving it to disk or modifying it? 2.) Why...

Digitally Signing XML document with muliple signatures.
I have this web application project done in .net 3.5. It has an object (Contract) that is going to be serialized into an XmlDocument object, signed by 2 parties and then inserted into the database. There is a SignatureBlock element that looks like this: <SignatureBlock> <ActualCompanyNameHere Name="John Doe" Title="Events manager" Date="04/16/2008 11:14:00 AM"> <Host Name = "Bill Babble" Title = "Head of management" Date="04/22/2008 10:00:42 AM"> </SignatureBlock> I was wondering when you use the XmlDigit...

webservices, return xml without .net injecting xml schema
Hey all, I want to return an xml structure without .net trying to inject any of its xml schema? Can this be done? Here is the scenario: I'm running into an issue with the return string of my .NET webservice. I am attempting to return an xml string similar to this: <?xml version="1.0" encoding="utf-8" ?> <sInfo> <name>tom</name> <title>boss</title> <stuff> <anyType>wow</anyType> <anyType>wow2</anyType> </stuff> </sInfo> But instead I receive this: <?xml version="1....

Reading/altering an .xml document
Hey guys - I'm fairly new to .NET and am trying to do the following: Read in one ..xml document, selectively remove and/or change certain nodes within it, then save the results in a second document. For instance, if I have: <a name="a"> <b name="b" miscattr="blah"> <c name="c1"/> <c name="c2"/> </b> </a> I want to convert that into: <a name="a"> <b name="b" miscattr="blah"> <c name="c3"/> <c name="c4&...

XML-like document, want to get attribute names
Hi, I have an XML like document I want to parse... The document looks like this : <Form id="frmMain" width="345" height="75" HeaderHeight="9" image="frmMain.jpg" ColorKey="000000"> <Control id="btnTest1" image="btnTest1.jpg" ColorKey="000000" left="10" top="10" Width="10" Height="10" /> <Control id="btnTest2" image="btnTest2.jpg" hovertype="bevel" left="50" top="20" Width="10" H...

Get from a DataView to an XPathDocument
I want to get from a dataview to an XPathDocument. I have tried the following: System.IO.MemoryStream memstream = new System.IO.MemoryStream() ; DataView.ToTable().WriteXml(memstream); XPathDocument oXPathDocument = new XPathDocument(memstream); My xPathDocument line crashes with the error "Root element is missing" If I do my WriteXml to a file on disk it appears complete. Anyone know what I need to do to get from a DataView to and xPathDocument? I want to avoid writing anything to disk. TIA, Chris Hi Chris, The position of stream should be set to "0"...

XML Import to MM2000
Please bear with me if I ask a question that has been previously addresssed by this group, to which I am new! Is it possible to import to MM2000 a file with extension .FXXML? My bank provides account transactions in that and .CSV formats only and I can only find reference in MM2000 to .OFC and .OFX files. Thanks in advance for any information. Dave "David Spencer" <dispencernomorespam@a1.net> wrote in message news:403b5e78$0$28382$91cee783@newsreader01.highway.telekom.at... > Please bear with me if I ask a question that has been previously addresssed > by this ...

XML vs. SQL Database
I am developing a home project to be later released as an online application. I am currently using XML to store game data, user/member data, and other. Assuming a user base of 10,000 active users, is there a conflict if one user is updating information and another user is creating data on the same xml file? For example: User 1: update inventory that exists in the XML file User 2: new user adding their inventory data in the XML file Thanks for your help. Michael "Michael Jesse" <michaeljesse1973@sbcglobal.net> wrote in message news:tUVDd.13357$iC4.7938@newssvr30.news....

Mapping XML to workbook
Hello, I'm trying to map XML elements to a workbook. Each column in the workbook has hundreds of rows, so the .XML map file is formatted in a such a way that excel detects an XML list is being made. When I drag the XML elements onto the workbook - to complete the mapping process - only half the columns acquire a blue border. (The blue border signifies the columns' contents are mapped to respective XML elements.) The problem columns only have their top two cells blue-bordered (with a blue star in the last cell). This seems to be an issue of Excel finding an empty cell in a...

XML Declaration is missing when I convert a dataset to xml
This is my first time trying to take the results of a query that reside in a Dataset and convert the dataset into an xml file. Everything works great, except that my resulting XML file is missing the xml declaration (the first line): <?xml version="1.0" encoding="iso-8859-1"?> Below is an example of the code I am using: dataset.Namespace = "RatesXML" Dim xmlFilename As String = "myXmlDocument.xml" Dim fsWriteXml As New System.IO.FileStream(xmlFilename, System.IO.FileMode.Create) Dim xmlWriter As New System.Xml.XmlTextWriter(fsWriteXml,System.Text...

Flat File To XML Roundtrip
OK I'm on a steep learning curve with XML et.al. and need some advice. I'm writing a B2B front door for a new application. I have multiple data suppliers all sending various formats of flat files. Most of the inbound files are CSV (but a couple are tab-delimitted and one is an Excel spreadsheet). The goal is to read/process/validate each file and to "transform" the data into a common, internal, file format which will by sent on to a downstream application for final processing and consumption. I'm using VB.Net 2003 as my development platform. My novice approach to do thi...

Import xml data within xml
Is there a specification that defines how one might import xml data within another xml document using a URL ? If so, will it work in .NET? Rein Rein Petersen wrote: > Is there a specification that defines how one might import xml data within > another xml document using a URL ? Take a look at XInclude - http://www.w3.org/TR/xinclude > If so, will it work in .NET? Sure. There is open-source XInclude implementation for .NET - XInclude.NET, http://gotdotnet.com/Community/Workspaces/Workspace.aspx?id=cab253e8-cb4b-47c4-a9d9-6c42947b04a8 -- Oleg Tkachenko http://www.tkachenko.com...

xml parser error: xml document must have a top level element 09-22-05
hi, when deleting an invoice or order i receive the following error message: "xml parser error: xml document must have a top level element" when running sql profiler trace during the procedure, i can see that the following t-sql-statement: update Invoice SET ModifiedBy=N'{1D3ACF63-3D76-49AE-AC90-A6FEB6113545}',ModifiedOn=getutcdate(),DeletionStateCode=2 Where InvoiceId='{45280801-F8C6-4F7E-BC01-DBF3F8FDF701}' and then IF @@TRANCOUNT > 0 ROLLBACK TRAN to me it looks as if the transaction is rollbacked hereby (due to the xml parser error), but i can not u...

Saving xml with accentuated characters
Hello, All! I'm working with accentuated characters in my XML files, and I have found problems to load and save it. First, for this case, I always have my XML in memory, and I load it via LoadXML (please, ignore incorrect concatenations for this sample): Dim cXml As New Xml.XmlDocument Dim strXML as String strXML = "<?xml version="1.0" encoding="ISO-8859-1"?> <SETTINGS> <COLUMNS> <COLUMN INDEX="Code" WIDTH="0" Alias="C�digo"> </COLUMN> </COLUMNS> </SETTINGS>" cXml.LoadXml...

XML to XML
I want to convert an XML Document into another XML Document through XslTransform.Transform, but I do not want to save the the resulting XML document into a file or output stream. I want to save it into a XML Documnet object. Any help is appreciated. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Try using the overload of the Transform method that takes an XML writer and pass in an XmlNodeWriter as input. You can get the XmlNodeWriter implementation from http://gotdotnet.com/Community/UserSamples/Details.aspx?SampleG...

the find in a dataview???
My problem is the following one it is in a datagridview I am showing some data and I would like to locate me in a certain line. Ex. Locate me in a line that has the telephone 999 and this orderly one for name ID - NAME - TELEPHONE 1 - AAA - 111 2 - BBB - 444 3 - CCC - 555 4 - DDD - 666 .. -... -.. 20 - II - 999 .. -... -.. NN - NN - NN Telephone is not key primary in the datatable I want to continue showing all the registrations that is to say I cannot use the filter and I want that this orderly one for name. Then it is supposed that the method find of the dataview would not work, sin...