Excluding Child for Repurposing with XML and XSLT

E

Eric Weiss

I have an XML document that I want to use to create two HTML versions:
one detailed and one a summary. The detailed output is straight forward
to create, but the summary output that excludes the details is giving me
trouble. The original XML file looks like:
<PROJECTS>
<PROJECT>
This is a brief description.
<DETAILS>
There are a lot of details here that should not always be in the output
html file.
</DETAILS>
There might be some more summary stuff here
</PROJECT>
</PROJECTS>

So the XSLT file to create a summary looks something like:
<HTML>
<xsl:apply-templates select="PROJECT">
</HTML>

<xsl:template match="PROJECT">
<xsl:value-of select="."/>
</xsl:template>

Is there any way to do this without adding a <SUMMARY> child to
<PROJECT>? I would prefer not to do that because I am trying to come up
with a very general approach that would allow for different amounts of
information to appear in the detail.

Thanks.

Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top