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!

Format of external XML files

Status
Not open for further replies.

Kaele7

Programmer
Dec 5, 2008
6
US
Hello. I'm currently working on a portfolio site where the large text portions are taken from external xml files. I've seen examples of simple xml templates such as:

<?xml version="1.0" encoding="UTF-8"?>

<div class="intro">
<h1>Heading</h1>
<b>Hello world</b>
</div>


can be imported with <xsl:apply-templates> and have the formatting be the same as if you viewed it with html.

However, when I attempted to apply this to my site, it only took the string values and concatenated them onto one line with no formatting at all. Can anyone please explain to me how to fix this. I copied this example directly from someone else, and I can't figure out what they did to make it work.
 
Nevermind. I figured it out, but for those who are interested in knowing how, putting this:

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>


at the top of your xsl file will allow any externally called xml templates to keep their html formatting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top