INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Request - Improved XML Exporting Option and/or rea  (Read 1628 times)

Diverdown1964

  • Regular Member
  • World Citizen
  • ***
  • Posts: 179
  • No matter where you go, there you are
Request - Improved XML Exporting Option and/or rea
« on: May 29, 2003, 06:29:07 pm »

I'd like to be able to pubish the contents of my Database to a dynamic web server. Right now my only option for getting at the database contents (without using plug in architecture) is the XML export. However, there aren't a lot of choices with XML export (OK, there are none....all or nothing).

True, the XML can be exported, but my export is currently around 50 MB, whick chokes a lot of transformation tools (I'm wrestling with this at the moment). I'd like to be able to choose what gets exported (and maybe when??? Hello Media scheduler???). That XML can then be chopped up, fed into a database, and served up out of a nice fast database (into more XML.... but I digress).

What would be ideal is the ability to design the schema of your XML export as well.

However, if there were a nice, simple, read only API available for the database, I could write something like this. I'd love to be able to read the database on demand from an outside application.

Make sense to anyone?
Logged

Diverdown1964

  • Regular Member
  • World Citizen
  • ***
  • Posts: 179
  • No matter where you go, there you are
Re: Request - Improved XML Exporting Option and/or
« Reply #1 on: May 29, 2003, 06:30:33 pm »

... and I meant to say.... "true, the XML can be transformed ......."
Logged

NoCodeUK

  • Citizen of the Universe
  • *****
  • Posts: 1820
Re: Request - Improved XML Exporting Option and/or
« Reply #2 on: May 30, 2003, 12:17:40 am »

Makes lots of sense to me and would definitely get my vote.  Unfortunately though Nikolay has said this is not a priority at all at the moment.  I think the XML export was only really introduced as a backup restore type feature within MC itself and they never had any intention for it to be used as XML in other software.  Never mind!  Maybe Version 10??

Adam
Logged
"It's called No Code because it's full of code. It's misinformation." - Eddie Vedder

gvag

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 96
  • nothing more to say...
Re: Request - Improved XML Exporting Option and/or
« Reply #3 on: May 30, 2003, 02:51:17 am »

Have you tried the ascii export option?  I know its not a true ascii file but you can massage it into the proper format.  I wrote a little script that does this for me.

I tried the xml/xsl route but trying to get the large value text fields to display properly in the output was beyond me.  I managed to take the flatfile and parse out the redundant infomation and get it displayed pretty much the way I wanted in an html document.

At least the ascii export lets you limit the output to visible fields.  I'm still playing around with it but I basically created an template.htm file that showed one Artist_Album listing then pulled it apart and generated the page dynamically using the data from the ascii file.

I agree tho it would be nice to be able to query the jmd file directly.
Logged

Diverdown1964

  • Regular Member
  • World Citizen
  • ***
  • Posts: 179
  • No matter where you go, there you are
Re: Request - Improved XML Exporting Option and/or
« Reply #4 on: May 30, 2003, 04:31:38 am »

Hmmm... fair enough. Although I don't imagine that a Read Only API would be that difficult. THis would actually be my preferred solution..... then I could write an interface so That I could go against the back end directly from a web server.

No - I haven't tried the ascii export.....I didn't know it was there! In fact I still can't seem to find it. Any hints?
Logged

nila

  • Guest
Re: Request - Improved XML Exporting Option and/or
« Reply #5 on: May 30, 2003, 06:12:16 am »

Hey :)
This is exactly what I've wanted to do for ages.

For me MC is a great GUI for my db. Right now I'm using mySQL. The problem is I cant get the two to talk to each other at all or anything.

I have it all set up for a dynamic website so I can keep track of my albums, movies, etc when I'm not at my computer but I cant seem to work out a good way to link the two together.

The format the XML is in I'm going ot have to play with.

Get MC to export the XML, get php to process it and then add it to mySQL then use this.
Logged

Diverdown1964

  • Regular Member
  • World Citizen
  • ***
  • Posts: 179
  • No matter where you go, there you are
