2

I have the following XML Schema:

<children>
    <component library="xml">
        <properties Output="1"/>
        <data>
            <root scrollposition="1">
                <entry name="Demo" expanded="1">
                    <entry name="Subentry">
                    </entry>
                </entry>
            </root>
        </data>
    </component>
    <component library="xml">
        <properties/>
        <data>
            <root scrollposition="1">
                <entry name="Demo" expanded="1">
                    <entry name="Subentry">
                    </entry>
                </entry>
            </root>
        </data>
    </component>
</children>

Now i want to get Entries where the Value of the Attribute library is xml and the Value of the Attribute Output in the Element properties is 1. My class is the following:

public class Component {
   @XmlPath("component[@library='xml' and properties[@Output='1']]/data/root/entry")
  private List<Entry> entries;

  public List<Entry> getEntries() {
    return entries;
  }

  public void setEntries(List<Entry> entries) {
    this.entries = entries;
  }
}

But the List is null. I think something in the Annotation 'XmlPath' is wrong but i don't now whats wrong.

Kevin
  • 785
  • 2
  • 10
  • 32

1 Answers1

0

I found out that the Problem is that with the current version of MOXy the XPath Conditions to check if an Attribute exists or the not equal Condition are not supported.

The only Supported Condition is [@name='val']

Kevin
  • 785
  • 2
  • 10
  • 32