Consulting

Results 1 to 4 of 4

Thread: xsd parsing -> csv -> Excel (maybe)?

  1. #1
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location

    xsd parsing -> csv -> Excel (maybe)?

    .xsd files are really xml files meant to replace the DTD documentation standard. In effect they are validation schemas to insure that xml data is passed correctly to and from applications. Creating an xsd is not that difficult and there are plenty of free tutorials. However, consider being given one and asked to parse it in such a way that you get an understanding of the 'rules' contained within the various nodes.

    Anyway, I found the free Logparser COM dll ideal in that it accepts xsd as input and can output as .csv, creating header rows. Problem is the csv is redundant, and it would be nice if it could be loaded into excel and a Pivot created to represent a semi-treeview.

    The attached zip has an xsd that is part of a large validation structure for SIF (Schools Interoperability Framework - the next 'holy grail' of data consistency). Then there is a .csv created from it via LogParser [could be done as a single command line if you don't want to use the dll).

    Question: might it be possible to format the csv as a meaningful pivot? Stan

  2. #2
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    as a P.S. to anyone who suggests "Why Not Just use 'Msxml2.XMLSchemaCache.5.0' ? "

    I tried that first, just get some obnoxious Microsoft error codes, since the elements are resolved via ref=, not locally [was my best guess]. Stan

  3. #3
    Moderator VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,184
    Location
    Hi Stan,

    Do a search for "XML Notepad 2007" the download is a handy little tool that takes a .xlm or .xsd files and displays it in a somewhat human readable format. Using this you will see the errors (2).

    It looks to me like more of a user defined type with validation entries for elements and data types defined. May be useful for defining a database/table also.

    I have no clue what a pivot table is other than the help files.

  4. #4
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    Thanx Tommy, I overlooked that tool

    Unfortunately, I cannot resolve the error [really a warning, according to WC3] since
      <element name='Confidence' type='string'/>
    is really valid XML. The real problem is that when using code such as
    cXSD = "StudentLocator.xsd"   
    oCache = CreateObject("Msxml2.XMLSchemaCache.5.0") 'change to 4.0/3.0 depending
    cTarget = "http://www.sifinfo.org/infrastructure/1.x"
    oCache.add cTarget, cXSD
    it errors out [see JPG] in a totally different area [hmm... 2 Microsoft products disagreeing with each other ]. The xsd file is part of the SIF Specification http://www.sifinfo.org/ so I have some confidence about its validity [of course with the caveat that 'school excellence' may be an oxymoron]. So at least LogParser can be scripterd to output w/out errors.

    Thanks again. I'll leave this open over the weekend for addtional comments then close the thread. Stan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •