XPath / XQuery issue with selecting nodes NOT containing a value.

Trying to xinclude content.

This is the data (it is a list of properties to a class) ...

    <classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
    <fieldsynopsis>
     <modifier>protected</modifier>
     <type>string</type>
     <varname linkend="exception.props.message">message</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>private</modifier>
     <type>string</type>
     <varname linkend="exception.props.string">string</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>protected</modifier>
     <type>int</type>
     <varname linkend="exception.props.code">code</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>protected</modifier>
     <type>string</type>
     <varname linkend="exception.props.file">file</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>protected</modifier>
     <type>int</type>
     <varname linkend="exception.props.line">line</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>private</modifier>
     <type>array</type>
     <varname linkend="exception.props.trace">trace</varname>
    </fieldsynopsis>


I now want to document a sub-class. In the sub-class private properties are not to be shown.

To include all the properties, the following tag works just fine.

<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/descendant::db:fieldsynopsis" />


What I want to do is exclude nodes which have a <modifier>private</modifier> sub-node.

I thought the following would work, but it doesn't.

<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/descendant::db:fieldsynopsis[modifier!=private]" />


I also need to extend the same logic to ...

<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis)" />


In both cases, I'm getting the private properties/methods and I want to exclude them.


Any ideas?

Regards,

Richard.
LVL 40
Richard QuadlingSenior Software DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Richard QuadlingSenior Software DeveloperAuthor Commented:
Finally got this working.

<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/descendant::db:fieldsynopsis[(db:modifier/text()='protected') or (db:modifier/text()='public')])" />


0
Richard QuadlingSenior Software DeveloperAuthor Commented:
Better yet.

<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/descendant::db:fieldsynopsis[(db:modifier='protected') or (db:modifier='public')])" />
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.