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

Including a XML file from another server 1

Status
Not open for further replies.

MrDimn

Programmer
Aug 1, 2001
2
US
Hi Folks -

I am new to the Dublin Core(DC) XML world, and I am looking for assistance, guidance, direction, or an answer if possible.

Question -

Is it possible to have a XML file pull in another XML document (within the DC standard)?
Or can I just include in another namespace and use xi:include to help pull the file?

Details -

I am working in an environment with 2 web servers.

On server 1, I am handicapped because I am not allowed access to change any of the files or code on it (third-party software). Server 2 I have free reign.

Server 1 is performing a number of primary functions and acting as the home page to the entire site. On that home page are a number of links to server 2, and there is a "news archive" section. Currently, that news section points to a hard-coded file (XML DC standard), which is ultimately useless for my needs -
Not the XML, just that it's hard-coded.

Server 2 acts as the interface to saving news releated stories, and because I can program on server 2, I created a news XML generator.

What I want to do is modify Server 1's xml file to include/pull in/grab the file found on Server 2 and use that for it's content.


Any and all help is appreciated.

Thanks,


Doug
 
Diancecht -

Thanks for the tip. It pointed me in the right direction, it helped me a little bit.

But from there I did a bit more research from the key items in the link you sent me and it lead me to another site which gave me a bit more information and after a long and exhaustive search, I put everything together to get my solution!

I felt like I gave birth!

Here's the solution:

On server 1 - Here's the XML file:

_______________________________________________________
<?xml version="1.0" ?>
<!DOCTYPE rss [

<!ELEMENT rss (channel)>
<!ELEMENT channel (title,link,description,language,item+)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT link (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT language (#PCDATA)>
<!ELEMENT item (title,link,description,dc:state,dc:postdate,dc:expdate)>
<!ELEMENT dc:state (#PCDATA)>
<!ELEMENT dc:postdate (#PCDATA)>
<!ELEMENT dc:expdate (#PCDATA)>

<!ENTITY news SYSTEM "
<!ATTLIST rss version CDATA #IMPLIED>
<!ATTLIST rss xmlns:dc CDATA #FIXED "<!ATTLIST rss xmlns:content CDATA #FIXED "
]>


<rss version="2.0" xmlns:dc=" xmlns:content="
<channel>
<title>News</title>
<link> <description />
&news;
</channel>

</rss>
______________________________________________________

And then the news.xml file on server 2 looked like this:

<item>
<title>A more detailed Headline goes here</title>
<link> <description>A more detailed description goes here</description>
<dc:state>FL</dc:state>
<dc:postdate>2006-01-26</dc:postdate>
<dc:expdate>2006-03-26</dc:expdate>
</item>

<item>
<title>Test Phone Menu Enhancements3</title>
<link> <description>Our phone system menu has changed to make it easier for you to reach us!</description>
<dc:state>CA</dc:state>
<dc:postdate>2006-01-23</dc:postdate>
<dc:expdate>2006-03-23</dc:expdate>
</item>


__________________________________________________________




Hopefully this solution will help others also!


Thanks,

Doug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top