Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 6th, 2006, 12:32 AM
Registered User
 
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default CMS Automation

Hi all

I am brand new to XML et al - I'm an oldstyle programmer and havent touched code in years but enjoying some new challenges, so apologies for the dumb questions. Any pointers would be gratefully received.

What I plan to do is to create some image galleries using XML to reference the images. That piece of work looks ok even though I havent gone through the code - I understand <I think> how it works.
What I want to do is build a front end to maintain several directories containing the images. So that when I empty the directories and reload with new content, I can run a maintenance program to also change the content of the associated xml file.

Is that doable? any code snippets?

btw - dumbass that I am - dev environments -
Win XP, Dreamweaver, PHP/Mysql

thanks guys

george

 
Old June 6th, 2006, 02:25 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Running a program periodically to check whether the contents of a directory have changed is certainly doable, but it's nothing to do with XML, so this might not be the best place to ask.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old June 6th, 2006, 07:20 AM
Registered User
 
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Michael,

I didn't express myself well enough.

While the periodic process would be nice, that isn't why I posted here, I want to build a manual process where first I will change the content of the directories, but then my real question is - how do I recreate the xml file automatically by scanning the directory

eg open file to write, read directory, find a file, write open tags, write file details, write close tags, loop until no more files, write closing tags close file

hope this explains it better.

george

 
Old June 6th, 2006, 07:25 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You do just what you said:

open file to write, read directory, find a file, write open tags, write file details, write close tags, loop until no more files, write closing tags close file

using your favourite programming language.

If you have more specific questions, e.g. "how do I read a directory using VB.NET", then ask them on the appropriate forum.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old June 6th, 2006, 08:41 AM
Registered User
 
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank You.

So let me be forum specific.

can you please point me to a resource which shows me what tags I need to use in my XML file.

thank you.

george

 
Old June 6th, 2006, 08:49 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Now you've got me completely confused.

XML generally has a sending application and a receiving application. If you're writing both, then you can use any tags you like. If you're writing the sending application but not the receiving application, then you need to use the tags (more technically, the schema) that the receiving application understands.

You've talked about writing XML, but you haven't said anything about who will be reading it.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old June 6th, 2006, 09:05 AM
Registered User
 
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks and sorry to confuse.

Now I think I understand.

I had assumed that XML followed strict rules regarding tags, but the answer is in your post. The application which is freely available already uses an XML file with a structure, some of which I do not need but could write as space-filled I guess. That XML file has to be manually rewritten every time you make a change - and that is what my application was trying to automate. I was trying to educate myself and try to understand what the tags meant, what extra I could add etc etc.

But to recap - as long as the xml file I create, I guess mine is the sending application, conforms to this receiving apllication tag structure, then it's all down to writing the php code to write the file!

thanks for your help

george






Similar Threads
Thread Thread Starter Forum Replies Last Post
Extending the CMS retroviz BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 April 23rd, 2008 07:00 AM
CMS abaso.jadhav01 ASP.NET 2.0 Basics 3 November 22nd, 2006 02:47 AM
FCKEditor for CMS anshul Pro PHP 2 August 8th, 2006 03:16 AM
CMS easter BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 12 August 7th, 2006 04:15 PM
CMS anshul Pro PHP 2 May 30th, 2005 01:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.