[AccessD] Parsing XML as a string?

Greg Smith GregSmith at starband.net
Thu Nov 16 11:03:50 CST 2006


Charlotte:

I'm using MS Access 2003, but the system where it will be implemented is
Access XP.

I can look at the XML file using XLMSpy Home and it authenticates to a DTD
for validity.  However, Access does not recognize it as a valid type
because it's attribute-centric XML, not element-centric XML (or so I've
been told).  When I import it into Access, it just comes up with a bunch
of empty tables.  When I append to those tables, it just adds another
empty row.  And I was told that the reason for that is because of the
attribute/element issue, which MS talks about in their Tech Support, but
doesn't address this type of XML.

Greg

> Remind me what version of Access you're using.  ADO is capable to
> handling xml files, but you need to have a good idea of the structure
> involved.  The line breaks don't really count in an xml file, they're
> there for human use.  Can you look at the file in an xml parser?
>
> Charlotte Foust
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Greg Smith
> Sent: Thursday, November 16, 2006 7:46 AM
> To: accessd at databaseadvisors.com
> Subject: [AccessD] Parsing XML as a string?
>
> Hi everyone!
>
> Ok...I admit that trying to import that XML file I had directly into
> Access may have SEEMED like a good, "easy", idea...at the time...but
> after looking around and from the comments here, the idea was...well..it
> sucked.
>  If the XML they were sending to me were compatible then I might have
> had a chance...but it's just not feasible.  There actually wasn't any
> way to define it using a dtd/xls/xlst within my lifetime, so I'm going
> to have to use a different approach.
>
> The files they send as XML are not that large, so I could easily import
> them as text, separate out what I need and put it into the required
> tables.  However, since they send it as a single string, it becomes
> harder to parse it since there are multiple duplicated 'keys' that I
> need to pull from it.  And they're not necessarily in the same position
> all of the time.
>
> I could import it as a single string into a memo field, but I can't
> figure out how to disect a memo field string like that.
>
> When I import it as text, I could break it down at the "<" characters,
> importing each one into a separate columns, but I need them in rows, not
> columns, to search and find the strings of data I need.
>
> So, in summary, my only two choices (that I can think of) are:
>
> 1.  Import the XML as a single string into a memo and somehow parse that
> into the data I need.
> 2.  Import the XML as text, separating it on the "<" characters into
> columns, then somehow magically (transpose columns into rows?) transform
> that to usable information.
>
> ANY suggestions, short of retirement (although not a bad idea...), would
> be GREATLY apprecaited!
>
> Thanks!
>
> Greg Smith
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com






More information about the AccessD mailing list