xsl-list
[Top] [All Lists]

Re: XPath query syntax

2005-05-18 20:46:35
Just to show an alternative:

select="/textarea/node()[not(br)]"

Jay Bryant
Bryant Communication Services

----- Original Message ----- 
From: "Aron Bock" <aronbock(_at_)hotmail(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Wednesday, May 18, 2005 6:24 PM
Subject: RE: [xsl] XPath query syntax


Jon, some variant of this should work.  You may also want to use 
normalize-space().

<?xml version="1.0" encoding="iso8859-1"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:output method="xml"/>

    <xsl:template match="/">
        <xsl:for-each select="/textarea/node()[name() != 'br']">
            <line><xsl:copy-of select="."/></line>
        </xsl:for-each>
</xsl:template>

</xsl:stylesheet>


From: jpk <jopaki(_at_)yahoo(_dot_)com>
I have source XML:

<textarea>
  line 1<br/>
  line 2<br/>
  line 3<br/>
  line 4<br/>
</textarea>

How do I query for each of the line texts?  That is, I
need to get each text [node] that preceeds all <br>
tags.

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


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



<Prev in Thread] Current Thread [Next in Thread>