Re: Request - Improved XML Exporting Option and/or
« Reply #6 on: May 30, 2003, 06:17:42 am »

Hey Nila

I'm trying to do something like that, but my current problem is that the file is so big - it chokes. Any of my XSLT transformers "see" invalid characters in my XML stream (although I'm darn sure they're not there).

At the moment, I'm using XMLSpy to export to SQL from the native format. If that flies, I'll write a tool to transform from that format into a more relational format. I'll let you know how that goes.
Logged

sraymond

  • Guest
Re: Request - Improved XML Exporting Option and/or
« Reply #7 on: May 30, 2003, 06:34:01 am »

Quote
Any of my XSLT transformers "see" invalid characters in my XML stream (although I'm ** sure they're not there).


I think all XSLT engines are done by loading the whole document into memory - so increasing memory might help.  Have you tried different XSLT engines/processors?  If you're using XMLSpy, I think they have a built-in processor - I don't know which they use.  But there's certainly MSXSL and Xalan that might provide better results.  You might start with MSXSL (there are a handfull of versions) if you haven't already tried it.

Scott-

Logged

Diverdown1964

  • Regular Member
  • World Citizen
  • ***
  • Posts: 179
  • No matter where you go, there you are
Re: Request - Improved XML Exporting Option and/or
« Reply #8 on: May 30, 2003, 06:43:04 am »

Hi Scott. Yes, they have a built one, and they can use MSXSL. Neither one works nicely. I've also tried Xalan from the command line, and through a servlet. No joy.....
Logged

gvag

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 96
  • nothing more to say...
Re: Request - Improved XML Exporting Option and/or
« Reply #9 on: May 30, 2003, 04:39:50 pm »

funnyguy1964 -

Re ascii export:  File/Export PLaylist/option #4.  Html and Ascii are the only two options that give you any real flexibility in what you export.

Do you have a current version of WinBatch?   If so here's the code:
Quote
exclusive(@on)
fn = strlower(askfilename('Select Library', 'G:\', 'Media Jukebox Library|*.txt|', 'G:\Raw Artist_Album.txt', 1))

fs = filesize(fn)
bin = binaryalloc(fs)
binaryread(bin, fn)

Tabs = binarystrcnt(bin, 0, fs-1, @tab)*17   ; Length of replace string-1.
Br = binarystrcnt(bin, 0, fs-1, strcat(@cr, @crlf))*1
Alloc = fs + Tabs + Br
bout = binaryalloc(Alloc)
binarycopy(bout, 0, bin, 0, fs)

if Tabs then binaryreplace(bout, @tab, '   ', @false)
if Br then binaryreplace(bout, strcat(@cr, @crlf), '
', @false)

; No way to deal with this one.
Chk = binarystrcnt(bout, 0, Alloc-1, '|') mod binarystrcnt(bout, 0, Alloc-1, @lf)
if Chk
  pause(`OUTPUT ERROR`, `Some fields of your database contain the set character "|"%@crlf%Use MC's search and replace to correct this problem?` )   ;***DEBUG LINE***
  goto Cancel
endif

; Need fresh buffers for the next operation.
binaryfree(bin)
bin = binaryalloc(Alloc)
binarycopy(bin, 0, bout, 0, Alloc)
binaryeodset(bout, 0)

; Remove initial '|' from records.
ptr1 = 0
ptr2 = 0
while ptr2<binaryeodget(bin)
  ptr1 = binaryindexex(bin, ptr2, '|', @fwdscan, @false)+1
  ptr2 = binaryindexex(bin, ptr1, @crlf, @fwdscan, @false)+2
  binarycopy(bout, binaryeodget(bout), bin, ptr1, ptr2-ptr1)
endwhile

if askyesno('CONVERT?', 'Convert file to tab delimited format?')==@yes then binaryreplace(bout, '|', @tab, @false)

binarywrite(bout, strreplace(fn, '.txt', '.asc'))  

:Cancel
binaryfree(bin)
binaryfree(bout)

If not the exe is around 373K if you want it my email is gvag@shaw.ca

cheers
Logged
Pages: [1]   Go Up