|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
||||
|
||||
|
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?
|
|
#4
|
|||
|
|||
|
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.
|
|
#5
|
||||
|
||||
|
So I would use XSL to turn the <image source="foo.jpg" width="60" height="200057"/> inot a tag like the Html IMG tag?
|
|
#6
|
|||
|
|||
|
Ya.
|
|
#7
|
||||
|
||||
|
Quote:
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. |
|
#8
|
|||
|
|||
|
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. |
|
#9
|
||||
|
||||
|
Thanks, bricker42, I'll try it!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > How could I turn this into a document manager? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|