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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reusing XML Data

Status
Not open for further replies.

LeeGath

Programmer
Jun 3, 2002
13
GB
We are trying to build a set of XML templates for web site design. Our intention is to separate common XML data components so they can be reused, for example navigation information.

We have decided to use Schema's and have two DTD's named main and navigation. We also have two xml files called navigation and main. What we want to do is include the navigation information inside the main file without having to replicate it.

We've drawn blanks so far, so any help is greatly appreciated.

Thanks
 
If you are building pages using XSLT and keep the common information fairly small, you could just include the files as variables in your display XSL file.

<xsl:variable name=&quot;commonNav&quot; select=&quot;document(<filename>)&quot;/>

Then access the data using standard variable syntax.

<xsl:value-of select=&quot;$commonNav/mainHeader/Title&quot;/>

This will slow you down if you have too many common files or they start to get big.

Uura
~~~~
&quot;Common sense tells you that the world is flat.&quot;
 
I've kind of got wind of the xinclude schema, which I think is exactly what I want. The problem is I don't know how to use it and have a feeling I need one of the latest parsers to use it.

Any tips?
 
Don't know your environment or requirements, but there are a few decent free parsers that do most of the latest stuff. I haven't worked with too many older parsers (read - over a year old), so I'm afraid I can't talk to the differences. Sorry.

Uura
~~~~
&quot;Common sense tells you that the world is flat.&quot;
 
Which ones would you recommend and where can I get them from.

Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top