xsl-list
[Top] [All Lists]

RE: [xsl] Adding Missing Element

2008-01-23 16:00:51

Hi,

Something like this, I think:

<xsl:template match="A[not B]" >
  . . . copy in your B element template . . .
  . . . other stuff . . .
</xsl:template>

<xsl:template match="A[B]" >
  . . . copy this B element . . .
  . . . other stuff . . .
</xsl:template>

Brad


-----Original Message-----
From: Plana, Richard [mailto:Richard(_dot_)Plana(_at_)mtsallstream(_dot_)com]
Sent: January 23, 2008 5:45 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Adding Missing Element

Hi,

I have what seems like a simple problem but am having problems writing the 
XSLT. I just need to make sure that all instances of an element
(<A>) contains a certain other element (<B>). If it doesn't, then it should add 
an XML fragment <B> from a template into <A>.
--

Richard Plana

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--