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

How to include XML in XML file?

Status
Not open for further replies.
Nov 8, 2005
25
CA
Hi there

I guess this question has been asked to death - so here I bring it up again.....

I have this XML page and right now there is an <about> tag that contains information the page name and copyright information.

However the copyright information contains something like 1998-2006 and so instead of going through each XML page to update the year, I would like to extract this whole <about> tag into another file, which each XML can then include. However the <about> tag also contains the module id, e.g. mEmployeeDetail. (that module id will become some kind of a parameter)

So how should I do this then? I am new to XML and worse yet I'm maintaining someone's XML code.

The <about> is pretty straightforward so far, such as
[tt]
<about
style="width:100%;
font-size:10pt;font-family:Verdana,Helvetica,Arial,Sans Serif;
font-weight:bold;
font-style:normal;display:'none';" >
<span id="aboutlabel"
title="Copyright 1995-2006 Something Ltd."
style="position:absolute;top:165px;left:125px;
font-style:normal;
font-family:Verdana,Helvetica,Arial;
font-weight:normal;">
Copyright 1995 - 2006 Something Ltd.
</span>

<span id="aboutlabel"
title="Copyright 1995-2006 Something Ltd.""
style="position:absolute;top:225px;left:125px;
font-style:normal;
font-family:Verdana,Helvetica,Arial;
font-weight:normal;z-index:1;">
Module ID: mEmployeeDetails
</span>
</about>
[/tt]
And I hope to copy that into a separate file (xml) and pass in the ModuleID.

How do I even do that? BTW I have tried googling and I think my XML at work does not support things like xi:include (gosh, I don't even know what these are)

Thanks a lot
Calgarychinese
 
What program or process is creating/modifying the XML?

What do you expect to "pass in"? In this case, the string "mEmployeeDetails"?

Tom Morrison
 
Sorry, it's probably a bad choice of word when I used "parameter" because it sounded like I'm trying to call a function.

So basically, what I just want to do is to put the copyright information in one file, and each XML file can include it. However, the copyright informatio needs to print the module name, and I don't know how that can be accomplished....

Sorry, Tom, nothing to "pass in" really - like I said I made it sound like I'm trying to call a function, which I'm really not.

Nothing is modifying the XML. I have this xsl which will parse the XML content and transform it into an HTML file.

Hope that answers your question?

So, I guess one way of asking the question is, if I have an about.xml file, how will I include it from an XML file, with the intelligence built in so that the module ID will correctly reflect the parent XML page?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top