 |
 |
 |
Mindy,
At 03:12 PM 5/1/2005, you wrote:
Now if I use the XSLT in the above link
(http://sources.redhat.com/ml/xsl-list/2000-07/msg00458.html), it does
return the distinct customer name values, but it also writes out the value
of the nodes outside the /projects level, yielding: Customer 1Customer 2 A
Paper Title
This is undoubtedly happening because these nodes are being selected by
default and matched by the built-in templates, so their contents are being
copied to the result tree and written out.
(The Jeni-code in the post cited did not include any of the templates that
would handle other structures in a real case; if you leave those out,
you'll get the default behavior, which is as you describe.)
The solution is either to arrange not to select the nodes you don't want,
or to assure that when they are selected and matched, nothing gets done
with them. (The latter is commonly done by matching them with empty templates.)
Terms to research: built-in templates; XSLT processing model; semantics of
xsl:apply-templates and its select attribute.
Short version: try using a template like this
<xsl:template match="company">
<xsl:apply-templates select="projects"/>
</xsl:template>
to replace the built-in template, which would look like this:
<xsl:template match="company">
<xsl:apply-templates select="child::node()"/>
</xsl:template>
Cheers,
Wendell
======================================================================
Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |