Group:  General ยป microsoft.public.office.xml
Thread: apply an XML schema onto a CSV file

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

apply an XML schema onto a CSV file
warren- washington, dc 15.11.2005 13:16:03
Our office uses this hideous report generator that always appends a report
header on the first page, a total column and a National Total at the very end
of comma-delimited files. The worst part is the Totals are almost invariably
wrong because the users don't apply them correctly.

I'd like to apply an XML schema to the CSV files so I can either strip or
validate the totals. I'm admittedley new at this, so definitely tell me if
I'm on the wrong path. I'm sure I can write simple VBA code to do it, but I
was hoping there was something already available.
Re: apply an XML schema onto a CSV file
Peter Flynn <peter.nosp[ at ]m.silmaril.ie> 15.11.2005 23:02:08
warren- washington, dc wrote:

[Quoted Text]
> Our office uses this hideous report generator that always appends a
> report header on the first page, a total column and a National Total
> at the very end
> of comma-delimited files. The worst part is the Totals are almost
> invariably wrong because the users don't apply them correctly.
>
> I'd like to apply an XML schema to the CSV files so I can either strip
> or
> validate the totals. I'm admittedley new at this, so definitely tell
> me if
> I'm on the wrong path. I'm sure I can write simple VBA code to do it,
> but I was hoping there was something already available.

Schemas are for describing the construction of XML files, so they are
not the right tool for describing CSV files, because CSV files are not
XML files. But you could convert or import the CSV into an XML
environment (in effect turning it into XML) and then apply a Schema to
check the validity of the file (subject to the limitations of Schemas),
or write a program in XSLT or something else which would check or
strip the totals.

///Peter
--
XML FAQ: http://xml.silmaril.ie/

Re: apply an XML schema onto a CSV file
stylusstudio[ at ]gmail.com 16.11.2005 19:18:05
" I'm sure I can write simple VBA code to do it, but I was hoping there
was something already available. "

This simple approach might work:

step 1: Convert your CSV to XML:
http://www.stylusstudio.com/csv_to_xml.html

step 2: Generate XML Schema for the XML:
http://www.stylusstudio.com/autogen_xsd.html

step 3: Refine your XML Schema Model using an XML Schema Editor:
http://www.stylusstudio.com/xml_schema_editor.html

step 4: associate XML Schema with XML and validate with the XML
validator of your choice:
http://www.stylusstudio.com/xml_validation.html

hope that helps.

Sincerely,
The Stylus Studio Team
http://www.stylusstudio.com

Re: apply an XML schema onto a CSV file
warren- washington, dc 07.12.2005 16:39:03
Sorry for the lateness of my reply, but this is exactly what I was looking
for. I'm still no expert at XML but this gets to my current matter.

Thank you very much for your help!

"stylusstudio[ at ]gmail.com" wrote:

[Quoted Text]
> " I'm sure I can write simple VBA code to do it, but I was hoping there
> was something already available. "
>
> This simple approach might work:
>
> step 1: Convert your CSV to XML:
> http://www.stylusstudio.com/csv_to_xml.html
>
> step 2: Generate XML Schema for the XML:
> http://www.stylusstudio.com/autogen_xsd.html
>
> step 3: Refine your XML Schema Model using an XML Schema Editor:
> http://www.stylusstudio.com/xml_schema_editor.html
>
> step 4: associate XML Schema with XML and validate with the XML
> validator of your choice:
> http://www.stylusstudio.com/xml_validation.html
>
> hope that helps.
>
> Sincerely,
> The Stylus Studio Team
> http://www.stylusstudio.com
>
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net