xsl-list
[Top] [All Lists]

Re: testing for attribute-only

2005-08-29 09:18:06
Trevor:

test="node()" is short for test="child::node()", and will test true on the latter cases while false on the former cases.

test="not(node())" will perform the inverse test.

This is because attributes are not children of their parent elements in the model. Comments, processing instructions, elements and text nodes are the only kinds of things addressable through the child:: (and descendant::) axis.

Cheers,
Wendell

At 12:42 AM 8/28/2005, you wrote:
Is there a concise test for the context node that will distinguish between a
node that has attributes at most:

  <a><a/>
  <a docref="123456"/>

and a node that has more than attributes?

  <a>some text</a>
  <a case="2"><elementary>my dear Watson</elementary><a/>

I have been inadvertently dropping a few dozen of the latter type in trying
to clean up several thousand of the former in my input documents.



======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
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
======================================================================


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