xsl-list
[Top] [All Lists]

[xsl] Excluding content in an element but retaining children

2006-06-20 11:01:37
I have an XML document listed below that I am using an <xsl:for-each>
rule in my XSLT to transform the data. My problem is that the <author>
element contains content such as commas that do not validate to my DTD.
Is there a way to strip the content of an element, yet still pull all of
the children of the elements and the children's contents? Any
punctuation that appears within the child elements of <author> are fine.
It's just the text (PCDATA) within the <author> element that I need to
remove.

XML Document:

<author>

<authorFname>Jane</authorFname>

            <authorLname>Doe</authorLname>,

<authorDegree>RN, MPS</authorDegree>

</author>

<author>

<authorFname>John</authorFname>

            <authorLname>Doe</authorLname>,

<authorDegree>MD</authorDegree>

</author>


XSLT:


                   <xsl:for-each select="Story/author">

                        <Author>

                            <xsl:apply-templates/>

                        </Author>

                    </xsl:for-each>


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

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Excluding content in an element but retaining children, Chad Chelius <=