RE: [xsl] Implementing a (fairly) complex business rule

Subject: RE: [xsl] Implementing a (fairly) complex business rule
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 30 Sep 2008 12:10:36 -0400
At 11:28 AM 9/30/2008, Mike wrote:
A special case is what one might call "abnormal mixed content", where the
structure is that of mixed content but the semantics are unorthodox: for
example

 <date>2008-09-30
  <source>estimated</source>
  <calendar>Gregorian</calendar>
 </date>

(It would be more usual to use attributes here rather than child elements;
but one also sees comments used.) In such a case you may need to find the
text node (or all the text nodes) explicitly using path expressions.

This is also a good example of what you have to do when dealing with data whose design is, shall we say, "suboptimal".


XSLT, especially XSLT 1.0, is at its best when the incoming data is well designed. When it isn't, one has to call on more advanced techniques such as processing text nodes explicitly. Of course, XSLT also exerts a gravitational pull on XML semantics, such that well-designed XML comes to be the XML that XSLT can handle without fuss.

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