SunQuest
           XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old August 24th, 2002, 11:48 PM
Mobius Man's Avatar
Mobius Man Mobius Man is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 98 Mobius Man User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 39 m 15 sec
Reputation Power: 6
How could I turn this into a document manager?

I made this XMl template for the purpose of organizing my articles, tutorials, and such for my site. Later on I will build a search engine for my site that I will utilize in searching for these articles with.

However, for the time being, I just need to put my articles in XML. Should I use PHP and/or XSL to parser it? Also, would a DTD be needed for the kind of tags and stuff that I'm using?

<?xml version="1.0" encoding="utf-8"?>

<document type="article,tutorial,editorial,snipplet">

<header>Title of the Document</header>

<date_written year="2002">August 25, 2002</date_written>

<content language="html,css,dhtml,php,java,javascript,xml,none">
Here is where the content of my document will go. Whether it's a article, tutorial, or just a piece of my mind, this is where it'll reside.
</content>


</document>


*Guess I ought to explain what the tags means!*

Anyway the document tag has type= in it so I can describe what kind of document it'll be. (All kinds are in the tag) So, I I right a editorial about Linux, I would set <document type= to "Tutorial".

The <header> is just a title.

<date_written>Is for the date I publish a certain document. The year= attribute is for the aformentioned aid in searching.

Content language is for the tutorial, articles, or code snippets I make for a particular language (like DHTML or PHP). I also have none just in case my document is a rambling rant or something.

Phew! Alright, I'm done. Any suggestions on this is very appreciated. And if you have additional tags/attributes that might be of use, please do tell!

Last edited by Mobius Man : August 24th, 2002 at 11:54 PM.

Reply With Quote
  #2  
Old August 25th, 2002, 05:28 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Yes, you should use some sort of xslt engine to turn your article into html/wml/pdf/txt/doc/other-obscure-format for display

No, you don't need a dtd. You might want one, since it will help you find errors in your documents that cause them to display incorrectly, but you don't need one. After you get the format worked out and few articles created so the bugs are worked out, then you can go back and make a dtd. Before that it's really not worth the effort.

You might want to include an author tag, though that depends on how you're going to use your system.

You'll probably want to give some thought to markup within your content, too. This probably isn't necessary, but stuff like headings, quotes, code snippets, pictures, and links could all be useful. Remember, if you're going to need to be able to search for it later, you're going to want a tag for it.

Last edited by bricker42 : August 25th, 2002 at 05:32 AM.

Reply With Quote
  #3  
Old August 25th, 2002, 05:07 PM
Mobius Man's Avatar
Mobius Man Mobius Man is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 98 Mobius Man User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 39 m 15 sec
Reputation Power: 6
Alright, thanks for the tips. I do have one other question, though. How would I go about adding, say, links or images within an article in XML?

Reply With Quote
  #4  
Old August 25th, 2002, 05:19 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
I'd say duplicate the syntax of the html tag, but give it a more descriptive name. So <link url="ht...">blah</link> and <image source="foo.jpg" width="60" height="200057"/>. Remember, these are references for your xslt to turn into whatever tags are required by your display medium.

Reply With Quote
  #5  
Old August 25th, 2002, 05:27 PM
Mobius Man's Avatar
Mobius Man Mobius Man is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 98 Mobius Man User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 39 m 15 sec
Reputation Power: 6
So I would use XSL to turn the <image source="foo.jpg" width="60" height="200057"/> inot a tag like the Html IMG tag?

Reply With Quote
  #6  
Old August 27th, 2002, 01:00 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Ya.

Reply With Quote
  #7  
Old August 28th, 2002, 10:49 AM
zweistein's Avatar
zweistein zweistein is offline
Will develop for food.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Croatia
Posts: 14 zweistein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to zweistein
Quote:
Originally posted by Mobius Man
So I would use XSL to turn the <image source="foo.jpg" width="60" height="200057"/> inot a tag like the Html IMG tag?


This is the thing that really bothers me in XML/XSLT... If I write the following code (just an example):

Code:
<document>
blahblahblah my document goes here and it's really cool :)
<image src="myimg.gif" width="100" height="200" />
here's the rest of my document...
 </document>


How would I use XSLT to transform that? I read a few things about XSLT, but never found a solution for this question.

Reply With Quote
  #8  
Old August 31st, 2002, 04:14 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Code:
<xsl:template match="text()">
  <xsl:value-of select="."/>
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="/document/image">
  <img src="{@src}" width="{@width}" height="{@height}"/>
<xsl:template>

Last edited by bricker42 : August 31st, 2002 at 04:19 AM.

Reply With Quote
  #9  
Old August 31st, 2002, 06:05 AM
zweistein's Avatar
zweistein zweistein is offline
Will develop for food.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Croatia
Posts: 14 zweistein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to zweistein
Thanks, bricker42, I'll try it!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > How could I turn this into a document manager?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway