Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How many XML files should I have?

Status
Not open for further replies.

tcrosswell

IS-IT--Management
Oct 14, 2001
26
GB
Just a quick question to clear up something in my mind. If I am creating a webv site with multiple pages should I create a new xml file for EACH page or is it all in one XML file for the entire site.
I was just wondering as I have start creating a simple site were all the content is kept in one XML file for all the pages and it seems to be getting pretty big now and difficult to work on.

Just wanted to know how you all do it.

Thanks

Tom
 
One XML file per page. Sometimes one per DIV. Depends on what's going on on the page.

Chip H.
 
Hi Chip
Thanks for answering my question. With that in mind should I have a XSL file for each of the pages or try to write just one?

Also I was wondering if could could also answer what the @ sign means in this statement:

&quot;<a><xsl:attribute name=&quot;name&quot;><xsl:value-of select=&quot;@id&quot; /></xsl:attribute><xsl:value-of select=&quot;title&quot; /></a>&quot;

Thanks

Tom
 
Hi Tom,

The language used in xsl to query your xml document is called XPath. If you match a node, use the test statement or the select statement, it always evaluates an XPath expression.

The @ points to a attribute of the current node being processed.

Look here: for more about XPath. Although I refer to microsoft, XPath is a W3c recommendation.

Good luck!

Jordi Reineman
 
Thanks a lot Jordi, and thanks for the link. It is most appreciated.

Can you help me with both parts to this question about my first DTD that I am writing.

first off, is this Valid?
<!ELEMENT img (empty)> (or even the best way of doing things)

I read that img should be empty but it says that the element empty in undefined! any help on that?


The next thing is more of a general help.
I have written this DTD (this is the complete thing) for a NEWS page on a simple site that I am creating. Do I need a DTD for each page of the site or just one big DTD?

here is my news DTD:
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<!ELEMENT news (author,time,title,description,content,date,link)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT time (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT content (#PCDATA)>
<!ELEMENT date (#PCDATA)>
<!ELEMENT link (#PCDATA)>
<!ELEMENT img (empty)>
<!ELEMENT menu (name,link,description)>
<!ELEMENT name (#PCDATA)>

so what I have is a page that has a menu and a news section. I am more worried about how I should do the menu section (just a load of links on the left of the page is all I want) so would
<!ELEMENT menu (#PCDATA)> be enough?

Thanks for any help anyone can offer

Tom Crosswell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top