[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Transform XML to XML

Subject: Re: Transform XML to XML
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 26 Aug 2005 09:56:42 -0400
Re:  Transform XML to XML
Mike,

At 04:54 AM 8/26/2005, David wrote:
        I guess, like security best practices, my mindset is "don't
       allow it unless I explicitly ask for it."
        But I guess it doesn't work that way so I shouldn't fight it.

I typically begin every stylesheet with a template that looks like

<xsl:template match="*">
<xsl:message>Unsupported element: <xsl:value-of select="name()"/></xsl:message>
</xsl:template>


and so have to keep adding templates until my stylesheet stops moaning
on all test cases.

Notice that this override of the built-in default template of David's also has the effect of stopping processing of the tree for branches where it matches (that is, for templates not matched by a "better" template). So until he writes a template to match an element, that element and its contents are now *suppressed* by default.


He could work in a somewhat less draconian fashion (at the cost of seeing many more of these messages early on) if his template had:

<xsl:template match="*">
  <xsl:message>Unsupported element:
   <xsl:value-of select="name()"/></xsl:message>
  <xsl:apply-templates/>
</xsl:template>

Finally, in order to see how this all hangs together one needs to understand how the processor decides which template to use when several templates match a node....

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 ======================================================================

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.